@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
24 lines • 1.41 kB
TypeScript
/**
* How a file gets into a snapshot. A clone (APFS, btrfs, XFS, ReFS) is copy-on-write: free, and
* independent of the install even if something rewrites the install's file in place. A hardlink
* is just as free but shares the file itself, so it is only taken where the filesystem cannot
* clone (ext4, NTFS); package managers replace files rather than rewriting them, which keeps a
* linked snapshot on the build it was taken from. A plain copy is the last resort (another
* volume, a filesystem that refuses links).
*/
export type SnapshotCopyMode = "clone" | "clone-or-copy" | "link" | "copy";
export interface SnapshotFileOperations {
copyFile(source: string, target: string, mode: number): Promise<void>;
link(source: string, target: string): Promise<void>;
}
export interface SnapshotFileCopier {
copy(source: string, target: string): Promise<void>;
readonly mode: SnapshotCopyMode;
}
/**
* A file copier that starts with the cheapest independent copy and settles on the first mode the
* filesystem accepts, so a snapshot of thousands of files pays for a refused mode once.
*/
export declare function createSnapshotFileCopier(platform?: NodeJS.Platform, operations?: SnapshotFileOperations): SnapshotFileCopier;
export declare function copyFiles(pairs: readonly (readonly [string, string])[], copier: SnapshotFileCopier): Promise<void>;
//# sourceMappingURL=file-copier.d.ts.map