/** * @module snapshot-helpers * * Creation, validation, and retrieval helpers for immutable B2tFS Snapshot Stones. */ import { IbGibAddr } from '@ibgib/ts-gib/dist/types.mjs'; import { IbGibSpaceAny } from '../../../witness/space/space-base-v1.mjs'; import { KeystoneIbGib_V1 } from '../../../keystone/keystone-types.mjs'; import { CommentIbGib_V1 } from '../../../common/comment/comment-types.mjs'; import { B2tFSItemIbGib_V1 } from '../item/item-types.mjs'; import { B2tFSBranchIbGib_V1 } from '../branch/branch-types.mjs'; import { B2tFSSnapshotIbGib_V1, OriginSnapshotInfo } from './snapshot-types.mjs'; export interface CreateBranchSnapshotIbGibOpts { /** Concrete branch stone immediately preceding this snapshot */ branchIbGib: B2tFSBranchIbGib_V1; /** Reified root folder item stone */ rootItem: B2tFSItemIbGib_V1; /** Optional commit comment stone */ commitComment?: CommentIbGib_V1 | any; /** Optional commit message address (if comment already reified) */ commitMessageAddr?: IbGibAddr; /** Cosmos coordinates */ cosmosInfo?: { name?: string; addr?: string; tjpAddr?: string; }; /** Galaxy coordinates */ galaxyInfo?: { name?: string; addr?: string; tjpAddr?: string; }; /** Origin snapshot provenance records (e.g. from branching, cloning, or merging) */ originSnapshotInfos?: OriginSnapshotInfo[]; /** Primary Keystone identity (tjp address) authorizing this snapshot */ primaryIdentityTjpAddr: IbGibAddr; /** Device author delegate keystone and secret for cryptographic signing */ deviceDelegate: { delegateKeystone: KeystoneIbGib_V1; delegateSecret: string; }; /** Branch space where stones reside */ space: IbGibSpaceAny; /** Control space (localSpace) where identity and author keystones reside and evolve */ controlSpace?: IbGibSpaceAny; /** Metaspace service */ metaspace: any; /** Optional in-memory item lookup cache to avoid unnecessary space reads */ inMemoryItems?: Map; } export interface CreateBranchSnapshotResult { /** Generated immutable snapshot stone */ snapshotIbGib: B2tFSSnapshotIbGib_V1; /** Concrete address of the snapshot stone */ snapshotAddr: IbGibAddr; /** Evolved author delegate keystone after signing */ evolvedAuthorDelegateKeystone: KeystoneIbGib_V1; } /** * Creates, signs, and persists an immutable B2tFS Snapshot Manifest Stone. * * Guarantees: * 1. Zero hard links in rel8ns (`rel8ns: {}`). * 2. Fail-fast if author delegate keystone or primaryIdentityTjpAddr is omitted. * 3. Pre-computes recursive item lookup map and file/folder counts. * 4. Signs author delegate keystone claiming `{ verb: KEYSTONE_VERB_AUTHOR, target: snapshotAddr }`. */ export declare function createBranchSnapshotIbGib({ branchIbGib, rootItem, commitComment, commitMessageAddr, cosmosInfo, galaxyInfo, originSnapshotInfos, primaryIdentityTjpAddr, deviceDelegate, space, controlSpace, metaspace, inMemoryItems, }: CreateBranchSnapshotIbGibOpts): Promise; /** * Validates the cryptographic and architectural integrity of a B2tFS Snapshot Stone. */ export declare function validateSnapshotIbGib({ snapshotIbGib, }: { snapshotIbGib: B2tFSSnapshotIbGib_V1; }): Promise<{ isValid: boolean; errors: string[]; }>; /** * Retrieves the latest snapshot stone recorded on a branch stone, or undefined if no snapshot exists. */ export declare function getLatestBranchSnapshot({ branchIbGib, space, }: { branchIbGib: B2tFSBranchIbGib_V1; space: IbGibSpaceAny; }): Promise; /** * Retrieves the entire chronological sequence of snapshot stones recorded on a branch stone. */ export declare function getBranchSnapshotHistory({ branchIbGib, space, }: { branchIbGib: B2tFSBranchIbGib_V1; space: IbGibSpaceAny; }): Promise; export { diffSnapshotTrees, type DiffSnapshotTreesOpts, type DiffSnapshotTreesResult, } from './diff-snapshot-trees.mjs'; //# sourceMappingURL=snapshot-helpers.d.mts.map