import type { acquireSessionWriteLock } from "../../session-write-lock.js"; type SessionLock = Awaited>; type AcquireSessionWriteLock = typeof acquireSessionWriteLock; type LockOptions = { sessionFile: string; timeoutMs: number; staleMs: number; maxHoldMs: number; }; type SessionWriteLockRunOptions = { publishOwnedWrite?: boolean; }; export type EmbeddedAttemptSessionFileOwner = { sessionFileKey: string; release(): void; }; export declare class EmbeddedAttemptSessionFileOwnerTimeoutError extends Error { constructor(sessionFile: string, timeoutMs: number); } export declare function acquireEmbeddedAttemptSessionFileOwner(params: { sessionFile: string; timeoutMs?: number; signal?: AbortSignal; }): Promise; export declare function resetEmbeddedAttemptSessionFileOwnersForTest(): void; export declare class EmbeddedAttemptSessionTakeoverError extends Error { constructor(sessionFile: string); } export declare function installSessionEventWriteLock(params: { session: unknown; withSessionWriteLock: (run: () => Promise | T) => Promise; }): void; export declare function installSessionExternalHookWriteLock(params: { session: unknown; withSessionWriteLock: (run: () => Promise | T) => Promise; }): void; export type EmbeddedAttemptSessionLockController = { releaseForPrompt(): Promise; releaseHeldLockForAbort(): Promise; refreshAfterOwnedSessionWrite(): void; reacquireAfterPrompt(): Promise; waitForSessionEvents(session: unknown): Promise; withSessionWriteLock(run: () => Promise | T, options?: SessionWriteLockRunOptions): Promise; acquireForCleanup(params?: { session?: unknown; }): Promise; hasSessionTakeover(): boolean; dispose(): Promise; }; export declare function createEmbeddedAttemptSessionLockController(params: { acquireSessionWriteLock: AcquireSessionWriteLock; lockOptions: LockOptions; }): Promise; export declare function installPromptSubmissionLockRelease(params: { session: unknown; waitForSessionEvents: (session: unknown) => Promise; releaseForPrompt: () => Promise; reacquireAfterPrompt: () => Promise; sessionFile?: string; sessionKey?: string; withSessionWriteLock?: (run: () => Promise | T, options?: SessionWriteLockRunOptions) => Promise; }): void; export {};