pub mod anthropic;
pub mod auth_store;
pub mod codex;
pub mod pkce;
pub mod runtime;
pub const XAI_OAUTH_PROVIDER: &str = "xai-oauth";
pub const NOUS_PROVIDER: &str = "nous";
pub const XAI_OAUTH_ALIASES: &[&str] = &[
"grok",
"grok-oauth",
"x-ai-oauth",
"xai-grok-oauth",
"super-grok",
"super_grok",
];
pub fn is_xai_oauth_alias(target: &str) -> bool {
let t = target.to_ascii_lowercase();
t == XAI_OAUTH_PROVIDER || XAI_OAUTH_ALIASES.contains(&t.as_str())
}
pub const ANTHROPIC_OAUTH_ALIASES: &[&str] = &["anthropic", "claude-pro", "claude_pro", "claude"];
pub fn is_anthropic_oauth_alias(target: &str) -> bool {
let t = target.to_ascii_lowercase();
ANTHROPIC_OAUTH_ALIASES.contains(&t.as_str())
}
pub use anthropic::{
AnthropicOAuthLoginOptions, anthropic_oauth_path, login_anthropic_oauth,
read_anthropic_oauth_file, refresh_anthropic_from_store, remove_anthropic_oauth_file,
resolve_anthropic_oauth_access_token,
};
pub use codex::{
CodexDeviceLoginOptions, CodexDevicePrompt, OPENAI_CODEX_PROVIDER, codex_has_credentials,
is_openai_codex_alias, login_codex_device_oauth, refresh_codex_from_store, remove_codex_oauth,
resolve_codex_access_token,
};
pub use runtime::{inject_subscription_oauth_env, prepare_openai_codex_compatible_env};