import type { QuestionAnswer, QuestionnaireResult, QuestionParams } from "./types.js"; export declare const DECLINE_MESSAGE = "User declined to answer questions"; export declare const ENVELOPE_PREFIX = "User has answered your questions:"; export declare const ENVELOPE_SUFFIX = "You can now continue with the user's answers in mind."; /** * True when any answer in the result carries `kind: "chat"`. * Used by `buildQuestionnaireResponse` to switch to the terminate path. */ export declare function hasChatAnswer(result: QuestionnaireResult): boolean; /** * Map a `QuestionnaireResult` (or null/cancelled) to the LLM-facing tool envelope. * Pure of `(result, params)`; cancelled and non-chat "no segments" both fall to * `DECLINE_MESSAGE` so the model sees a single canonical "didn't answer" signal * regardless of why. * * Chat rule: signal-only chat keeps the legacy `terminate: true` stop/wait * wording. Typed chat omits `terminate` and the generic continuation suffix so * the model can respond to the inline user message in this same turn. */ export declare function buildQuestionnaireResponse(result: QuestionnaireResult | null | undefined, params: QuestionParams): { content: { type: "text"; text: string; }[]; details: QuestionnaireResult; terminate?: boolean | undefined; }; /** * Format a single answer segment for the envelope. Pure of `a`. The `"Q"="A"` shape and * the optional `selected preview:` / `user notes:` suffixes are pinned by envelope tests. */ export declare function buildAnswerSegment(a: QuestionAnswer): string; export declare function buildToolResult(text: string, details: QuestionnaireResult, options?: { terminate?: boolean; }): { content: { type: "text"; text: string; }[]; details: QuestionnaireResult; terminate?: boolean | undefined; }; //# sourceMappingURL=response-envelope.d.ts.map