import type { Question } from "../questions/domain/question.schema.js"; import type { ChatMessageWriter } from "../shared/interfaces/chat-message-writer.interface.js"; import { buildElicitationCreate } from "./elicitation.builder.js"; export type ElicitResultLike = { action: "accept"; content?: { choice?: unknown; }; } | { action: "decline"; } | { action: "cancel"; }; export type ElicitInputFn = (params: ReturnType) => Promise; export interface DispatchElicitationsParams { userId: string; questions: Question[]; elicitInput: ElicitInputFn; /** * Optional. When absent, elicitations still dispatch (so users aren't * left mid-flow on a misconfiguration), but accepted answers are dropped * with a one-shot warn. See dispatcher body. */ chatMessageWriter?: ChatMessageWriter; } /** * Sequentially dispatches one `elicitation/create` per question. On accept, * flattens the choice and posts it via the ChatMessageWriter. `cancel` breaks * the loop; `decline` is a no-op. A transport throw breaks the loop with a * warning. An addUserMessage throw logs and continues (doesn't halt the loop). * Empty `questions` is a no-op. * * Caller is responsible for the capability check — this function only knows * how to dispatch. */ export declare function dispatchElicitations({ userId, questions, elicitInput, chatMessageWriter, }: DispatchElicitationsParams): Promise;