export declare const PACK_INDEX_FORMAT_V1 = "helix.granit-pack/1"; export declare const PACK_INDEX_FORMAT_V2 = "helix.granit-pack/2"; /** Shape of `packs//index.json` (the reader's `StartupPackIndex`). */ export interface StartupPackIndex { format: typeof PACK_INDEX_FORMAT_V1 | typeof PACK_INDEX_FORMAT_V2; scene: string; root: 'scene/'; packs: Array<{ file: string; bytes: number; stored: number; members: number; defer?: boolean; }>; early?: string[]; members: Record; } export interface PackMember { path: string; bytes: Uint8Array; } export interface PackGroup { members: PackMember[]; defer?: boolean; label?: string; targetBytes?: number; } export interface PackFile { file: string; stored: Buffer; } export declare const CRITICAL_TARGET_BYTES: number; export declare const DEFERRED_TARGET_BYTES: number; /** Greedy contiguous split of `members` into packs of about `targetBytes`, keeping the given order (a member is never split). */ export declare function splitIntoPacks(members: readonly T[], targetBytes: number): T[][]; /** Lays the members of one pack end to end. Returns the decoded stream and each member's `[offset, length]`. */ export declare function layOut(members: readonly PackMember[]): { decoded: Buffer; where: Array<[number, number]>; }; /** * Packs from ordered groups (critical first, then deferred), numbered in the order given; format /2. Pure: no I/O. * * Members with the same bytes are laid out once. The mounted part folders of a city each keep their own copy of a shared texture (and the * loader may read any copy, so the predictor lists every one): Pacifica's desktop critical set carried 59 MB of building textures of which * 21.6 MB were distinct, 37.5 MB of copies. A copy becomes an alias, another path that names the same `[pack, offset, length]` as the first * one, so a cold first play downloads it once. A copy in a deferred group of something already critical names the critical range (it is * there sooner). The reader serves any path from its range and counts a pack's members by path, so it releases a pack only once every * alias was read (or its retain timeout passed); a read after that goes to the network, as for any released member. */ export declare function buildPackGroups(scene: string, groups: readonly PackGroup[], options?: { early?: string[]; }): { index: StartupPackIndex; files: PackFile[]; }; /** What the converter reports for one tier's packs. */ export interface PackSummary { packs: number; critical: { files: number; decodedBytes: number; storedBytes: number; }; deferred: { files: number; decodedBytes: number; storedBytes: number; }; early: number; } export declare function summarizeIndex(index: StartupPackIndex): PackSummary; /** Throws on an index the shell would reject or misread (the reader's own checks, plus offsets inside their pack). */ export declare function assertPackIndex(index: StartupPackIndex): void;