/** * @module package-timeline-helpers * * Engine for Package Galaxy item timeline management, version evolution, * immutability enforcement, and timeline queries. */ import { IbGibAddr } from '@ibgib/ts-gib/dist/types.mjs'; import { BinIbGib_V1 } from '../../common/bin/bin-types.mjs'; import { IbGibSpaceAny } from '../../witness/space/space-base-v1.mjs'; import { B2tFSItemIbGib_V1, PackageItemInfo_V1 } from '../branching/item/item-types.mjs'; import { PackageVersionParserStrategy } from './version-parser/version-parser-types.mjs'; /** * Returns true if the given galaxy IbGib is a Package Galaxy (`discriminator === 'package'`). */ export declare function isPackageGalaxyIbGib(galaxyIbGib?: any): boolean; export interface PackageIngestResult { action: 'created' | 'evolved' | 'unchanged'; item: B2tFSItemIbGib_V1; itemAddr: IbGibAddr; binAddr: IbGibAddr; packageInfo: PackageItemInfo_V1; fileHash: string; previousItemAddr?: IbGibAddr; } export interface StagePackageFileOpts { space: IbGibSpaceAny; metaspace?: any; fileBytes: Uint8Array; filename: string; explicitName?: string; explicitVersion?: string; existingItem?: B2tFSItemIbGib_V1; strategies?: PackageVersionParserStrategy[]; } export interface PackageVersionRecord { version: string; filename: string; fileHash: string; itemAddr: IbGibAddr; binAddr?: IbGibAddr; scope?: string; schema?: string; } /** * Computes SHA-256 hash of a byte buffer in lowercase hex. */ export declare function computeFileHash(fileBytes: Uint8Array): Promise; /** * Creates and stores a BinIbGib stone in space for a byte buffer. */ export declare function putBinaryStone({ fileBytes, space, }: { fileBytes: Uint8Array; space: IbGibSpaceAny; }): Promise<{ binIbGib: BinIbGib_V1; binAddr: IbGibAddr; fileHash: string; }>; /** * Ingests a package binary file into a Package Galaxy item timeline: * - Computes SHA-256 hash and creates BinIbGib. * - Parses (packageName, version, filename). * - If identical release exists: returns 'unchanged' (idempotent no-op). * - If existing release has modified bytes: throws FATAL ERROR with actionable recovery guidance. * - If new version: evolves the package item timeline (`past: [...past, prevItem]`). * - If new package: creates genesis package item timeline. */ export declare function stagePackageReleaseItem({ space, metaspace, fileBytes, filename, explicitName, explicitVersion, existingItem, strategies, }: StagePackageFileOpts): Promise; /** * Retrieves the complete chronological version history of a package by walking its accretive past. */ export declare function listPackageVersions({ packageItem, space, }: { packageItem: B2tFSItemIbGib_V1; space: IbGibSpaceAny; }): Promise; /** * Resolves a specific point-in-time version frame along the package item timeline. */ export declare function getPackageVersionFrame({ packageItem, version, space, }: { packageItem: B2tFSItemIbGib_V1; version: string; space: IbGibSpaceAny; }): Promise; //# sourceMappingURL=package-timeline-helpers.d.mts.map