/** * Package archive primitives. * * The single owner of tarball creation, extraction, and gzip sniffing for * skillset/skill/subagent packages. Commands must use these instead of * hand-rolling tar pipelines. */ /** * Check if buffer starts with gzip magic bytes (0x1f 0x8b) * * @param args - The check parameters * @param args.buffer - The buffer to check * * @returns True if the buffer is gzip compressed */ export declare const isGzipped: (args: { buffer: Buffer; }) => boolean; /** * Extract a tarball (gzipped or plain) into an existing directory. * * @param args - The extraction parameters * @param args.tarballData - The tarball data as ArrayBuffer * @param args.targetDir - The directory to extract to */ export declare const extractArchive: (args: { tarballData: ArrayBuffer; targetDir: string; }) => Promise; /** * Create a gzipped tarball of a package source directory. * * Packs every file (following symlinks, so linked skillsets work) except * paths excluded by the upload filter (node_modules, build output, etc.). * Uses a temporary .tgz next to the source dir and always cleans it up. * * @param args - The function arguments * @param args.sourceDir - The package directory to pack * * @returns The tarball as a Buffer */ export declare const createArchive: (args: { sourceDir: string; }) => Promise; /** * Compute a tarball checksum in the registry's format * (`sha512-`, matching what the registrar records as * `dist.shasum` in packuments). * * @param args - Arguments * @param args.tarballData - The tarball data * * @returns The prefixed base64 sha512 digest */ export declare const computeArchiveShasum: (args: { tarballData: ArrayBuffer; }) => string; /** * Verify a downloaded tarball against the checksum the registry recorded. * Fails loudly on mismatch; skips silently when the registry recorded none. * * @param args - Arguments * @param args.tarballData - The downloaded tarball data * @param args.expectedShasum - The packument's dist.shasum, when present * * @throws Error when the tarball does not hash to the expected checksum */ export declare const verifyArchiveChecksum: (args: { tarballData: ArrayBuffer; expectedShasum?: string | null; }) => void; /** * Extract a named file from an in-memory tarball (optionally gzipped). * * @param args - Arguments * @param args.tarballData - Raw tarball data (gzipped or plain tar) * @param args.fileName - File name to extract (matches both `SKILL.md` and `./SKILL.md`) * * @returns File contents as string, or null if the file is not in the tarball */ export declare const extractFileFromArchive: (args: { tarballData: ArrayBuffer; fileName: string; }) => Promise; //# sourceMappingURL=archive.d.ts.map