import { type SourceIndex } from '@bitmagic/asset-core/publish-source'; /** Where the archive is written. Inside `.bitmagic/`, so it can never affect the fingerprint. */ export declare function sourceArchivePath(root: string): string; export interface SourceArchive { /** Absolute path to the written archive. */ filePath: string; bytes: number; /** sha256 of the archive as written — the value that gets bound into the meta block. */ sha256: string; /** Fingerprinted paths deliberately not carried in the payload (engine, secrets, assets). */ omitted: string[]; /** Secret-shaped paths among `omitted`, so `publish` can tell the creator what it withheld. */ secretsOmitted: string[]; /** * Asset and oversized paths among `omitted`, kept apart from `secretsOmitted` because the two * mean opposite things to a creator: a withheld credential is a warning about their project, a * withheld `.glb` is the archive working as intended. Folding them together would put a routine * count behind a message that has to stay alarming. */ assetsOmitted: string[]; /** Bytes `assetsOmitted` would have added, so `publish` can report the saving as a number. */ assetBytesOmitted: number; } export interface BuildSourceArchiveOptions { root: string; index: SourceIndex; gameId: string; engineVersion: string; genre: string; /** Injected so tests get a stable manifest; production passes the real clock. */ now?: () => Date; } /** * Build the archive and return what `publish` needs to upload and declare. * * The manifest is written FIRST so a reader (and the server) hits it before streaming past * megabytes of payload, and `files` covers the fingerprint's entire set — including the paths the * payload omits — because that is what lets the server re-derive the fingerprint from an archive * that does not physically contain every file. `omitted` stays a subset of `files`: the archive * also filters `archivedOnly`, but those paths are not in the fingerprint and so are not in * `files`, and listing them as "omitted from the fingerprint's set" would be a lie about which * set they belong to. * * Note the payload is read from disk again here rather than being buffered during * `buildSourceIndex`: holding every file's bytes to avoid a second read would mean holding the * whole project in memory, and the index already carries the hashes that make a re-read safe to * detect. A file edited between the two reads changes the archive but not the manifest, which the * server's per-entry hash check reports — the honest outcome, and the reason that check exists. */ export declare function buildSourceArchive(options: BuildSourceArchiveOptions): Promise;