/** How a fan-out destination was made: a relative symlink, or a recursive copy. */ export type LinkKind = 'symlink' | 'copy'; /** One fan-out Skillsmith made: which skill, from where, to where, how, and when. */ export interface LinkRecord { skillId: string; from: string; to: string; kind: LinkKind; createdAt: string; } /** The on-disk link manifest: every fan-out Skillsmith has recorded. */ export interface LinkManifest { version: 1; links: LinkRecord[]; } /** * Resolve the manifest file path. Sits under `~/.skillsmith/` so it shares * the existing allow-list entry for that directory (DEFAULT_ALLOWED_DIRS in * `pathValidation.ts`). */ export declare function getLinkManifestPath(): string; /** What reading the manifest found. `unreadable` means it exists but must not be written over. */ export interface ManifestRead { state: 'ok' | 'missing' | 'corrupt' | 'unreadable'; manifest: LinkManifest; reason?: string; } /** * Read the manifest and report its state. Valid JSON with a higher version is * `unreadable`, not `corrupt`: a newer Skillsmith wrote it, and moving it * aside would drop its records too (SMI-6529 round 10). */ export declare function readManifestFile(): Promise; /** Error for a manifest that exists but can't be read; nothing is written over it. */ export declare function unreadableManifestError(reason: string | undefined): Error; /** * Load the manifest for reading. Returns an empty manifest if the file is * missing, unreadable or corrupt — fan-out is best-effort, never crash on * cold start. Changes go through {@link updateManifest}, which never * overwrites a file it couldn't read. */ export declare function loadManifest(): Promise; /** * Apply `change` to the manifest and save it, under the manifest's own lock. * Returns a warning for the user, if any. * * SMI-6529 round 9: destination locks only serialize calls for one * destination, so fan-outs of different skills loaded, changed and saved the * manifest at the same time, through one shared temp file; twelve concurrent * fan-outs kept one record, and could leave the file corrupt. Callers may * hold a destination lock when they call this, but no destination lock is * ever requested while this lock is held, so the two can't deadlock. * * A corrupt file used to be replaced with an empty manifest, dropping every * other skill's record. It is now moved aside, with a warning; a file that * can't be read at all is left alone and the call fails. */ export declare function updateManifest(change: (manifest: LinkManifest) => void): Promise; /** * Persist the manifest atomically (write-temp + rename) so a crash mid-write * never leaves the file in a partial state. */ export declare function saveManifest(manifest: LinkManifest): Promise; //# sourceMappingURL=fan-out.manifest.d.ts.map