/** * A simple mutex implementation for protecting shared state. * Provides exclusive access to wrapped data through async locking. */ export declare class Mutex { private data; private locked; private waitQueue; constructor(initialData: T); /** * Acquire the lock. Returns a promise that resolves when the lock is acquired. */ private acquire; /** * Release the lock, allowing the next waiter to proceed. */ private release; /** * Run a function with exclusive access to the protected data. * The lock is acquired before the function runs and released after it completes. * * @param fn - Function that receives the current data and returns updated data or a promise of updated data * @returns Promise that resolves with the function's return value */ runExclusive(fn: (data: T) => R | Promise): Promise; /** * Run a function with exclusive access and update the protected data. * The lock is acquired before the function runs and released after it completes. * * @param fn - Function that receives the current data and returns the updated data */ update(fn: (data: T) => T | Promise): Promise; /** * Get a snapshot of the current data without acquiring the lock. * Use with caution - this does not guarantee consistency. * Prefer runExclusive for reads that need to be consistent with writes. */ getSnapshot(): T; } /** * Interface for the session state data protected by mutex. */ export interface SessionStateData { state: import('../types/index.js').SessionState; autoApprovalFailed: boolean; autoApprovalReason: string | undefined; autoApprovalAbortController: AbortController | undefined; backgroundTaskCount: number; teamMemberCount: number; } /** * Create initial session state data with default values. */ export declare function createInitialSessionStateData(): SessionStateData;