/** * Invocation lock to prevent concurrent execution of the same agent instance. * Uses a simple boolean flag with RAII-style cleanup via Disposable pattern. */ export interface Disposable { [Symbol.dispose](): void; } export declare class ConcurrentInvocationError extends Error { readonly agentId: string; constructor(agentId: string); } /** * Simple lock mechanism to prevent concurrent invocations of the same agent. * * When the lock is acquired: * - Returns a Disposable object that releases the lock when disposed * - If already locked, throws ConcurrentInvocationError * * Usage with try/finally: * ``` * const lock = this.invocationLock.acquire(agentId) * try { * // do work * } finally { * lock[Symbol.dispose]() * } * ``` */ export declare class InvocationLock { private isLocked; /** * Acquire the lock. Returns a Disposable that releases the lock when disposed. * @throws {ConcurrentInvocationError} if the lock is already held */ acquire(agentId: string): Disposable; /** * Check if the lock is currently active (held). */ isActive(): boolean; } //# sourceMappingURL=lock.d.ts.map