systemprompt_cloud/
lib.rs1pub mod api_client;
48pub mod auth;
49mod callback_listener;
50pub mod checkout;
51pub mod cli_session;
52pub mod constants;
53pub mod credentials;
54pub mod credentials_bootstrap;
55pub mod deploy;
56pub mod docker;
57pub mod error;
58pub mod oauth;
59pub mod paths;
60pub mod profile_authoring;
61pub mod secrets_env;
62pub mod tenants;
63pub mod trusted_proxies;
64
65pub use api_client::{
66 CheckoutEvent, CheckoutResponse, CloudApiClient, DeployResponse, ListSecretsResponse, Plan,
67 ProvisioningEvent, ProvisioningEventType, RegistryToken, StatusResponse, SubscriptionStatus,
68 Tenant, TenantInfo, TenantSecrets, TenantStatus, UserInfo, UserMeResponse,
69};
70pub use checkout::{
71 CheckoutCallbackResult, CheckoutTemplates, run_checkout_callback_flow, wait_for_provisioning,
72};
73pub use cli_session::{
74 CliSession, LOCAL_SESSION_KEY, SessionBinding, SessionIdentity, SessionKey, SessionStore,
75};
76pub use constants::api::{PRODUCTION_URL, SANDBOX_URL};
77pub use credentials::CloudCredentials;
78pub use credentials_bootstrap::{CredentialsBootstrap, CredentialsBootstrapError};
79pub use deploy::DockerfileBuilder;
80pub use docker::{CommandRunner, CommandSpec, DockerCli, SystemCommandRunner};
81pub use error::{CloudError, CloudResult};
82pub use oauth::{OAuthTemplates, run_oauth_flow};
83pub use paths::{
84 CloudPath, CloudPaths, DiscoveredProject, ProfilePath, ProjectContext, ProjectPath,
85 UnifiedContext, expand_home, get_cloud_paths, resolve_path,
86};
87pub use tenants::{StoredTenant, TenantStore, TenantType};
88
89use clap::ValueEnum;
90
91#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, ValueEnum)]
92pub enum Environment {
93 #[default]
94 Production,
95 Sandbox,
96}
97
98impl Environment {
99 #[must_use]
100 pub const fn api_url(&self) -> &'static str {
101 match self {
102 Self::Production => PRODUCTION_URL,
103 Self::Sandbox => SANDBOX_URL,
104 }
105 }
106}
107
108#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
109pub enum OAuthProvider {
110 Github,
111 Google,
112}
113
114impl OAuthProvider {
115 #[must_use]
116 pub const fn as_str(&self) -> &'static str {
117 match self {
118 Self::Github => "github",
119 Self::Google => "google",
120 }
121 }
122
123 #[must_use]
124 pub const fn display_name(&self) -> &'static str {
125 match self {
126 Self::Github => "GitHub",
127 Self::Google => "Google",
128 }
129 }
130}