import { type RunTrackedResult } from "./exec.js"; export type AnalyzerDepVia = "repo" | "cache" | "absent"; export interface ResolvedAnalyzerDep { via: AnalyzerDepVia; /** Absolute path to the resolved package directory (when via != "absent"). */ path?: string; } export interface ResolveAnalyzerDepOptions { /** Override the cache root; defaults to ~/.audit-tools/analyzer-cache. */ cacheRoot?: string; /** * Injectable logger for observability output. Defaults to `console.error` * so existing behaviour is preserved when callers do not supply one. * Inject a no-op or custom logger in tests/contexts that need to redirect or * suppress output. * * Signature matches `console.error` so callers can pass it directly: * `log: console.error`. */ log?: (...args: unknown[]) => void; } /** * Shared analyzer cache root. Defaults to ~/.audit-tools/analyzer-cache; the * `AUDIT_TOOLS_ANALYZER_CACHE` environment variable overrides it so a run can be * pinned to an isolated cache (e.g. tests that need dependency resolution to be * deterministic regardless of what the host machine has previously cached). */ export declare function analyzerCacheRoot(): string; interface ParsedSpec { name: string; version?: string; } /** Parse "name", "name@version", or "@scope/name@version". */ export declare function parseAnalyzerSpec(spec: string): ParsedSpec; /** * Resolve an analyzer dependency: repo node_modules → version-keyed cache → * absent. `pkg` may be a bare name or "name@version"; a version narrows the * cache lookup, otherwise the newest cached version is chosen. */ export declare function resolveAnalyzerDep(pkg: string, repoRoot: string, options?: ResolveAnalyzerDepOptions): ResolvedAnalyzerDep; export interface InstallToCacheOptions { cacheRoot?: string; /** Injectable command runner; defaults to the shared runTracked. */ run?: (argv: string[], cwd: string) => RunTrackedResult; /** * Injectable logger for observability output. Defaults to `console.error` * so existing behaviour is preserved when callers do not supply one. * Inject a no-op or custom logger in tests/contexts that need to redirect or * suppress output. */ log?: (...args: unknown[]) => void; } export interface InstallToCacheResult { ok: boolean; path?: string; error?: string; } /** * Install `pkg@version` into the version-keyed shared cache and return the * installed package directory. Requires an explicit version so the cache stays * reproducible. Never writes into any audited project. */ export declare function installToCache(pkgAtVersion: string, options?: InstallToCacheOptions): InstallToCacheResult; export {}; //# sourceMappingURL=analyzerDeps.d.ts.map