/** * Wire contract for the answer submitted back to an interactive `ask-user` * prompt. This payload crosses the renderer → daemon boundary (it rides * `submitInteractive({ action: "submit", payload })`), so its shape is a * cross-language contract, not an internal detail. * * Consumers that MUST stay in sync with this shape: * - daemon (Go) standard ACP adapter — preserves this canonical payload for * local projection and translates selected labels back to provider ACP * permission option IDs when the provider bridges questions that way. * - daemon (Go) codex app-server adapter — `appServerUserInputAnswers` reshapes * `answersByQuestionId` into codex's `requestUserInput` response. * * Field semantics: * - `answersByQuestionId` is the canonical, machine-readable answer: question id * → the chosen option label(s) / free text. This is what providers consume. * - `answers` is a flat, human-readable display list (one entry per answered * question, multi-select joined). Never the source of truth for routing. * * Always build this with {@link buildAskUserAnswerPayload} so producers can't * drift on field names or which field is authoritative. */ interface InteractiveAnswerPayload { answers: string[]; answersByQuestionId: Record; } declare function readOwnAnswer(values: Record, questionID: string, fallback: T): T; declare function writeOwnAnswer(values: Record, questionID: string, value: T): void; /** * Builds the canonical interactive answer payload from the per-question answers. * `answers` is derived from `answersByQuestionId` (multi-select values joined) * so the two fields can never disagree. */ declare function buildAskUserAnswerPayload(answersByQuestionId: Record): InteractiveAnswerPayload; export { type InteractiveAnswerPayload, buildAskUserAnswerPayload, readOwnAnswer, writeOwnAnswer };