import type { ActorId, LockId, OpaqueId } from "../domain/records.js"; export interface LockOwnerMetadata { readonly owner_id: ActorId; readonly process_id: number; readonly process_instance_id: OpaqueId; readonly boot_id: OpaqueId; readonly created_nonce: OpaqueId; readonly note?: string; } export interface AcquiredLock { readonly lock_id: LockId; readonly generation_id: OpaqueId; readonly path: string; readonly owner: LockOwnerMetadata; release(): void; } export interface RecoverLockOptions { readonly locksRoot: string; readonly lockId: string; readonly recoveredBy: string; readonly reason: string; readonly expectedGenerationId: string; } export interface RecoveredLock { readonly lock_id: LockId; readonly generation_id: OpaqueId; readonly recovered_by: ActorId; readonly previousOwner: LockOwnerMetadata; readonly capture: LockRecoveryCapture; readonly archivedPath: string; readonly recoveryEvidencePath: string; } export interface LockRecoveryCapture { readonly lock_entry: { readonly kind: "directory"; readonly device: number; readonly inode: number; readonly mode: number; }; readonly owner_entry: { readonly kind: "regular-file"; readonly metadata_status: "valid"; readonly device: number; readonly inode: number; readonly mode: number; readonly detail: string; }; } export declare class LockBusyError extends Error { readonly lockId: LockId; readonly lockPath: string; readonly owner?: LockOwnerMetadata; constructor(lockId: LockId, lockPath: string, owner?: LockOwnerMetadata); } export declare function acquireDirectoryLock(options: { readonly locksRoot: string; readonly lockId: string; readonly ownerId: string; readonly note?: string; }): AcquiredLock; export declare function recoverDirectoryLock(options: RecoverLockOptions): RecoveredLock; export declare function assertRecoveredLock(value: unknown): asserts value is RecoveredLock; export declare function readLockOwner(lockPath: string): LockOwnerMetadata | undefined;