/**
 * Startup Lock for CLIProxy
 *
 * File-based mutex to prevent race conditions when multiple
 * CCS processes try to start CLIProxy simultaneously.
 *
 * Uses a lock file with PID and timestamp to coordinate startup.
 * Lock is automatically released after timeout or process exit.
 *
 * Lock Timeout Rationale (10 seconds):
 * - CLIProxy startup typically takes 1-3s (binary spawn + port bind)
 * - HTTP health check takes ~1s timeout
 * - Session registration takes <100ms
 * - Total expected lock hold time: 2-5s
 * - 10s provides 2x safety margin for slow systems/disk I/O
 * - Too short: legitimate startups fail on slow systems
 * - Too long: dead processes block other terminals unnecessarily
 *
 * Why file-based instead of port-based:
 * - Works before port is bound (prevents duplicate spawn attempts)
 * - Survives process crashes (stale detection via PID check)
 * - Cross-platform (Windows, macOS, Linux)
 */
/** Lock acquisition result */
export interface LockResult {
    acquired: boolean;
    lockPath: string;
    release: () => void;
}
/**
 * Acquire the startup lock with retries.
 *
 * @param options.retries Number of retry attempts (default: 20)
 * @param options.retryInterval Ms between retries (default: 250)
 * @param options.verbose Enable verbose logging (default: false)
 * @returns LockResult
 * @throws Error if lock cannot be acquired after all retries
 */
export declare function acquireStartupLock(options?: {
    retries?: number;
    retryInterval?: number;
    verbose?: boolean;
}): Promise<LockResult>;
/**
 * Execute a function while holding the startup lock.
 * Lock is automatically released after function completes or throws.
 *
 * @param fn Function to execute
 * @param options Lock acquisition options (retries, retryInterval, verbose)
 * @returns Result of fn
 */
export declare function withStartupLock<T>(fn: () => Promise<T>, options?: {
    retries?: number;
    retryInterval?: number;
    verbose?: boolean;
}): Promise<T>;
//# sourceMappingURL=startup-lock.d.ts.map