export interface PMFailureRecord { context: string; message: string; timestamp: number; count: number; } export interface PMStatusReport { pm_lite_healthy: boolean; pm_full_healthy: boolean; failure_count: number; recent_failures: PMFailureRecord[]; uptime_ms: number; } export declare class PMDiagnosticsTracker { private readonly failures; private readonly startTime; /** * Record a PM subsystem failure. Subsequent failures for the same context * increment the count rather than creating duplicate entries. */ recordFailure(context: string, message: string): void; /** * Return a status report summarising PM subsystem health. * pm_lite_healthy = no context has failed 3+ times * pm_full_healthy = zero failures */ getStatus(): PMStatusReport; /** Reset all tracked failures (e.g. after a PM mode toggle). */ reset(): void; } /** * Execute a PM operation safely inside an isolation boundary. * * On success: returns the operation result. * On any error: * - Logs with [Engram/PM] prefix to console.error (never console.log). * - Records the failure in the tracker when one is provided. * - Returns the fallback value silently. * * @param operation The PM feature code to run. * @param fallback Safe default to return on failure. * @param context Human-readable label for diagnostic messages. * @param tracker Optional diagnostics tracker; pass `null` when not yet available. */ export declare function pmSafe(operation: () => T, fallback: T, context: string, tracker?: PMDiagnosticsTracker | null): T; //# sourceMappingURL=pm-diagnostics.d.ts.map