import type { PathBuilder } from "path-ts"; import type { AlignOutputName } from "#build/checkpoint"; import { PriorOutput } from "#build/types"; /** * The work one output directory holds from an earlier build. */ export interface PriorWork { /** * The align checkpoint's path and the adapters it records as aligned, or `null` when none exists. */ checkpoint: { path: PathBuilder; completedAdapters: readonly string[]; } | null; /** * Each align output that exists with at least one byte, by path, with its size in bytes. */ alignOutputs: { path: PathBuilder; bytes: number; }[]; /** * Each configured adapter whose `MANIFEST.json` records a finished run, with its canonical file's size. */ adapterRuns: { adapterID: string; manifest: PathBuilder; canonicalBytes: number | null; }[]; /** * Each source directory a parallel build left under `intermediate/sources/`. */ sourceStates: PathBuilder[]; } export interface PriorWorkPaths { intermediateDir: PathBuilder; checkpointPath: PathBuilder; /** * Every file the align phase writes: its four outputs and the source-id lists beside them. */ alignPaths: Record & Record; adapterIDs: readonly string[]; } /** * Read what a previous build left under the output directory. * * @throws When the checkpoint exists and cannot be read, because a guard that read an * unreadable checkpoint as absent would let the build truncate the outputs it describes. */ export declare function readPriorWork(paths: PriorWorkPaths): Promise; /** * Describe the prior work and the two ways forward, as the refusal states them. */ export declare function describePriorWork(work: PriorWork): string; /** * Apply the caller's choice about prior work before any phase opens an output. * * `Refuse` throws when prior work exists, `Resume` leaves it for the phases to reuse, * and `Fresh` removes the checkpoint, the align outputs and each adapter manifest. * * @throws Under `Refuse` when the output directory holds prior work, naming every file and its size. */ export declare function settlePriorWork(choice: PriorOutput, paths: PriorWorkPaths): Promise; //# sourceMappingURL=prior-output.d.ts.map