/**
 * Parallel session management for Telegram.
 *
 * When the active session variant is busy, users are offered an inline keyboard
 * to either queue their message for the busy session or open a new parallel session.
 * Each parallel session uses the same agent identity but has an isolated execution
 * context (different session key suffix: :v2, :v3, ...).
 *
 * State is in-memory only — resets to primary on gateway restart, which is safe.
 */
type PendingMessage = {
    dispatch: (sessionKey: string) => Promise<void>;
    baseSessionKey: string;
    chatId: string;
    activeVariant: number;
    expiresAt: number;
};
type VariantEntry = {
    variant: number;
    lastActivityAt: number;
};
export declare function getActiveVariant(chatId: string): number;
export declare function setActiveVariant(chatId: string, variant: number): void;
export declare function getNextVariant(chatId: string): number;
/** Returns the highest variant number that has been opened for this chat. */
export declare function getMaxVariant(chatId: string): number;
/** Returns all variant numbers that have been opened for this chat. */
export declare function listVariants(chatId: string): VariantEntry[];
/**
 * Records activity for a chat variant. Call this when dispatching a message
 * or receiving a reply for a given session variant.
 */
export declare function recordVariantActivity(chatId: string, variant: number): void;
/**
 * Prunes idle variants older than VARIANT_IDLE_TTL_MS.
 * Call occasionally (e.g. on each message) to clean up stale state.
 */
export declare function pruneIdleVariants(chatId: string): void;
/**
 * Builds the session key for the given chat's active variant.
 */
export declare function buildActiveVariantSessionKey(chatId: string, baseSessionKey: string): string;
/**
 * Stores a pending message (one waiting for user to choose queue vs. new session).
 * Returns a unique pending ID to include in callback_data.
 */
export declare function storePendingMessage(params: {
    dispatch: (sessionKey: string) => Promise<void>;
    baseSessionKey: string;
    chatId: string;
    activeVariant: number;
}): string;
export declare function getPendingMessage(id: string): PendingMessage | null;
export declare function deletePendingMessage(id: string): void;
/**
 * Returns the label to prepend to replies from a given session variant.
 * Returns undefined for variant 1 when no parallel sessions are active (no noise).
 * Returns "[S1]" for primary when parallels exist; "[S2]", "[S3]" for variants.
 */
export declare function resolveVariantLabel(chatId: string, variant: number): string | undefined;
export {};
