export declare const DEFAULT_STALL_TIMEOUT_MS: number; export declare const STALL_RECOVERY_PROMPT: string; export type StallStatus = 'interrupt_requested' | 'recovery_started' | 'progress_resumed' | 'recovery_completed' | 'blocked_cancel' | 'blocked_recovery' | 'blocked_restall' | 'blocked_persistence' | 'blocked_previous_attempt' | 'blocked_evidence' | 'superseded'; export interface StallDiagnostic { version: 1; kind: 'stall_recovery'; eventId: string; session: string; turn: string; status: StallStatus; evidence: 'adapter_transport' | 'no_progress'; idleMs: number; } export interface StallObservation { sessionId: string; generation: string; turnId: string; startedAt: number; lastProgressAt: number; progressCount: number; transportFailures: number; safe: boolean; boundaryEvidenceAvailable?: boolean; } /** Presence, including an incomplete claim, restores conservative mail policy. */ export declare function hasStallRecoveryClaim(stateDir: string, sessionId: string): boolean; /** ACP has no turn IDs on tool updates. Reuse across turns is ambiguous. */ export declare class StallToolHistory { private readonly turns; private healthy; private readonly directory; private readonly path; private readonly session; constructor(stateDir: string, sessionId: string, resume: boolean); available(): boolean; /** Record before relying on a tool event. False means cancellation is unsafe. */ observe(toolId: string, turnId: string): boolean; private persist; } /** * One durable attempt per ACP session, deliberately stricter than one per turn. * A restarted supervisor never guesses whether cancellation or recovery ran. * Claim files are never reclaimed automatically, including malformed/empty ones. */ export declare class StallWatchdog { private readonly options; private checking; private disabled; private unavailableTurn?; constructor(options: { stateDir: string; timeoutMs: number; previouslyClaimed?: boolean; now(): number; observe(): StallObservation | undefined; recover(observed: StallObservation, report: (status: StallStatus) => void): Promise; diagnostic(event: StallDiagnostic): void; }); tick(): Promise; }