import type { Scope } from './types.js'; /** * Receipt store: /skills/receipts.json. * * A receipt is a CLAIM about what wigolo installed where — not an * authorization. Every canonical key is bounds-checked against the targets * table shape before any delete, because receipts.json is user-writable. */ export interface PackReceipt { version: string; files: Record; } export interface ReceiptEntry { scope: Scope; agents: string[]; packs: Record; adopted?: true; installedAt: string; } export type ReceiptStore = Record; export declare function receiptsPath(): string; /** * Canonical key for a destination path: realpath of the NEAREST EXISTING * ancestor, re-joined with the normalized remaining (not-yet-existing) * segments. Never mkdirs — a dry-run on a fresh machine (no parent dirs) * must produce a stable key without side effects. */ export declare function canonicalKey(destPath: string): string; /** * Structural bounds check: does `key` match the shape producible by the * targets table for SOME supported agent × scope, under the given cwd/home? * Entries outside the shape are refused (never deleted). * * A key is in-bounds when it equals a target basePath (owned-file/fenced) OR * lies under a skill-dirs base as `/[/...]`. */ export declare function isKeyWithinBounds(key: string, cwd: string, home?: string): boolean; /** Read + validate the receipt store. Corrupt JSON ⇒ empty store (fail-safe). */ export declare function readReceipts(): ReceiptStore; /** * Read → mutate → write the receipt store under an exclusive lock so * concurrent installs don't lose updates. */ export declare function withReceiptsLock(fn: (store: ReceiptStore) => { store: ReceiptStore; result: T; }): T; /** Write the store directly (already-locked contexts / tests). */ export declare function writeReceipts(store: ReceiptStore): void; //# sourceMappingURL=receipts.d.ts.map