import { createEnv } from "@t3-oss/env-core";
import { z } from "zod";

export const env = createEnv({
  emptyStringAsUndefined: true,
  runtimeEnv: process.env,
  server: {
    AGENT_BACKEND_URL: z.url().optional(),
    CONVEX_SITE_URL: z.url(),
    FLUE_DB_TOKEN: z.string().min(1),
    FLUE_URL: z.url().optional(),
    GITEA_TOKEN: z.string().min(1).optional(),
    GITEA_URL: z.url().default("https://git.openputer.com"),
    GITHUB_CLIENT_ID: z.string().min(1).optional(),
    GITHUB_CLIENT_SECRET: z.string().min(1).optional(),
    GIT_CREDENTIAL_ENCRYPTION_KEY: z.string().min(43).optional(),
    NATIVE_APP_URL: z.string().min(1).default("code://"),
    SITE_URL: z.url(),
  },
});
