import { z } from "zod"; const stringBool = (defaultValue: string) => z .string() .default(defaultValue) .refine((s) => s === "true" || s === "false") .transform((s) => s === "true"); export const envConfig = z .object({ RESTATE_LISTEN_PORT: z.coerce.number().optional(), RESTATE_INGRESS_ADDR: z .string() .optional() .default("http://localhost:8080"), RESTATE_ADMIN_ADDR: z.string().optional().default("http://localhost:9070"), RESTATE_PUB_KEY: z.string().optional(), RESTATE_EXPOSE_CORE_SERVICES: stringBool("true"), // Deployment mode configuration - allows running dispatchers and runners separately RESTATE_ENABLE_DISPATCHERS: stringBool("true"), RESTATE_ENABLE_RUNNERS: stringBool("true"), }) .parse(process.env);