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