/** * Centralized environment access for `@reclaimprotocol/agent`. * * This is the ONLY non-test source file under `src/` that reads * `process.env`. Every other module imports a getter from here instead of * touching `process.env` directly. * * Almost everything is exposed as a LAZY GETTER FUNCTION rather than an eager * `const`, on purpose: several tests mutate env at runtime (mcp-credentials * sets/deletes RECLAIM_PRIVATE_KEY / RECLAIM_PRIVATE_KEY_FILE / RECLAIM_HOME; * old-devtools sets/deletes USE_OLD_DEVTOOLS), and most of these vars are read * at call time anyway. An eager const captured at import time would freeze the * value and break those tests. The one eager const that's safe is `LOG_LEVEL`, * which is read once at logger construction. * * Each var's default/fallback literal is co-located with its getter. */ import { DEFAULT_BASE_URL } from '@reclaimprotocol/client/api'; import { DEFAULT_OLD_API_URL, DEFAULT_OLD_LOGS_URL } from './old/client.ts'; import { DEFAULT_SDK_API_URL } from './old/sdk-client.ts'; /** Public attestor websocket URL — fallback for `RECLAIM_ATTESTOR_URL`. */ export declare const FALLBACK_ATTESTOR_URL = "wss://attestor.reclaimprotocol.org:444/ws"; /** The devtools dashboard login page — fallback for `RECLAIM_OLD_LOGIN_URL`. */ export declare const DEFAULT_LOGIN_URL = "https://dev.reclaimprotocol.org"; export { DEFAULT_BASE_URL, DEFAULT_OLD_API_URL, DEFAULT_OLD_LOGS_URL, DEFAULT_SDK_API_URL, }; /** Pino log level. Read once at logger construction, so an eager const is * safe (no test mutates LOG_LEVEL at runtime). */ export declare const LOG_LEVEL: string; /** Reclaim cache directory (`~/.reclaim`). `RECLAIM_HOME` overrides it so * tests can sandbox writes. */ export declare function reclaimHome(): string; /** * `USE_OLD_DEVTOOLS` — single source of truth for which backend the MCP * server targets. Defaults to OLD devtools while the builder backend is under * development. Builder mode must be opted into EXPLICITLY with * `USE_OLD_DEVTOOLS=false`; anything else keeps old mode on. */ export declare function useOldDevtools(): boolean; /** * Effective mode, layering the persisted preference under the env var: * explicit `USE_OLD_DEVTOOLS` wins → persisted config `mode` → default (old). * The persisted value comes from `~/.reclaim/config.json` (set via the * `set_devtools_mode` tool); the caller reads it so this module needn't import * `ConfigStore` (which would create an import cycle). */ export declare function resolveOldMode(persisted?: 'old' | 'builder'): boolean; /** * Where the effective mode came from — the same precedence as * `resolveOldMode`: explicit `USE_OLD_DEVTOOLS` env var → persisted config * `mode` → default (old). Surfaced by the `get_devtools_mode` tool so the * user can tell why the server is in the mode it reports. */ export declare function oldModeSource(persisted?: 'old' | 'builder'): 'env' | 'config' | 'default'; /** `%LOCALAPPDATA%` on Windows, used to probe a per-user Chrome install. */ export declare function localAppData(): string | undefined; /** Explicit Chrome/Edge/Chromium binary path override. */ export declare function chromePath(): string | undefined; /** Agent tools (Chrome CDP capture, synthesis, proof) are disabled in hosted * deployments by setting `RECLAIM_AGENT_DISABLED=1`. Shared by mcp/start and * the old-mode authenticate tool. */ export declare function agentDisabled(): boolean; /** Old-devtools backend base URL. */ export declare function oldApiUrl(): string; /** Old-devtools analytics-logs service base URL (separate host). */ export declare function oldLogsUrl(): string; /** Public production SDK-backend base URL — the service the verification * SDK/attestor itself reads a provider's recipe from at runtime. A * DIFFERENT host from the old-devtools dashboard backend (`oldApiUrl`). */ export declare function sdkApiUrl(): string; /** Builder backend base URL. Shared by mcp/start and the verification tool. */ export declare function apiUrl(): string; /** Explicit builder API token (overrides the cached session token). */ export declare function apiToken(): string | undefined; /** Diagnostic trace capture (`RECLAIM_AGENT_TRACE=1`). Shared by the attestor * logger capture and the proof-run dump. */ export declare function agentTraceEnabled(): boolean; /** Attestor websocket URL override (`RECLAIM_ATTESTOR_URL`). */ export declare function attestorUrlOverride(): string | undefined; /** Raw 0x-hex Ethereum private key (`RECLAIM_PRIVATE_KEY`). */ export declare function privateKey(): string | undefined; /** Path to a raw-hex key file (`RECLAIM_PRIVATE_KEY_FILE`). */ export declare function privateKeyFile(): string | undefined; /** Per-org bearer secret (`rorg_…`) used to authenticate verification reads. */ export declare function orgSecret(): string | undefined; /** Dashboard Firebase bearer token for the old backend. */ export declare function oldApiToken(): string | undefined; /** An `eth:` (or bare `0x…`) uid for the old backend. */ export declare function oldEthUid(): string | undefined; /** Override for the old-devtools dashboard login URL. */ export declare function oldLoginUrl(): string | undefined;