import type { ReadChatResult } from './contracts.js';
import { CHAT_CONTRACT_VERSION_V1, CHAT_CONTRACT_VERSION_V2, type ChatContractVersion, type ReadChatResultV2 } from './transcript-v2.js';
/**
 * Read the producer-declared contract version from a raw read_chat payload.
 * Returns v1 when absent or unrecognised, so legacy producers keep working
 * through A1. A2 will tighten this to throw when an unsupported version is
 * declared.
 */
export declare function readPayloadContractVersion(raw: unknown): ChatContractVersion;
/**
 * Validate a v2 payload. Thin wrapper around assertReadChatResultV2Payload
 * that prefixes the contract violation with the caller's source label.
 */
export declare function validateReadChatResultV2Payload(raw: unknown, source?: string): ReadChatResultV2;
/**
 * Versioned entry point. Routes on the producer-declared contractVersion:
 *   - v2 → strict v2 validation (transcript-v2.ts invariants)
 *   - v1 (or absent) → legacy permissive validation
 *
 * Callers that have not yet been audited to handle v2 outputs should use
 * validateReadChatResultPayload directly; that path stays bound to v1 shape
 * during the A1 transition.
 */
export declare function validateReadChatResultPayloadVersioned(raw: unknown, source?: string): {
    version: typeof CHAT_CONTRACT_VERSION_V1;
    payload: ReadChatResult & Record<string, unknown>;
} | {
    version: typeof CHAT_CONTRACT_VERSION_V2;
    payload: ReadChatResultV2;
};
export declare function validateReadChatResultPayload(raw: unknown, source?: string): ReadChatResult & Record<string, unknown>;
