import { Transform } from "node:stream"; /** * Extract a .tar.gz archive to a destination directory. Extracts regular * files only, preserving relative paths. The archive is expected to contain * a single binary file (the release workflow produces flat archives with * just the binary, no directory structure). */ export declare function extractTarGz(archivePath: string, destDir: string): Promise; /** * Extract a .zip archive to a destination directory using a pure-Node zip * parser. Handles STORE (method 0, no compression) and DEFLATE (method 8) * entries — the two methods the `zip` command uses by default. This avoids * a dependency on the `unzip` CLI, which is not available on Windows by * default (Windows is one of the 4 supported platforms and the primary * install path for Windows users). */ export declare function extractZip(archivePath: string, destDir: string): Promise; export declare enum TarEntryType { File = "0", Directory = "5" } export interface TarEntry { name: string; type: TarEntryType; data: Buffer; } /** * Minimal ustar tar parser. Reads a stream of tar bytes and collects regular * file entries into the `entries` array passed to the constructor. * * Incoming chunks are copied into a pre-allocated, doubling buffer at a write * offset (O(chunk size) per chunk). This replaces `Buffer.concat([buffer, * chunk])` on every chunk, which copied the *entire* accumulated buffer on * each of the thousands of chunks a large archive arrives in — an O(n²) * total cost that caused multi-minute extraction and gigabytes of allocation * for a ~122MB model archive. A read offset tracks consumed data; after each * entry is emitted, `compact()` moves the small unconsumed tail to the front * and shrinks the backing buffer so a large entry's memory is released rather * than retained for the rest of the stream. */ export declare class TarParser extends Transform { private buf; private readOff; private writeOff; private entries; constructor(entries: TarEntry[]); _transform(chunk: Buffer, _enc: BufferEncoding, cb: () => void): void; _flush(cb: () => void): void; private append; private processBlocks; private compact; private reset; }