@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
18 lines • 1 kB
TypeScript
import { type HeldFileLock } from "../file-lock.ts";
/** A record lock nobody refreshed for this long is taken over by the next caller that wants it. */
export declare const MOVE_RECORD_LOCK_STALE_MS = 10000;
/** A move record write ran without this process holding that record's lock. */
export declare class MoveRecordUnlockedError extends Error {
readonly code = "move_record_unlocked";
constructor(file: string);
}
/** The move record locks this process holds. Every record write must find its lock here, or it fails loudly. */
export declare class MoveRecordLocks {
#private;
hold<T>(file: string, fn: () => T | Promise<T>): Promise<T>;
/** Throws unless this process holds `file`'s lock and has not lost it. */
assertHeld(file: string): void;
}
/** Takes a move record's cross-process lock, retrying with backoff for up to `LOCK_WAIT_MS`. */
export declare function acquireMoveRecordLock(file: string): Promise<HeldFileLock>;
//# sourceMappingURL=move-ledger-lock.d.ts.map