import type { CodexAppServerPendingQuestion, CodexAppServerQuestionAnswers } from "./codex-app-server-interaction-client.js"; import { type TerminalInteractionSubject, type TerminalInteractionSubjectProjection } from "./terminal-interaction-protocol.js"; /** Owner-private: store only in the protected Watch checkpoint, never callbacks. */ export interface CodexBlockingQuestionDraft { threadId: string; turnId: string; itemId: string; requestId: string | number; stablePayloadFingerprint: string; answers: CodexAppServerQuestionAnswers; nextQuestionIndex: number; } /** Only projection is public; native identifiers and draft material stay private. */ export interface CodexAppServerQuestionnaireOffer { projection: TerminalInteractionSubjectProjection; promptFingerprint: string; surfaceId: string; payloadFingerprint: string; questionIndex: number; nativeQuestionId: string; } export interface BuildCodexAppServerQuestionnaireOfferInput { pending: CodexAppServerPendingQuestion; subject: TerminalInteractionSubject; canonicalEndpointIdentity: unknown; draft?: CodexBlockingQuestionDraft; now: Date; ttlMs?: number; expiresAt?: string; responseUncertain?: boolean; } export type CodexAppServerQuestionnaireOfferResult = { status: "ready"; offer: CodexAppServerQuestionnaireOffer; } | { status: "manual_required"; offer: CodexAppServerQuestionnaireOffer; reason: string; } | { status: "invalidated"; reason: string; }; export type CodexAppServerQuestionnaireAnswerResult = { status: "advance"; draft: CodexBlockingQuestionDraft; } | { status: "ready"; requestId: string | number; answers: CodexAppServerQuestionAnswers; } | { status: "invalidated"; reason: string; }; /** * Build from the real native RPC payload. No terminal keys, screen coordinates, * or synthetic UI action plans are produced by this adapter. */ export declare function buildCodexAppServerQuestionnaireOffer(input: BuildCodexAppServerQuestionnaireOfferInput): CodexAppServerQuestionnaireOfferResult; /** * Advance only private state until every native question has an answer. The * caller reserves the displayed offer, persists an advance, then consumes it. * Only a ready result may be passed to the native client's single RPC write. */ export declare function accumulateCodexAppServerQuestionnaireAnswer(input: { pending: CodexAppServerPendingQuestion; offer: CodexAppServerQuestionnaireOffer; canonicalEndpointIdentity: unknown; response: unknown; draft?: CodexBlockingQuestionDraft; now: Date; }): CodexAppServerQuestionnaireAnswerResult; /** Shape-only durable validation; an offer also rebinds it to the live payload. */ export declare function validateCodexBlockingQuestionDraft(value: unknown): CodexBlockingQuestionDraft;