systemprompt_cloud/
lib.rs1pub mod api_client;
47pub mod auth;
48mod callback_listener;
49pub mod cli_session;
50pub mod constants;
51pub mod credentials;
52pub mod credentials_bootstrap;
53pub mod deploy;
54pub mod docker;
55pub mod error;
56pub mod logout;
57pub mod oauth;
58pub mod paths;
59mod private_dir;
60pub mod profile_authoring;
61pub mod secrets_env;
62pub mod tenants;
63pub mod trusted_proxies;
64
65pub use api_client::{
66 CloudApiClient, CloudStatusResponse, CloudTenant, CloudTenantInfo, CloudTenantSecrets,
67 CloudTenantStatusResponse, CloudUserInfo, DeployResponse, RegistryToken, SubscriptionStatus,
68 UserMeResponse,
69};
70pub use cli_session::{
71 CliSession, LOCAL_SESSION_KEY, SessionBinding, SessionIdentity, SessionKey, SessionStore,
72};
73pub use constants::api::{PRODUCTION_URL, SANDBOX_URL};
74pub use credentials::CloudCredentials;
75pub use credentials_bootstrap::{CredentialsBootstrap, CredentialsBootstrapError};
76pub use deploy::DockerfileBuilder;
77pub use docker::{CommandRunner, CommandSpec, DockerCli, SystemCommandRunner};
78pub use error::{CloudError, CloudResult, DeploySource};
79pub use logout::{ClearedCloudState, clear_cloud_state};
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}