export declare const LEDGER_FILENAME = "ledger.yaml"; /** * One consumed release: the workspace-relative directory of the project that * released (the engine's unit of identity, since package names may collide across * workspace projects) and the ids of the intent files the release consumed. * The bare id-list shape is accepted when read, for hand-written entries; * its project is then resolved by the package name in the entry key, which * must be unambiguous. */ export type LedgerEntry = string[] | { dir: string; intents: string[]; }; /** * The committed, append-only record of consumed change intents: maps * `@` to the released project and the ids of * the intent files consumed by that release. Consumption is scoped per * project (an intent file is fully consumed only once every project it * names has an entry), which is what makes cherry-picked releases on * maintenance branches and merge-backs safe, and what lets one intent be * half-consumed by a package on a release lane. */ export type Ledger = Record; export declare function ledgerEntryIds(entry: LedgerEntry): string[]; export declare function readLedger(workspaceDir: string): Promise; export declare function appendToLedger(workspaceDir: string, newEntries: Record): Promise; export interface PackageConsumption { /** Intent ids the ledger records against any released version of the project. */ allIds: Set; /** Intent ids recorded only against prerelease versions of the project. */ prereleaseOnlyIds: Set; } /** * Indexes the ledger by workspace-relative project directory in a single * pass. Bare id-list entries carry no directory, so their project is * resolved from the entry key's package name via `resolveNameDirs`; a name * matching several projects cannot be attributed and is an error. Write * such entries in the `dir`/`intents` shape instead. Entries whose name no * longer exists in the workspace are inert. Projects without entries map to * an empty consumption, so lookups never miss. */ export declare function buildConsumptionIndex(ledger: Ledger, resolveNameDirs: (pkgName: string) => string[]): (projectDir: string) => PackageConsumption; /** * The canonical spelling of a workspace-relative project directory: forward * slashes, no leading `./`, no trailing slash. */ export declare function normalizeProjectDir(dir: string): string;