/** * Bytes backed by an ArrayBuffer this process owns. * * Spelled out rather than left as a bare `Uint8Array` because Node's readFileSync and * Bun's gzipSync return views over pooled or shared buffers, and passing one of those to * `new Response(...)` or letting it outlive the call is how a view ends up describing * bytes that belong to something else. */ export type OwnedBytes = Uint8Array; /** Copy any byte view into a buffer of its own. */ export declare function ownBytes(view: Uint8Array | ArrayBuffer): OwnedBytes; export interface SkillBundleEntry { path: string; bytes: OwnedBytes; mode: number; } export interface PackedSkillBundle { /** The gzipped tar. This is what is uploaded and what the digest is taken over. */ bytes: OwnedBytes; /** Lowercase hex sha-256 of `bytes`. The skill's content address. */ sha256: string; fileCount: number; /** Total uncompressed size of the packed files, for a size limit that means something. */ unpackedByteSize: number; /** Relative paths included, sorted. Surfaced so `push --dry-run` can show them. */ paths: string[]; } export interface PackSkillBundleOptions { /** Reject before compressing when the sources exceed this. 0 disables the check. */ maxUnpackedBytes?: number; } export declare function sha256Hex(bytes: Uint8Array): string; /** Collect the files a bundle would contain, in archive order. */ export declare function collectSkillBundleEntries(dir: string): SkillBundleEntry[]; export declare function packSkillBundle(dir: string, options?: PackSkillBundleOptions): PackedSkillBundle; /** Inverse of packSkillBundle. Used by the round-trip tests and by any future `pull`. */ export declare function unpackSkillBundle(bundle: Uint8Array): SkillBundleEntry[];