/**
 * Environment Flag: Is Platform (Self-Hosted / Local Mode)
 *
 * When true, the app runs in single-user local mode:
 * - Skips JWT authentication (uses first DB user)
 * - Claude Code SDK runs directly on the machine
 * - No relay connection needed
 *
 * Auto-detected when:
 * - VITE_IS_PLATFORM=true is set, OR
 * - Running locally (not on Railway/Vercel/cloud)
 */
const isCloudEnv = !!(
    process.env.RAILWAY_ENVIRONMENT ||
    process.env.VERCEL ||
    process.env.RENDER ||
    process.env.FLY_APP_NAME ||
    process.env.HEROKU_APP_NAME
);

export const IS_PLATFORM = process.env.VITE_IS_PLATFORM === 'true' || (!isCloudEnv && !process.env.FORCE_HOSTED_MODE);

/**
 * True when running on a cloud provider (Railway, Vercel, etc.)
 */
export const IS_CLOUD = isCloudEnv;

/**
 * True when running locally (self-hosted mode)
 */
export const IS_LOCAL = IS_PLATFORM && !isCloudEnv;