/** * External package extractor. * * Parses package manifests (npm, pip, cargo, go) to build a flat list * of direct dependencies. No LLM required — pure filesystem reads. * * Each manifest kind has a PURE parser over the file's text, and the directory-based functions read * the file and call it. The phantom-reference check (change: add-phantom-reference-findings) reads * manifests itself — it needs to know which manifest could not be parsed, which a swallowed error * cannot tell it — and parses them with these same functions, so "what counts as declared" has one * definition. */ export type PackageEcosystem = 'npm' | 'pypi' | 'cargo' | 'go'; export interface ExternalPackage { name: string; version: string; ecosystem: PackageEcosystem; isDev: boolean; } /** * Dependencies a `package.json` declares. Throws on malformed JSON, so a caller that must not treat * an unreadable manifest as "declares nothing" can tell the two apart. */ export declare function parseNpmManifest(text: string): ExternalPackage[]; /** * The body of a TOML table: the lines after its `[header]` line, up to the next line that opens a * table. Found without a regex over the content, so no section shape can make it backtrack. */ export declare function tomlSection(raw: string, header: string): string; /** * The distribution name a `pyproject.toml` declares, from PEP 621 `[project]` or Poetry's * `[tool.poetry]`. A repository importing its own distribution is importing itself, not a * dependency. */ export declare function parsePyprojectName(raw: string): string | null; /** Dependencies a `pyproject.toml` declares (PEP 621, extras, dependency groups, Poetry). */ export declare function parsePyprojectManifest(raw: string): ExternalPackage[]; /** Requirements a `requirements.txt`-style file pins, one per line. */ export declare function parseRequirementsManifest(raw: string): ExternalPackage[]; /** The `requirements*.txt` paths, relative to a directory, that {@link extractExternalPackages} reads. */ export declare const REQUIREMENTS_CANDIDATES: readonly string[]; /** Dependencies a `Cargo.toml` declares, including build and workspace sections. */ export declare function parseCargoManifest(raw: string): ExternalPackage[]; /** Modules a `go.mod` requires. */ export declare function parseGoModManifest(raw: string): ExternalPackage[]; export interface ExternalPackageSummary { total: number; byEcosystem: Partial>; packages: ExternalPackage[]; } export declare function extractExternalPackages(rootDir: string): Promise; //# sourceMappingURL=external-packages.d.ts.map