export interface RelayConfig { transport: "stdio" | "http" | "both"; http_port: number; http_host: string; webhook_timeout_ms: number; api_allowlist: string[]; /** * If set, HTTP requests must include "Authorization: Bearer " (or * "X-Relay-Secret: "). First entry is the primary/preferred secret; * subsequent entries are accepted during rotation grace. */ http_secret: string | null; /** * Additional accepted secrets during a rotation window. Audit log tags which * secret index was used so operators can see who is still on the old secret. */ http_secrets_previous: string[]; /** * ADR-0006: the DASHBOARD / OPERATOR secret. This authenticates the operator * principal for the dashboard and operator-power endpoints (kill-agent, * wake-agent, set-status, …). It is DELIBERATELY SEPARATE from `http_secret` * (the agent *transport* credential every HTTP agent holds): agents and the * operator are different principals with different lifetimes and rotation, so * one secret must not authorize both. `relay init` generates one by default * (secret-by-default) so operator endpoints are always satisfiable. Resolution * is `RELAY_DASHBOARD_SECRET || dashboard_secret` and NOTHING ELSE — the old * `http_secret` fallback was removed because it was a live privilege- * escalation (an agent transport credential reaching operator power); do not * re-add it as a convenience. */ dashboard_secret: string | null; /** Messages per agent per hour. 0 disables the limit. */ rate_limit_messages_per_hour: number; /** Tasks posted per agent per hour. 0 disables. */ rate_limit_tasks_per_hour: number; /** Spawn calls per agent per hour. 0 disables. */ rate_limit_spawns_per_hour: number; /** * CIDR blocks of trusted reverse proxies. When the direct socket peer IP * falls in one of these, X-Forwarded-For is honored (leftmost-untrusted hop). * When this list is empty (DEFAULT), X-Forwarded-For is IGNORED completely * and rate limits key on the direct peer IP only — prevents spoofing. */ trusted_proxies: string[]; /** * Allowed browser Origins for the dashboard and /api/snapshot (CORS). * Defaults cover local dev: http://localhost and http://127.0.0.1 on any port. * A request with an Origin header NOT in this list returns 403. Non-browser * callers (no Origin header) are always allowed. /health is always exempt. * Glob supported: a trailing "*" after a scheme+host matches any port/path. */ allowed_dashboard_origins: string[]; } export declare const DEFAULT_CONFIG: RelayConfig; export declare function getConfigPath(): string; export declare class InvalidConfigError extends Error { constructor(message: string); } /** * v2.2.1 L2 (Codex audit): return the set of keys actually present in the * config file (if any). Used by `src/cli.ts applyCliToEnv` to label * config-file-won values as source="config" in the startup log instead of * mislabeling them as "default". Returns empty set when no file exists or * parse fails — safe to treat as "no keys overridden at the file layer." */ export declare function readConfigFileKeys(): Set; export declare function loadConfig(): RelayConfig; /** * ADR-0006 — resolve the DASHBOARD / OPERATOR secret. The chain is * `RELAY_DASHBOARD_SECRET` (env) || `dashboard_secret` (config) — and NOTHING * ELSE. The former `|| http_secret` fallback was REMOVED as a privilege- * ESCALATION path (authMiddleware enforces http_secret on /mcp, so every HTTP * agent already holds it; falling back to it let an agent *transport* credential * satisfy *operator* auth). Do not re-add it as a convenience. * * This is the SINGLE definition of the predicate. Every dashboard/operator auth * site consumes it — the HTTP dashboardAuthCheck / csrfCheck / operatorAuthCheck * AND the dashboard WebSocket gate (websocket.ts) — so the predicate cannot * drift between surfaces (ADR-0015 L4). The caller supplies the config source * (a captured config, or a fresh loadConfig()); the env is always read live. */ export declare function resolveDashboardSecret(config: RelayConfig): string | null; export declare function validateConfigAndEnv(config: RelayConfig): void; //# sourceMappingURL=config.d.ts.map