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