import { type GjcPluginRegistry, type GjcPluginRegistryEntry, type GjcPluginScope } from "./types"; export declare function registryRootForScope(scope: GjcPluginScope, cwd: string): string; export declare function registryPathForScope(scope: GjcPluginScope, cwd: string): string; /** * Deterministic ordering: scope (user before project) -> normalized name -> * resolved plugin root. Collisions are errors elsewhere; order only controls * stable hook/appendix sequencing. */ export declare function sortRegistryEntries(entries: GjcPluginRegistryEntry[]): GjcPluginRegistryEntry[]; /** * The effective registry a migrating read would produce, computed entirely in * memory: raw entries plus legacy-root discovery plus entry migration, with no * lock taken and nothing persisted. * * This is what a preview must read. {@link readRegistry} persists the same * result under the scope lock, and taking that lock creates the scope root and * a lockfile — a filesystem mutation a preview must not make. Reading the raw * registry alone is not equivalent: it cannot see a legacy bundle that exists * on disk without a registry entry, so a preview built on it would disagree * with the uninstall it is previewing. */ export declare function readEffectiveRegistryUnpersisted(scope: GjcPluginScope, cwd: string): Promise; export declare function readRegistry(scope: GjcPluginScope, cwd: string, options?: { migrate?: boolean; }): Promise; export declare function withRegistryLock(scope: GjcPluginScope, cwd: string, fn: () => Promise): Promise; /** * Lock-free atomic write (temp+fsync+rename). Only call while already holding * the per-scope registry lock via withRegistryLock. */ export declare function writeRegistryUnlocked(registry: GjcPluginRegistry, cwd: string, ownerScope?: GjcPluginScope): Promise; /** * Atomic registry write: write to a temp sibling, fsync, then rename. Guarded * by an interprocess lockfile so concurrent installs cannot clobber each other. */ export declare function writeRegistry(registry: GjcPluginRegistry, cwd: string, ownerScope?: GjcPluginScope): Promise; /** * Mutate a scope's registry as a single locked read-modify-write transaction so * concurrent installs cannot lose each other's updates. The mutator receives a * sorted copy and returns the next entry list. */ export declare function updateRegistry(scope: GjcPluginScope, cwd: string, mutator: (entries: GjcPluginRegistryEntry[]) => GjcPluginRegistryEntry[]): Promise; /** * Effective registry for a cwd: user + project entries in deterministic order. * * Defaults to the startup semantics (legacy-entry discovery + migration, which * may persist the migrated registry). Read-only inspection surfaces (for * example `gjc customize doctor`) pass `{ migrate: false }` so reporting never * writes to the registry. */ export declare function loadEffectiveGjcPluginRegistry(cwd: string, options?: { migrate?: boolean; }): Promise; export declare function registryEntryFingerprint(entry: GjcPluginRegistryEntry): string;