import { Chat as _llmzChat, RenderedComponent } from 'llmz';
import { TranscriptItem } from './transcript';
import { AnyIncomingEvent, AnyIncomingMessage } from '@botpress/sdk/dist/bot';
import { BotContext } from '../context/context';
import { Message as APIMessage } from '@botpress/client';
import { Autonomous } from '../autonomous';
export type Msg = {
    type: string;
    payload: Record<string, unknown>;
    tags?: Record<string, unknown>;
};
export type ComponentHandler<T extends Autonomous.Component = Autonomous.Component, TProps extends {} = T extends Autonomous.Component ? (T['propsType'] extends {} ? T['propsType'] : {}) : {}> = (message: RenderedComponent<TProps>) => Promise<void> | void;
export type ComponentRegistration<T extends Autonomous.Component = Autonomous.Component> = {
    component: T;
    handler?: ComponentHandler<T>;
};
export declare class Chat extends _llmzChat {
    private _transcript;
    private client;
    private conversation;
    private botId;
    private logger;
    private citations;
    private trackedTags;
    private componentRegistry;
    constructor(context: BotContext);
    /**
     * Register a component with an optional handler
     */
    registerComponent<T extends Autonomous.Component>(registration: ComponentRegistration<T>): this;
    /**
     * Remove a component by name
     */
    removeComponent(name: string): this;
    /**
     * Get all registered components
     */
    getComponents(): Promise<import("llmz").Component<import("llmz").ComponentDefinition>[]>;
    /**
     * Clear the entire transcript
     */
    clearTranscript(): Promise<void>;
    /**
     * Prepend items to the transcript
     */
    prependToTranscript(items: TranscriptItem[]): Promise<void>;
    /**
     * Get a copy of the current transcript
     */
    getTranscript(): Promise<TranscriptItem[]>;
    /**
     * Replace the entire transcript
     */
    setTranscript(items: TranscriptItem[]): Promise<void>;
    fetchTranscript(): Promise<TranscriptItem[]>;
    compactTranscript(): Promise<void>;
    getRemainingContextSpace(): {
        bytes: number;
        messages: number;
    };
    shouldCompactTranscript(): boolean;
    saveTranscript(): Promise<void>;
    sendMessage(message: Msg): Promise<{
        id: string;
        createdAt: string;
        updatedAt: string;
        type: string;
        payload: {
            [k: string]: any;
        };
        direction: "incoming" | "outgoing";
        userId: string;
        conversationId: string;
        tags: {
            [k: string]: string;
        };
        origin?: "synthetic";
    }>;
    transformMessage(message: APIMessage): Promise<TranscriptItem | null>;
    transformEvent(event: AnyIncomingEvent<any>): Promise<TranscriptItem | null>;
    handle(message: RenderedComponent): Promise<void>;
    /**
     * This is a temporary workaround as the Content-Type of images on Telegram are "binary/octet-stream"
     * And OpenAI integration does not support this type. It needs to be "image/jpeg" or "image/png".
     * This function fetches the image from Telegram, uploads it to the file storage, and replaces the URL in the message.
     */
    __temporary__fixTelegramImage(message: AnyIncomingMessage<any>): Promise<AnyIncomingMessage<any>>;
    addEvent(event: AnyIncomingEvent<any> | {
        id: string;
        type: string;
        payload: unknown;
        createdAt: string;
    }): Promise<void>;
    addMessage(message: AnyIncomingMessage<any>): Promise<void>;
}
//# sourceMappingURL=chat.d.ts.map