/**
 * Self-Verification Middleware
 *
 * Implements the "Build & Self-Verify" pattern from harness engineering:
 * - Intercepts agent before completion to remind verification
 * - Tracks file edits to detect potential issues
 * - Injects verification reminders into context
 *
 * Inspired by: https://blog.langchain.com/improving-deep-agents-with-harness-engineering/
 */
export interface FileEditRecord {
    path: string;
    editCount: number;
    lastEditTime: number;
    operations: string[];
}
export interface SelfVerifyConfig {
    /** Max edits to same file before warning (default: 5) */
    maxEditsPerFile: number;
    /** Enable pre-completion verification check (default: true) */
    enablePreCompletionCheck: boolean;
    /** Min turns before triggering verification reminder (default: 3) */
    minTurnsForVerification: number;
    /** Reset counters on successful verification (default: true) */
    resetOnVerification: boolean;
}
/**
 * Tracks file modifications and provides verification guidance
 */
export declare class SelfVerifyMiddleware {
    private fileEdits;
    private config;
    private turnCount;
    private verificationRequested;
    private lastVerificationPrompt;
    constructor(config?: Partial<SelfVerifyConfig>);
    /**
     * Record a file edit operation
     */
    recordEdit(filePath: string, operation: 'write' | 'edit' | 'shell'): void;
    /**
     * Get edit count for a specific file
     */
    getEditCount(filePath: string): number;
    /**
     * Check if any file has excessive edits (potential doom loop)
     */
    hasExcessiveEdits(): {
        file: string;
        count: number;
    } | null;
    /**
     * Increment turn counter
     */
    onTurnStart(): void;
    /**
     * Reset all tracking (e.g., after successful task completion)
     */
    reset(): void;
    /**
     * Get context injection for system prompt
     * Adds verification guidance based on current state
     */
    getContextInjection(): string;
    /**
     * Check if we should inject verification reminder
     */
    private shouldPromptForVerification;
    /**
     * Mark verification as requested (to avoid spam)
     */
    markVerificationRequested(): void;
    /**
     * Build workflow guidance section
     */
    private buildWorkflowGuidance;
    /**
     * Build warning for excessive file edits (doom loop detection)
     */
    private buildExcessiveEditWarning;
    /**
     * Build pre-completion verification reminder
     */
    private buildPreCompletionReminder;
    /**
     * Get summary of file edits for debugging
     */
    getEditSummary(): {
        totalFiles: number;
        totalEdits: number;
        topFiles: Array<{
            path: string;
            count: number;
        }>;
    };
    /**
     * Update configuration
     */
    setConfig(config: Partial<SelfVerifyConfig>): void;
    /**
     * Get current configuration
     */
    getConfig(): SelfVerifyConfig;
}
