/**
 * History Manager for CLI commands
 *
 * Inspired by mistral-vibe's history_manager.py that provides:
 * - Command history navigation with up/down arrows
 * - Prefix filtering for quick command recall
 * - Persistent storage in JSON format
 * - Duplicate prevention
 */
export interface HistoryManagerConfig {
    /** Maximum number of history entries to store */
    maxEntries: number;
    /** Path to history file */
    historyFile: string;
    /** Prefixes to exclude from history (e.g., '/') */
    excludePrefixes: string[];
    /** Whether to include slash commands in history */
    includeSlashCommands: boolean;
}
/** State for reverse search (Ctrl+R) */
export interface ReverseSearchState {
    /** Whether reverse search mode is active */
    active: boolean;
    /** Current search query */
    query: string;
    /** Current match index (0 = most recent match) */
    matchIndex: number;
    /** Cached matching entries */
    matches: HistoryEntry[];
    /** Original input before entering search mode */
    originalInput: string;
}
export interface HistoryEntry {
    /** The command text */
    text: string;
    /** Timestamp when command was added */
    timestamp: number;
}
/**
 * Manages command history with prefix filtering and navigation
 */
export declare class HistoryManager {
    private config;
    private history;
    private navigationIndex;
    private temporaryInput;
    private currentPrefix;
    private reverseSearchState;
    static readonly DEFAULT_CONFIG: HistoryManagerConfig;
    constructor(config?: Partial<HistoryManagerConfig>);
    /**
     * Load history from file
     */
    private loadHistory;
    /**
     * Save history to file
     */
    private saveHistory;
    /**
     * Add a new entry to history
     * @param text - The command text to add
     * @returns true if added, false if excluded or duplicate
     */
    add(text: string): boolean;
    /**
     * Get the previous entry in history (navigate up)
     * @param currentInput - The current input text (saved for restoration)
     * @param prefix - Optional prefix to filter by
     * @returns The previous matching history entry, or currentInput if at start
     */
    getPrevious(currentInput: string, prefix?: string): string;
    /**
     * Get the next entry in history (navigate down)
     * @param prefix - Optional prefix to filter by
     * @returns The next matching history entry, or the temporary input
     */
    getNext(prefix?: string): string;
    /**
     * Get history filtered by prefix
     */
    private getFilteredHistory;
    /**
     * Reset navigation state
     */
    resetNavigation(): void;
    /**
     * Search history for entries containing a query
     * @param query - The search query
     * @param limit - Maximum number of results
     * @returns Matching history entries (most recent first)
     */
    search(query: string, limit?: number): HistoryEntry[];
    /**
     * Get all history entries
     */
    getAll(): HistoryEntry[];
    /**
     * Get recent history entries
     */
    getRecent(limit?: number): HistoryEntry[];
    /**
     * Clear all history
     */
    clear(): void;
    /**
     * Get current navigation index (for debugging)
     */
    getNavigationIndex(): number;
    /**
     * Get history count
     */
    get count(): number;
    /**
     * Get auto-completion suggestions based on input prefix
     * @param prefix - The current input to complete
     * @param limit - Maximum number of suggestions
     * @returns Array of matching history entries, scored by relevance
     */
    getSuggestions(prefix: string, limit?: number): string[];
    /**
     * Get the best single completion for inline suggestion
     * @param prefix - The current input
     * @returns The best matching completion or null
     */
    getInlineCompletion(prefix: string): string | null;
    /**
     * Get frequently used commands
     * @param limit - Maximum number of results
     * @returns Most frequently used commands
     */
    getFrequent(limit?: number): Array<{
        text: string;
        count: number;
    }>;
    /**
     * Start reverse search mode
     * @param currentInput - Current input to save for restoration
     */
    startReverseSearch(currentInput: string): void;
    /**
     * Check if reverse search is active
     */
    isReverseSearchActive(): boolean;
    /**
     * Get the current reverse search state
     */
    getReverseSearchState(): ReverseSearchState;
    /**
     * Update the reverse search query and find matches
     * @param query - The search query
     * @returns The best matching entry or null
     */
    updateReverseSearch(query: string): HistoryEntry | null;
    /**
     * Navigate to the next match in reverse search (older)
     * @returns The next matching entry or null
     */
    reverseSearchNext(): HistoryEntry | null;
    /**
     * Navigate to the previous match in reverse search (newer)
     * @returns The previous matching entry or null
     */
    reverseSearchPrev(): HistoryEntry | null;
    /**
     * Accept the current reverse search match
     * @returns The selected entry text or original input if no match
     */
    acceptReverseSearch(): string;
    /**
     * Cancel reverse search and restore original input
     * @returns The original input before search started
     */
    cancelReverseSearch(): string;
    /**
     * Get formatted display for reverse search prompt
     * @returns Formatted string showing search state
     */
    formatReverseSearchPrompt(): string;
    /**
     * Format history list for display
     * @param limit - Maximum entries to show
     * @param showTimestamp - Whether to show timestamps
     * @returns Formatted history string
     */
    formatHistoryList(limit?: number, showTimestamp?: boolean): string;
    /**
     * Get the configured maximum entries
     */
    getMaxEntries(): number;
    /**
     * Set the maximum number of entries
     * @param max - New maximum (will trim history if needed)
     */
    setMaxEntries(max: number): void;
}
/**
 * Get the global history manager instance
 */
export declare function getHistoryManager(): HistoryManager;
/**
 * Create a new history manager with custom config
 */
export declare function createHistoryManager(config: Partial<HistoryManagerConfig>): HistoryManager;
