import type { AgentRunRelay, RelayEvent } from './agent-run-relay.js';
/** User inactivity window before pending clarification is rejected (web/Telegram, etc.). */
export declare const CLARIFY_USER_RESPONSE_TIMEOUT_MS: number;
export interface ClarifyBridgeRequest {
    question: string;
    choices?: string[];
    default?: string;
}
export interface StartClarifyRequestOptions {
    sessionKey: string;
    /** Present for in-flight webchat runs (SSE + relay). */
    runId?: string;
    relay: AgentRunRelay;
    publishSse?: (event: RelayEvent) => void;
    request: ClarifyBridgeRequest;
    /** e.g. Telegram inline keyboard + prompt message */
    deliver?: (ctx: {
        sessionKey: string;
        requestId: string;
        request: ClarifyBridgeRequest;
    }) => Promise<void>;
}
/**
 * Pending user answers for the `clarify` tool (web UI, Telegram, etc.).
 */
export declare class ClarifyBridge {
    private pending;
    /** sessionKey → requestId when waiting for a free-text reply (no multiple-choice). */
    private pendingFreeTextBySession;
    startRequest(opts: StartClarifyRequestOptions): Promise<string>;
    private deletePending;
    private clearFreeTextSlot;
    /**
     * Consume the user's next text message as the clarify answer (Telegram DM/group).
     */
    tryConsumeFreeTextReply(sessionKey: string, text: string): boolean;
    handleChoiceCallback(requestId: string, choiceIndex: number): boolean;
    handleResponse(requestId: string, answer: string): boolean;
    cancelForRun(runId: string): void;
    dispose(): void;
}
