import { LockfileRegistryPackage } from './lockfile-packages.js'; import type { PlannedTarball } from './materializer.js'; export interface TarballLockfileFilterResult { kept: PlannedTarball[]; dropped: PlannedTarball[]; /** {@link findUnembeddedVersions} of the kept set against the lockfile. */ unembedded: UnembeddedVersions[]; } /** * Lockfile versions of an embedded package that are not embedded * themselves. */ export interface UnembeddedVersions { name: string; embedded: string[]; missing: string[]; } /** * Finds the packages that are embedded in some of their lockfile versions * but not all of them, e.g. through a `name@version` pin while a dependency * needs another version. * * Runners answer an embedded package's registry metadata from the code * bundle alone, listing only the embedded versions, so an install that * resolves through that metadata (npm's) cannot find the missing ones. */ export declare function findUnembeddedVersions(tarballs: Pick[], lockfileRegistry: Pick[]): UnembeddedVersions[]; /** * Splits a planned tarball set by `name@version` presence in a lockfile. * * Used after the bundled lockfile has been pruned to the code bundle's * contents: a pruned lockfile's resolutions are verified to be a subset of * the original's (no new entries, no version changes), so filtering the * originally planned set by presence is exactly equivalent to re-running * spec matching against the pruned lockfile. * * Fail-safe: if the lockfile content cannot be parsed — unexpected, since * a pruned lockfile has already passed the pruner's own parse and * verification — every tarball is kept (the pre-filter superset is the * previous behavior), no unembedded versions are reported, and the * failure is debug-logged. */ export declare function filterTarballsByLockfile(tarballs: PlannedTarball[], lockfileContent: string, lockfileName: string): TarballLockfileFilterResult;