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::{CliSession, LOCAL_SESSION_KEY, SessionIdentity, SessionKey, SessionStore};
74pub use constants::api::{PRODUCTION_URL, SANDBOX_URL};
75pub use credentials::CloudCredentials;
76pub use credentials_bootstrap::{CredentialsBootstrap, CredentialsBootstrapError};
77pub use deploy::DockerfileBuilder;
78pub use docker::{CommandRunner, CommandSpec, DockerCli, SystemCommandRunner};
79pub use error::{CloudError, CloudResult};
80pub use oauth::{OAuthTemplates, run_oauth_flow};
81pub use paths::{
82 CloudPath, CloudPaths, DiscoveredProject, ProfilePath, ProjectContext, ProjectPath,
83 UnifiedContext, expand_home, get_cloud_paths, resolve_path,
84};
85pub use tenants::{StoredTenant, TenantStore, TenantType};
86
87use clap::ValueEnum;
88
89#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, ValueEnum)]
90pub enum Environment {
91 #[default]
92 Production,
93 Sandbox,
94}
95
96impl Environment {
97 #[must_use]
98 pub const fn api_url(&self) -> &'static str {
99 match self {
100 Self::Production => PRODUCTION_URL,
101 Self::Sandbox => SANDBOX_URL,
102 }
103 }
104}
105
106#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
107pub enum OAuthProvider {
108 Github,
109 Google,
110}
111
112impl OAuthProvider {
113 #[must_use]
114 pub const fn as_str(&self) -> &'static str {
115 match self {
116 Self::Github => "github",
117 Self::Google => "google",
118 }
119 }
120
121 #[must_use]
122 pub const fn display_name(&self) -> &'static str {
123 match self {
124 Self::Github => "GitHub",
125 Self::Google => "Google",
126 }
127 }
128}