/**
 * Environment configuration for the daemon.
 * GATEWAY_URL: WebSocket URL for the gateway server
 * SUPABASE_URL: Supabase project URL for OAuth redirects
 */
const DEFAULT_GATEWAY_URL = "wss://pocketcoder-gateway.fly.dev";
const DEFAULT_SUPABASE_URL = "https://ajsbcbsffnjfsvslabih.supabase.co";
/**
 * Load and validate environment configuration.
 * Reads GATEWAY_URL and SUPABASE_URL from process.env with production defaults.
 */
export function getEnv() {
    const gatewayUrl = process.env.GATEWAY_URL ?? DEFAULT_GATEWAY_URL;
    const supabaseUrl = process.env.SUPABASE_URL ?? DEFAULT_SUPABASE_URL;
    if (!gatewayUrl.startsWith("ws://") && !gatewayUrl.startsWith("wss://")) {
        throw new Error(`Invalid GATEWAY_URL: "${gatewayUrl}". Must start with ws:// or wss://`);
    }
    if (!supabaseUrl.startsWith("https://")) {
        throw new Error(`Invalid SUPABASE_URL: "${supabaseUrl}". Must start with https://`);
    }
    return { gatewayUrl, supabaseUrl };
}
//# sourceMappingURL=env.js.map