import { type PathBuilderLike } from "path-ts"; import type { AdapterOptions } from "#types"; /** * The roots a build input can be recorded relative to. */ export declare const BuildInputRoot: { readonly cache: "cache"; readonly data: "data"; }; export type BuildInputRoot = (typeof BuildInputRoot)[keyof typeof BuildInputRoot]; /** * One adapter's input as the committed record states it. * * `inputPath` is data-root-relative. * The remaining fields match {@linkcode AdapterOptions} and exist so a per-country * or truncated run can be recorded as it ran. */ export interface BuildInputRecord { inputPath: string; /** * The root a relative `inputPath` resolves against: `"cache"` for a current source * under `$MAILWOMAN_CACHE_ROOT`, such as `sources/ban`, and `"data"` for a snapshot * or built artifact under `$MAILWOMAN_DATA_ROOT`, such as `snapshots/usgov-nppes/2026-05`. * * A record written before the storage classes identifies no root, * and every path in it is under the data root. * * @defaultValue `"data"` */ root?: BuildInputRoot; country?: string; limit?: number; /** * The street index the unit splitter reads (`#tools/street-index/build`), * data-root-relative like `inputPath`. * * A build reads the index built from the previous corpus version. */ streetIndex?: string; /** * The fraction of rows rendered with a country surface, for a country-implicit source. */ countryFraction?: number; /** * The seed of the {@linkcode BuildInputRecord.countryFraction} draw. */ seed?: number; /** * The share of the source's training rows the build keeps (`AdapterOptions.trainShare`). */ trainShare?: number; } /** * One `corpus run` of an adapter under a source name of its own. * * A build's `adapters` map holds one entry per adapter id and can't state several runs of one adapter. * The `overture` runs for BR, MX and CA stamped `overture-latam` are each a run here. * * Their rows join a corpus as an overlay (`corpus overlay-manifest --replace-source`). */ export interface SourceRunRecord extends BuildInputRecord { /** * The adapter id `corpus run` resolves. */ adapter: string; /** * The `source` the run stamps on every row (`corpus run --source-name`). */ sourceName: string; } /** * The adapter inputs of one base corpus build. */ export interface BuildInputsRecord { corpusVersion: string; builtAt?: string; adapters: Record; /** * The runs whose rows join the corpus as an overlay, run by `corpus recorded-runs`. * `corpus build` reads `adapters` only. */ sourceRuns?: SourceRunRecord[]; } /** * One recorded source run with its input resolved, as `corpus recorded-runs` runs it. */ export interface SourceRun { adapter: string; sourceName: string; options: AdapterOptions; } /** * Resolve the committed inputs record for a corpus version through the package's `./data/*` export. * * Resolution happens on call, matching `addressSourceRegisterPath`. */ export declare function buildInputsPath(corpusVersion: string): string; /** * Read a committed inputs record and resolve every `inputPath` against the data root. * * @throws When the record identifies no adapter, because a build with no inputs * writes an empty corpus and reports success. */ export declare function readBuildInputs(path: PathBuilderLike): Promise>; /** * Read a committed record's `sourceRuns`, each input resolved as {@linkcode readBuildInputs} resolves one. * * @throws When the record lists no source run, a run lacks its adapter or source name, * or two runs would write one source and country. */ export declare function readSourceRuns(path: PathBuilderLike): Promise; /** * The directory a source run writes under the output root: its source name, * and its country when it has one. */ export declare function sourceRunDirectoryName(run: { sourceName: string; country?: string; }): string; //# sourceMappingURL=inputs.d.ts.map