/**
 * Shared envelope format for the non-blocking `ask_user_choices` flow.
 *
 * When the UI submits answers for a pending question, the server appends a
 * normal `role: "user"` message to the transcript whose text body is:
 *
 *     [ask_user_choices_response tool_use_id=<ID>]
 *     {"answers":[{"question":"...","selected":"...","other_text":null}, ...]}
 *
 * The marker line must appear at position 0 of the message text. The body
 * (from the newline onward) is a JSON object with an `answers` array.
 *
 * This module is the single source of truth for that format — shared by the
 * server (envelope construction + transcript scan) and the UI (renderer
 * filter + transcript lookup).
 */
export interface AskResponseAnswer {
    question: string;
    /** Single-select: option text the user picked; "Other" when free-text.
     *  Multi-select: array of option texts (may include "Other"). */
    selected: string | string[];
    /** Free-text content when "Other" was picked, otherwise null. */
    other_text: string | null;
}
/** Canonical safe character set for envelope tool_use_id values.
 *  Allows simple IDs plus the composite delimiter (`|`) used by live tool calls. */
export declare const ASK_TOOL_USE_ID_PATTERN = "[A-Za-z0-9_|-]+";
/** Regex that matches a well-formed envelope message text.
 *  Group 1 = tool_use_id; group 2 = JSON body (everything after the first newline). */
export declare const ASK_ENVELOPE_REGEX: RegExp;
/** Cheap prefix test — true for any text starting with the marker line (used by
 *  the transcript render-layer filter where we don't need to parse the body). */
export declare const ASK_ENVELOPE_PREFIX_REGEX: RegExp;
/** Build an envelope message body from a tool_use_id and answers. */
export declare function buildAskResponseEnvelope(toolUseId: string, answers: AskResponseAnswer[]): string;
export interface ParsedAskEnvelope {
    toolUseId: string;
    answers: AskResponseAnswer[];
}
/** Parse envelope text. Returns null if the text does not conform (bad marker,
 *  bad charset, missing newline, non-JSON body, or body missing `answers`). */
export declare function parseAskResponseEnvelope(text: string): ParsedAskEnvelope | null;
/** True iff `msg` is a user transcript message whose text is an envelope. */
export declare function isAskResponseEnvelope(msg: any): boolean;
/**
 * Scan a transcript message list for an envelope matching the given tool_use_id.
 * Returns the parsed answers array, or null if not found.
 *
 * Defensive: only considers messages that appear *after* the corresponding
 * `tool_use` block (if found). If no tool_use with the given id appears in the
 * transcript at all, returns null (envelope without a cause is ignored).
 */
export declare function findAskResponseAnswers(messages: any[] | undefined | null, toolUseId: string): AskResponseAnswer[] | null;
//# sourceMappingURL=ask-envelope.d.ts.map