import type { ReviewPayloadFs } from "./review-payload"; export type ReviewLockFs = Omit & { writeFileSync(path: string, data: Uint8Array, options: { flag: "wx"; mode: number; }): void; mkdirSync(path: string): void; renameSync(oldPath: string, newPath: string): void; unlinkSync(path: string): void; }; export type LockOptions = { reviewStateRoot: string; fs?: ReviewLockFs; now?: () => Date; }; export type AcquireInput = { reviewRoot: string; runId: string; force?: boolean; }; export type ReleaseInput = { reviewRoot: string; runId: string; mode: "delete" | "complete"; }; export type StatusInput = { reviewRoot: string; }; export type LockHolder = { path: string; run_id: string; started_at: string; age_s: number; }; export type LockRejection = { ok: false; reason: "invalid-arguments" | "invalid-op" | "invalid-review-state-root" | "invalid-clock" | "path-outside-root" | "path-resolution-error" | "unreadable-lock" | "write-error" | "cleanup-error" | "readback-mismatch" | "not-owner"; path?: string; code?: string; message?: string; cleanup?: LockRejection; }; export type HeldResult = { ok: false; state: "held"; holder: LockHolder; cleanup?: LockRejection; }; export type AcquireResult = LockRejection | HeldResult | { ok: true; state: "acquired"; path: string; started_at: string; }; export type ReleaseResult = LockRejection | { ok: true; state: "absent"; } | { ok: true; state: "released" | "completed"; path: string; }; export type StatusResult = LockRejection | { held: boolean; holders: LockHolder[]; legacy_present: boolean; }; export declare function acquire(input: AcquireInput, opts: LockOptions): AcquireResult; export declare function release(input: ReleaseInput, opts: LockOptions): ReleaseResult; export declare function status(input: StatusInput, opts: LockOptions): StatusResult; /** Host-only dependencies are captured once; executor results are JSON strings. */ export declare function createLockExecutor(reviewStateRoot: string, options?: Omit): (input: unknown) => string; //# sourceMappingURL=review-lock.d.ts.map