/** * Locked, crash-recoverable publication of an agent configuration file OpenLore * does NOT own. * * `confinedAtomicWriteFile`'s compare-and-swap branch is not a plain rename: it * moves the current target aside to a guarded sibling, verifies the captured * identity, then publishes with a no-replace hard link. That sequence is only safe * for a caller that (a) serializes against other OpenLore processes and (b) leaves * a recovery journal, so an interrupted publication can be completed instead of * leaving the target missing. The primitive's own contract says exactly that. * * `openlore setup` already did this correctly for Claude Code's hook settings. * `openlore install` needs the identical guarantee for the user-scope footprint — * `~/.claude.json` is Claude Code's live account state — so the machinery lives * here, shared, rather than being reimplemented (change: * unify-onboarding-entrypoint). */ /** * A private, per-user, durable directory for lock and journal files. * * Deliberately not the shared OS temporary namespace: the journal is what makes an * interrupted publication recoverable, so it has to outlive a reboot and must not * be writable by another user. Every path component is verified to be a real, * user-owned, 0700 directory. */ export declare function verifiedSettingsCoordinationDir(): Promise; export interface GuardedWriteFailure { /** Why the mutation did not run, in one sentence, for the caller to surface. */ reason: string; } /** * Run `mutate` while holding this file's per-user lock, after completing any * interrupted publication of it. * * The lock is keyed by the target path, so two OpenLore processes writing the same * file serialize, and processes writing different files do not. Returns the * mutation's own result, or a {@link GuardedWriteFailure} when the lock or the * coordination directory was unavailable — never a silent success. */ export declare function withGuardedConfigWrite(root: string, targetPath: string, mutate: (recoveryJournalPath: string) => Promise): Promise; /** Type guard for the failure branch of {@link withGuardedConfigWrite}. */ export declare function isGuardedWriteFailure(value: unknown): value is GuardedWriteFailure; //# sourceMappingURL=guarded-config-write.d.ts.map