// Proxy module constants

export const DEFAULT_UPSTREAM = "https://api.anthropic.com";
export const DEFAULT_OPENAI_UPSTREAM = "https://api.openai.com/v1";

// Unified proxy identity - used as user-agent and x-proxy-identity header value
export const PROXY_IDENTITY = process.env["PROXY_IDENTITY"] ?? "inspector9527@Tony";

// API paths
export const PATH_V1_CHAT_COMPLETIONS = "/v1/chat/completions";
export const PATH_CHAT_COMPLETIONS = "/chat/completions";
export const PATH_V1_MESSAGES = "/v1/messages";

// Header names
export const HEADER_CONTENT_TYPE = "content-type";
export const HEADER_USER_AGENT = "user-agent";
export const HEADER_X_PROXY_IDENTITY = "x-proxy-identity";
export const HEADER_AUTHORIZATION = "authorization";
export const HEADER_X_API_KEY = "x-api-key";
export const HEADER_CONTENT_ENCODING = "content-encoding";
export const HEADER_CONTENT_LENGTH = "content-length";
export const HEADER_HOST = "host";

// Auth header types
export const AUTH_HEADER_X_API_KEY = "x-api-key";

// Content types
export const CONTENT_TYPE_EVENT_STREAM = "text/event-stream";

// Response status
export const STATUS_FORBIDDEN = 403;
export const STATUS_BAD_GATEWAY = 502;

// Standard/safe headers to preserve when forwarding to upstream.
// NOTE: Authorization is intentionally excluded to prevent client auth tokens from leaking.
export const PRESERVE_HEADERS = new Set([HEADER_CONTENT_TYPE]);

// Opt-in rewrite: the *initial* value for the strip-Claude-Code-billing-header
// flag. The runtime, mutable source of truth is `src/proxy/config.ts`, which
// reads this constant at module-load time as its precedence-2 fallback (after
// the persisted `data/config.json`, before the `false` default). After boot,
// the handler reads `getConfig().stripClaudeCodeBillingHeader` on every
// request, so a PATCH to `/api/config` (or the Settings → Proxy tab in the UI)
// takes effect without a restart. The env var itself is read once at boot.
//
// What it does: when enabled, the proxy strips the
// `x-anthropic-billing-header:` text block that Claude Code prepends to the
