/**
 * Serialized lock for browser access. Only one operation (chat, scheduled
 * task, Chrome runtime restart) may hold the lock at a time; everything
 * else queues behind it.
 *
 * Why a class instead of a single Promise chain in Agent: the watchdog
 * needs to peek at whether the lock is idle without acquiring it, and
 * needs a "try-acquire" path that bails when contended. Bundling the
 * state (chain head, active flag, waiter count) here keeps those checks
 * coherent — Agent can't accidentally mutate one without the others.
 */
export interface BrowserLockHandle {
    /** Resolves when the holder has the lock. Caller owns it until release(). */
    promise: Promise<void>;
    /** Release ownership. Safe to call more than once. */
    release: () => void;
}
export declare class BrowserLock {
    private chain;
    private active;
    private waiters;
    /**
     * Queue for exclusive browser access. The returned promise resolves once
     * everyone ahead of us has released. release() MUST be called even on
     * failure paths — typically inside finally — or the chain wedges forever.
     */
    acquire(): BrowserLockHandle;
    /**
     * Acquire only if nothing else is holding or waiting. Used by the Chrome
     * runtime watchdog so an aged-Chrome restart never preempts in-flight
     * work. Returns null if contended.
     */
    tryAcquire(): BrowserLockHandle | null;
    /** True when no one holds the lock and no one is waiting. */
    isIdle(): boolean;
}
