/** Disk-backed lockfile JSON content for cross-process mutual exclusion. */
export interface CrossProcessLockMetadata {
    specId: string;
    pid: number;
    sessionId: string;
    hostname: string;
    /** ISO-8601 acquisition timestamp. */
    acquiredAt: string;
    /** ISO-8601 last heartbeat. Initially equal to acquiredAt. */
    lastHeartbeatAt: string;
    /** Hard expiration ms after acquiredAt. Default 600_000 (10 min). */
    ttlMs: number;
    reason?: string;
}
/** Options for acquiring a cross-process spec lock. */
export interface AcquireLockOptions {
    /** Used as `reason` in lockfile. */
    reason?: string;
    /**
     * Hard TTL in ms. Default 600_000.
     * Clamped to [60_000, 86_400_000].
     */
    ttlMs?: number;
    /**
     * Override sessionId.
     * Default derived from process.env.PLANU_SESSION_ID or a random uuid.
     */
    sessionId?: string;
}
/**
 * Handle returned from a successful acquireLock call.
 * Keep alive via heartbeat(). Release via releaseLock(handle).
 */
export interface LockHandle {
    /** Snapshot of the lockfile at acquisition time. */
    readonly metadata: CrossProcessLockMetadata;
    /** Absolute path to the .lock file on disk. */
    readonly lockPath: string;
    /**
     * Update the lockfile's lastHeartbeatAt to now. Idempotent.
     * Returns false if the lockfile is no longer held by this handle (e.g. was stolen).
     */
    heartbeat(): Promise<boolean>;
    /** Returns true if the underlying lockfile still names this handle's sessionId. */
    isStillHeld(): Promise<boolean>;
}
/** Lockfile state enriched with computed staleness information. */
export interface LockInfo extends CrossProcessLockMetadata {
    /** Computed at read time: true if the lock is detectably stale. */
    stale: boolean;
    staleReason?: 'heartbeat-expired' | 'ttl-expired' | 'pid-dead';
}
//# sourceMappingURL=spec-lock-v2.d.ts.map