/** * Cowork Service configuration — Zod-validated environment variables. * * Port: 4009 (default) * Product: clawcowork */ import { z } from 'zod'; const envSchema = z.object({ PORT: z.coerce.number().default(4009), HOST: z.string().default('0.0.0.0'), NODE_ENV: z.enum(['development', 'production', 'test']).default('development'), CORS_ORIGIN: z.string().optional(), SERVICE_NAME: z.string().default('cowork-service'), // Platform-service connection (for auth, flags, audit, etc.) PLATFORM_SERVICE_URL: z.string().default('http://localhost:4003'), PRODUCT_ID: z.string().default('clawcowork'), // Rust runtime IPC — path to the cowork-orchestrator binary RUST_RUNTIME_BIN: z.string().default('cowork-orchestrator'), RUST_RUNTIME_TIMEOUT_MS: z.coerce.number().default(300_000), // Anthropic (passed through to Rust runtime) ANTHROPIC_API_KEY: z.string().optional(), }); export const config = envSchema.parse(process.env);