export declare const CONTEXT_OVERFLOW_SIGNATURE = "context_overflow"; /** Host AgentSession performs one overflow compact-and-retry before giving up. */ export declare const MAX_CONTEXT_COMPACTION_RETRIES = 1; export declare const HOST_OVERFLOW_RECOVERY_REASON = "recovering from context overflow"; export interface AssistantErrorMessage { role: string; stopReason?: string; errorMessage?: string; usage?: { input: number; output: number; cacheRead?: number; cacheWrite?: number; }; } export interface ErrorRecoveryCounters { signature: string | null; transientAttempts: number; compactionAttempts: number; } export declare function createErrorRecoveryCounters(): ErrorRecoveryCounters; export declare function isErrorAssistantMessage(message: AssistantErrorMessage): boolean; export declare function isSuccessfulAssistantTurn(message: AssistantErrorMessage): boolean; export declare function isAssistantContextOverflow(message: AssistantErrorMessage, contextWindow: number): boolean; export declare function isContextOverflowError(errorMessage: string | undefined): boolean; export declare function isProviderLimitError(errorMessage: string | undefined): boolean; /** * Mirrors the current Pi host AgentSession retryable-error classification for transient provider failures. * Context overflow is not transient retryable because host compaction handles that path. * Terminal quota, billing, and provider-limit errors are not retryable even when they contain 429 or rate-limit wording. */ export declare function isRetryableTransientError(errorMessage: string | undefined): boolean; export declare function failureSignature(errorMessage: string | undefined): string; /** Resets transient retry counters when the failure signature changes; overflow compaction attempts are independent. */ export declare function countersForFailureSignature(counters: ErrorRecoveryCounters, signature: string): ErrorRecoveryCounters; export type RecoveryAttention = { kind: "pending"; reason: string; } | { kind: "paused"; reason: string; }; export declare function createRecoveryPendingAttention(reason: string): RecoveryAttention; export declare function createRecoveryPausedAttention(reason: string): RecoveryAttention; export declare function recoveryPendingAttentionMessage(reason: string): string; export declare function recoveryPausedAttentionMessage(reason: string): string; export declare function formatRecoveryAttention(attention: RecoveryAttention | null): string | null; export declare function isRecoveryPendingAttention(attention: RecoveryAttention | null): attention is Extract; export declare function reasonFromRecoveryPendingAttention(attention: RecoveryAttention | null): string | null; /** Paused goals use /goal resume guidance in footer attention copy. */ export declare function recoveryAttentionMessage(reason: string): string; //# sourceMappingURL=recovery.d.ts.map