# Database DATABASE_URL=postgres://desk:desk@localhost:5432/thinking_desk # AI providers — at least one required ANTHROPIC_API_KEY= ANTHROPIC_BASE_URL=https://api.anthropic.com OPENAI_API_KEY= OPENAI_BASE_URL=https://api.openai.com/v1 GEMINI_API_KEY= GEMINI_BASE_URL=https://generativelanguage.googleapis.com ZHIPU_API_KEY= ZHIPU_BASE_URL=https://open.bigmodel.cn/api/paas/v4 # Behind an HTTP(S) proxy: Node's built-in fetch (used by the provider adapters) ignores # HTTPS_PROXY / HTTP_PROXY unless Node starts with NODE_USE_ENV_PROXY=1 (Node >= 22.21 or 24). # Set it in the environment that starts Node, e.g. `NODE_USE_ENV_PROXY=1 pnpm dev`; no proxy # package is needed. Without it, proxied AI calls fail with `fetch failed`. # Task → provider routing. Two forms: # AI_MODEL_= → auto-pick a model from that provider's /models endpoint # AI_MODEL_=: → pin a specific model id # Task names are defined in src/lib/ai/types.ts (AiTask union). # If not set, AI_MODEL_DEFAULT is used. If neither set, the first configured provider is picked. # Example pins (current recommendations, see README "Model Recommendations"): # claude:claude-sonnet-5-5 · gemini:gemini-3.8-flash · openai:gpt-6.1-sol · zhipu:glm-5.2 AI_MODEL_DEFAULT=claude # Every task in use is listed below; leave empty to fall back to AI_MODEL_DEFAULT. # 01 Brief AI_MODEL_BRIEF_CLARIFY= AI_MODEL_BRIEF_EXTRACT= AI_MODEL_BRIEF_PROBE= # 02 Users AI_MODEL_USERS_JTBD= # 03 Stakeholders AI_MODEL_STAKE_MATRIX= # 04 Alternatives — the only task that requests web search (Gemini grounding / Zhipu web_search) AI_MODEL_ALT_SCAN=gemini # 05 Scenarios AI_MODEL_SCEN_FEED= AI_MODEL_SCEN_PAIN= # 06 Features AI_MODEL_FEAT_DRAFT= # 07 Creative Leap AI_MODEL_LEAP_FIRST_PRINCIPLES= AI_MODEL_LEAP_ANALOGY= AI_MODEL_LEAP_CONSTRAINT_FLIP= # 08 Design proposal AI_MODEL_DESIGN_PROPOSAL= # 09 Subfeature split AI_MODEL_SPLIT_SUBFEATURES= # Cross-node consistency check (manual button; reads the accepted items of every node) AI_MODEL_CONSISTENCY_CHECK= # Copilot (free-form questions, derived follow-ups) AI_MODEL_FREE_ASK= AI_MODEL_FOLLOW_UPS= # App NODE_ENV=development # --- Public-deployment hardening (recommended when not localhost) --- # 1) Bearer-token auth for /api/* — strongly recommended if exposed to public network. # When REQUIRE_AUTH=true, all /api/* requests must carry `Authorization: Bearer `. REQUIRE_AUTH=false REQUIRE_AUTH_TOKEN= # 2) Per-IP rate limit on /api/ai/* and, in its own bucket, /api/sources/* (in-memory, single-process). # Defaults: 20 requests per 60s window. Lower for stricter quota protection. RATE_LIMIT_WINDOW_MS=60000 RATE_LIMIT_MAX=20 # 3) Allow non-default AI provider hostnames (e.g. proxies). When false (default), # *_BASE_URL must point at the canonical vendor host. ALLOW_CUSTOM_AI_BASE_URL=false