interface BufferEntry {
    texts: string[];
    timer: ReturnType<typeof setTimeout>;
    userName?: string;
}
export declare class ConversationEngine {
    /** characterId:userId → buffered messages */
    private buffers;
    /** characterId:userId → custom buffer duration */
    private bufferDurations;
    private static bufferKey;
    /**
     * Main entry point for incoming messages.
     * Buffers consecutive messages and merges them before generating a response.
     */
    handleIncomingMessage(characterId: string, userId: number, text: string, userName?: string): Promise<void>;
    /**
     * Sets the buffer time for message merging for a specific character-user pair.
     */
    setMessageBuffer(characterId: string, userId: number, bufferMs: number): void;
    /**
     * Generates an AI response using OpenRouter.
     * Builds system prompt from character DNA + profile + history,
     * then sends to OpenRouter for completion.
     */
    generateResponse(characterId: string, userId: number): Promise<string>;
    /**
     * Checks if a photo was sent within the last N messages.
     */
    private isPhotoCooldownActive;
    /**
     * Parses [FOTO] tag from response text.
     * Returns { text, hasPhoto } where text has the tag removed.
     */
    private parsePhotoTag;
    /**
     * Flushes the message buffer: merges texts, saves to history,
     * generates a response with delay, parses [FOTO] tags, and queues for sending.
     */
    private flushBuffer;
    /**
     * Queues a photo generation task for a user conversation.
     * Uses AI prompt generator trained on 900+ prompt library to create
     * character-personalized, context-aware image prompts.
     */
    private queuePhotoForUser;
    /** Expose buffer state for testing */
    _getBuffer(characterId: string, userId: number): BufferEntry | undefined;
    /** Clear all buffers (useful for cleanup) */
    _clearBuffers(): void;
}
/** Singleton instance */
export declare const conversationEngine: ConversationEngine;
export {};
//# sourceMappingURL=index.d.ts.map