/** Where a source repo commits them, and where they are published. */ export declare const SOURCE_DIRECTORY = ".design-parity"; export declare const DOCUMENT_FILE = "known-differences.json"; export declare const ARTIFACT_DIRECTORY = "known-differences"; export declare const PUBLISHED_DIRECTORY = "parity"; /** * The list of artifacts this publisher actually wrote, published beside the document. * * **A fetch plan, not an authority.** A serving host has to know which artifact files to copy from a * delivery branch, and until now the only place that information existed was inside the document — * so the host parsed the contract to find out. The moment it does that it inherits a question it has * no business answering: *will the engine actually read this record?* Every pre-read refusal the * engine has is a rule the host then has to mirror, and a mirror that drifts **stricter** anywhere * starves a legal record of its artifacts and turns it into `artifact-unreadable` — a changed * verdict. Over the contract's per-record validation that is not a risk but a matter of time. * * The producer already knows the answer exactly: it wrote the files. Publishing the list turns * "interpret the contract" into "copy a list", and removes the reason for a second implementation * of `compose-preview-known-differences/v1` to exist in a serving host at all. * * **A sibling of the document, not a member of the artifact tree.** `known-differences/index.json` * was the obvious spelling and it is not safe: a record `id` is a §4 portable segment, `index.json` * *is* one, and a record so named publishes its artifacts to `known-differences/index.json/mask.png` * — a directory where the index would be a file. Rare, legal, and unrepresentable on any filesystem. * A sibling cannot collide with any `/` a producer may choose. * * The document remains the contract. A list that disagrees with it is not an error to report: a file * the list omits is simply not staged, and evaluates as `artifact-unreadable` — already the verdict * for a file a producer forgot to commit. */ export declare const ARTIFACT_INDEX_FILE = "known-differences-index.json"; /** The index's own schema token, so a consumer can refuse a shape it does not understand. */ export declare const ARTIFACT_INDEX_SCHEMA = "compose-preview-known-difference-artifacts/v1"; /** * The two ceilings, versioned with the schema. * * Restated from the contract because this package cannot import it, and checked here so a bundle is * never published whose consumers refuse a record this publisher accepted. Both are inclusive: a * document of exactly 1 MiB and an artifact of exactly 8 MiB are legal. */ export declare const MAX_DOCUMENT_BYTES: number; export declare const MAX_ARTIFACT_BYTES: number; export interface KnownDifferencesResult { /** Absolute path to the published document, when the source repo committed one. */ documentPath?: string; /** How many artifact files were carried across. */ artifactCount: number; /** * Their `/` paths, in the order they were written — the published index's contents. * * Exposed rather than only written to disk so a caller can assert on what was carried without * re-reading the bundle, and so the count and the list can never disagree. */ artifacts: string[]; /** * Paths the publisher declined to carry, each with why. * * Surfaced rather than thrown: a catalog with one broken acceptance is still a catalog worth * publishing, and the consumer reports that record's own verdict. A silent skip is the one thing * this must not do — a mask that quietly failed to publish is an acceptance that suppresses * nothing, with nothing anywhere saying so. */ skipped: Array<{ path: string; reason: "path-not-portable" | "artifact-too-large" | "symlink"; }>; } export interface KnownDifferencesOptions { /** * Root the source repo's `.design-parity/` sits in. Default: `process.cwd()`. * * The **repository** root, and emphatically *not* `writeCatalog`'s `sourceRoot`, which is the * directory a bundle's relative image URIs resolve against — the render output. An acceptance is * committed by the repository whose component the difference is in, which is where its issue and * its review live, and renders are routinely unpacked somewhere else entirely (a temp dir, an * unzipped artifact). Wiring these two together looks harmless and publishes nothing at all, * silently, because `/.design-parity/` never exists. */ repositoryRoot?: string; } /** * Copy the committed known differences into `outDir`, verbatim. * * Returns an empty result when the source repo commits none, which is every repo until it accepts * something. Absence is not an error and does not warn: there is nothing to say about a catalog that * has no known differences. */ export declare function writeKnownDifferences(outDir: string, opts?: KnownDifferencesOptions): Promise; /** * Remove the two published paths this module owns, and nothing else under `outDir`. * * Exported because {@link writeKnownDifferences} is not the only path that must leave the bundle * describing the repository's current state: a caller that *disables* the copy on a reused output * directory has to clear it too, or the previous publish's acceptances stay in the new bundle and go * on suppressing differences the caller just said not to carry. Skipping the copy is not the same as * skipping the cleanup, and the difference is only visible on the second render. */ export declare function clearPublishedKnownDifferences(outDir: string): Promise; /** * The published path an artifact lands at, for a caller that needs to name one. * * Held to the **same portable grammar the copier is**, not merely to "is it absolute". A caller * passing an untrusted `../../catalog.json` would otherwise get back a string that reads as being * inside the artifact directory and resolves outside it the moment a URL or a filesystem normalises * it — a traversal minted by the helper that exists to name safe paths. */ export declare function publishedArtifactPath(relative: string): string; //# sourceMappingURL=knownDifferences.d.ts.map