/** * Atomic directory replacement for package installs and updates. * * The single owner of the extract-to-temp / backup / swap / restore dance. * Every install or update path must go through one of these so a failure * mid-operation never leaves a package directory partially destroyed. */ /** * Extract an archive into a directory that does not exist yet. * On extraction failure the created directory is removed. * * @param args - Arguments * @param args.tarballData - The tarball data * @param args.targetDir - Directory to create and extract into */ export declare const extractArchiveToNewDir: (args: { tarballData: ArrayBuffer; targetDir: string; }) => Promise; /** * Atomically replace an existing directory with an archive's contents. * * Extracts to a temp sibling, renames the target to a backup, renames the * temp into place, then removes the backup. On any failure the original * directory is restored and temp state is cleaned up. * * @param args - Arguments * @param args.tarballData - The tarball data * @param args.targetDir - Existing directory to replace * @param args.preserveVersionFile - Copy the old dir's .nori-version into the new contents */ export declare const atomicReplaceDirWithArchive: (args: { tarballData: ArrayBuffer; targetDir: string; preserveVersionFile?: boolean | null; }) => Promise; /** * Atomically replace a directory's contents with an archive while keeping * selected top-level entries from the existing directory (and discarding * those same entries if the archive carries them). * * Used for skillset updates, which must keep locally-managed skills/, * subagents/, and .nori-version. * * @param args - Arguments * @param args.tarballData - The tarball data * @param args.targetDir - Existing directory to update * @param args.preserveEntries - Top-level entry names to keep from the old dir */ export declare const replaceDirContentsWithArchive: (args: { tarballData: ArrayBuffer; targetDir: string; preserveEntries: ReadonlyArray; }) => Promise; //# sourceMappingURL=atomicReplace.d.ts.map