/** * Environment Variable Extractor * * Detects env vars used in a project from two complementary sources: * 1. Declaration files — .env.example, .env.local, .env (with optional comments) * 2. Source code — process.env.X (JS/TS), os.environ["X"] (Python), * os.Getenv("X") (Go), ENV["X"] (Ruby) * * Variables found in declaration files are marked hasDefault=true when the * declaration line has a non-empty value. Variables found only in source code * are marked required=true (no known default). */ export interface EnvVar { /** Environment variable name, e.g. DATABASE_URL */ name: string; /** Relative path(s) where the variable was found */ files: string[]; /** True when declared in .env.example with a non-empty value */ hasDefault: boolean; /** True when used in source code without a fallback (process.env.X without ?? or ||) */ required: boolean; /** Inline comment from .env.example, if present */ description?: string; } /** * Extract all environment variables referenced or declared in the project. */ export declare function extractEnvVars(filePaths: string[], rootDir: string): Promise; /** * Return a compact summary string for LLM prompts. */ export declare function summarizeEnvVars(vars: EnvVar[]): string; /** * One environment-variable READ in source, located to a line, with a per-site * fallback verdict. The read-site refinement of {@link extractFromSource}: same * per-language patterns, but it keeps WHERE each read is and whether THAT site * has an immediate fallback — the input `analyze_env_impact` needs to map a read * to its enclosing function and classify the break as hard vs. soft. */ export interface EnvReadSite { /** Environment variable name, e.g. DATABASE_URL */ name: string; /** Repo-relative path of the file the read is in */ file: string; /** 1-based line of the read */ line: number; /** * True when no immediate fallback was detected AT THIS site (a hard break if * the var is removed). A fallback elsewhere does not clear it — per-site only. * A documented heuristic, not a guarantee. */ required: boolean; } /** * Extract every environment-variable READ site in one file, line-precise, reusing * the existing per-language patterns (no new grammar). Returns [] for a file in a * language the patterns do not cover — an honest absence, never a guessed read. * Deterministic: stable order (line, then name). */ export declare function extractEnvReadSites(source: string, relPath: string, ext: string): EnvReadSite[]; //# sourceMappingURL=env-extractor.d.ts.map