import { type ActionEnvelope, type ChatErrorAction, type StateAction } from "./protocol/actions.js"; import { type ChatState, type ErrorInfo, type Turn } from "./protocol/state.js"; interface ILegacyChatErrorAction extends Omit { readonly error: ErrorInfo; } type CompatibleTurn = Turn | (Turn & { readonly error: ErrorInfo; }); type CompatibleActionEnvelope = Omit & { readonly action: StateAction | ILegacyChatErrorAction; }; /** * Reads the top-level error field emitted by AHP hosts before durable error * response parts were introduced. */ export declare function readLegacyTurnError(turn: CompatibleTurn): ErrorInfo | undefined; /** * Moves a legacy completed-turn error into its durable response-part position. */ export declare function normalizeLegacyTurnError(turn: CompatibleTurn): Turn; /** * Normalizes legacy completed-turn errors in a chat snapshot. */ export declare function normalizeLegacyChatStateErrors(state: ChatState): ChatState; /** * Normalizes legacy error payloads before a server action reaches reducers or * action observers. */ export declare function normalizeLegacyActionEnvelope(envelope: CompatibleActionEnvelope): ActionEnvelope; export {};