/** * File Write Lock * * Per-file promise queue that serializes write operations to the same path. * Prevents read-modify-write race conditions when multiple tool calls * target the same file concurrently. */ /** Options for constructing a FileWriteLock. */ export interface FileWriteLockOptions { /** Maximum time (ms) a single lock-holder may run before being rejected. Default: 30 000. */ timeoutMs?: number; } /** * Interface for per-file write locking. */ export interface FileWriteLock { /** Execute `fn` while holding an exclusive lock on `filePath`. */ withLock(filePath: string, fn: () => Promise): Promise; /** Number of paths that currently have queued operations. */ get size(): number; } /** * In-memory implementation of FileWriteLock using per-path promise queues. * * Adapted from mastracode's `withWriteLock` pattern. */ export declare class InMemoryFileWriteLock implements FileWriteLock { private queues; private readonly timeoutMs; constructor(opts?: FileWriteLockOptions); get size(): number; withLock(filePath: string, fn: () => Promise): Promise; private normalizePath; } //# sourceMappingURL=file-write-lock.d.ts.map