export declare class SessionQueue { private queues; /** Track which sessions are currently running */ private running; /** Track how many tasks exist per session key, including the active one. */ private pending; /** Track which session keys have been cancelled - queued tasks are skipped. */ private cancelled; /** Track which session keys are paused - queued tasks wait until resumed. */ private paused; /** Internal causal hold: a callback row owns the head, but waits for its * source session's completion backlog to reach a drain boundary. */ private callbackDrainHeld; /** Resolvers for tasks blocked on a paused session key, woken on resume. */ private pauseWaiters; /** Queue rows this process has already taken responsibility for. */ private inFlightItems; /** * Check if a session is currently running. */ isRunning(sessionKey: string): boolean; /** * Has this process already accepted `queueItemId` for execution? A row only * flips to `running` in the DB when its task actually starts, so one parked * behind a long turn still reads `pending` and is indistinguishable from an * orphan to a recovery sweep. This is what tells the two apart. */ hasInFlightItem(queueItemId: string): boolean; getPendingCount(sessionKey: string): number; getTransportState(sessionKey: string, status?: "idle" | "running" | "error" | "waiting" | "interrupted"): "idle" | "queued" | "running" | "error" | "interrupted"; /** * Add a session key to the cancelled set and remove it from pending. * Any queued tasks for this key will be skipped when they next execute. */ clearQueue(sessionKey: string): void; /** * Remove a session key from the cancelled set. * Call this before dispatching a new message so subsequent tasks run normally. */ clearCancelled(sessionKey: string): void; pauseQueue(sessionKey: string): void; resumeQueue(sessionKey: string): void; private wakePauseWaiters; isPaused(sessionKey: string): boolean; holdForCallbackDrain(sessionKey: string, queueItemId: string): void; releaseCallbackDrain(sessionKey: string, queueItemId: string): void; isCallbackDrainHeld(sessionKey: string, queueItemId?: string): boolean; private waitUntilRunnable; /** * Enqueue a task for a session. Tasks are serialized per session key. */ enqueue(sessionKey: string, fn: () => Promise, queueItemId?: string, claimed?: boolean): Promise; private decrementPending; } //# sourceMappingURL=queue.d.ts.map