/** * @file `socket-lib check primordials` handler. Loads a JSON config from disk * (default `primordials-coverage.config.json` at the repo root, override with * `--config `), runs the drift check, and renders the result. * socket-lib check primordials socket-lib check primordials --config * ./primordials.config.json socket-lib check primordials --json # * machine-readable output socket-lib check primordials --explain # one * detailed line per finding socket-lib check primordials --silent # silent on * success Exit codes: 0 — no drift 1 — drift detected (or config / lookup * error) */ import type { PrimordialsCheckConfig, PrimordialsCheckResult, PrimordialsFinding } from '../primordials/checks/primordials.js'; export declare const FALLBACK_CONFIG_PATHS: readonly string[]; export interface ParsedArgs { readonly config: string | undefined; readonly json: boolean; readonly explain: boolean; readonly silent: boolean; readonly help: boolean; } export interface RawConfig { scanDirs?: unknown | undefined; aliasMap?: unknown | undefined; nodeInternalOnly?: unknown | undefined; socketLibPrimordialsPath?: unknown | undefined; } export interface SerializedFinding { kind: PrimordialsFinding['kind']; name: string; files: readonly string[]; hint: string; } export declare function loadConfig(configPath: string): PrimordialsCheckConfig; export declare function parseArgs(argv: readonly string[]): ParsedArgs; export declare function printHelp(): void; export declare function renderHuman(result: PrimordialsCheckResult, args: ParsedArgs): void; /** * Pick the config file. Returns the explicit `--config` argument when given * (even if it doesn't exist — the caller will surface the error with the path * they typed). Otherwise probes the fallback list in order and returns the * first hit. Returns the head of the list when none exist, so the caller's * "config file not found" error message names the canonical default. * * `baseDir` is the directory the relative candidates resolve against; it * defaults to `getNodeProcess().cwd()`, the repo root the user runs from, and * is a parameter so callers/tests can probe a fixture tree without * `getNodeProcess().chdir`. */ export declare function resolveConfigPath(explicit: string | undefined, baseDir?: string): string; export declare function runCheckPrimordials(argv: readonly string[]): Promise; export declare function serialize(result: PrimordialsCheckResult): { ok: boolean; used: number; findings: SerializedFinding[]; };