/** * @module diff-snapshot-trees * * High-performance snapshot tree diffing helper to accelerate VCS gap analysis. * Identifies the exact delta of mutated/added items, binaries, and transform stones * between two snapshot manifest stones without scanning unchanged subtrees. */ import { IbGibAddr } from '@ibgib/ts-gib/dist/types.mjs'; import { IbGibSpaceAny } from '../../../witness/space/space-base-v1.mjs'; import { B2tFSSnapshotIbGib_V1 } from './snapshot-types.mjs'; import { B2tFSBranchIbGib_V1 } from '../branch/branch-types.mjs'; import { SnapshotSyncManifest } from '../../../sync/sync-types.mjs'; export interface DiffSnapshotTreesOpts { /** Latest snapshot stone being synchronized */ latestSnapshot: B2tFSSnapshotIbGib_V1; /** Previous snapshot stone known to have been synchronized, if any */ previousSnapshot?: B2tFSSnapshotIbGib_V1; /** Branch stone being pushed (to include branch address and its DNA transform stone) */ branchIbGib?: B2tFSBranchIbGib_V1; /** Space where ibgibs reside, used to fetch DNA transform stones for changed items */ space?: IbGibSpaceAny; /** * Whether to collect and include DNA transform stones (fork, mut8, rel8) for changed items. * Defaults to false because VCS sync synchronizes reified item and binary stones, not local DNA provenance. */ includeDna?: boolean; } export interface DiffSnapshotTreesResult { /** Intermediate manifest containing all changed addresses */ manifest: SnapshotSyncManifest; /** Array of all unique addresses that were created or modified */ changedAddrs: IbGibAddr[]; /** Changed or added file records */ changedFiles: { path: string; itemAddr: IbGibAddr; binAddr?: IbGibAddr; }[]; /** Changed or added folder records */ changedFolders: { path: string; itemAddr: IbGibAddr; }[]; /** Deleted paths between previous and latest snapshots */ deletedPaths: string[]; } /** * Diffs two immutable snapshot trees to compute the exact minimal set of * ibgib addresses that need to be synchronized to remote peers. */ export declare function diffSnapshotTrees({ latestSnapshot, previousSnapshot, branchIbGib, space, includeDna, }: DiffSnapshotTreesOpts): Promise; //# sourceMappingURL=diff-snapshot-trees.d.mts.map