/**
 * Smart Search Tool - Unified intelligent search with CodexLens integration
 *
 * Features:
 * - Fuzzy mode: FTS + ripgrep fusion with RRF ranking (default)
 * - Semantic mode: Dense coarse retrieval + cross-encoder reranking
 * - CodexLens integration (init, dense_rerank, fts)
 * - Ripgrep fallback for exact mode
 * - Index status checking and warnings
 * - Multi-backend search routing with RRF ranking
 *
 * Actions:
 * - init: Initialize CodexLens index
 * - search: Intelligent search with fuzzy (default) or semantic mode
 * - status: Check index status
 * - update: Incremental index update for changed files
 * - watch: Start file watcher for automatic updates
 */
import type { ToolSchema, ToolResult } from '../types/tool.js';
import type { ProgressInfo } from './codex-lens.js';
interface TimingData {
    [key: string]: number;
}
interface ExactMatch {
    file: string;
    line: number;
    column: number;
    content: string;
    matchScore?: number;
    matchCount?: number;
}
interface RelationshipInfo {
    type: string;
    direction: 'outgoing' | 'incoming';
    target?: string;
    source?: string;
    file: string;
    line?: number;
}
interface SemanticMatch {
    file: string;
    score: number;
    content: string;
    symbol: string | null;
    relationships?: RelationshipInfo[];
}
interface GraphMatch {
    file: string;
    symbols: unknown;
    relationships: unknown[];
}
interface FileMatch {
    path: string;
    type: 'file' | 'directory';
    name: string;
    extension?: string;
}
interface PaginationInfo {
    offset: number;
    limit: number;
    total: number;
    has_more: boolean;
}
interface SearchMetadata {
    mode?: string;
    backend?: string;
    count?: number;
    query?: string;
    pattern?: string;
    classified_as?: string;
    confidence?: number;
    reasoning?: string;
    embeddings_coverage_percent?: number;
    warning?: string;
    note?: string;
    index_status?: 'indexed' | 'not_indexed' | 'partial';
    fallback?: string;
    fallback_history?: string[];
    suggested_weights?: Record<string, number>;
    tokens?: string[];
    tokenized?: boolean;
    pagination?: PaginationInfo;
    timing?: TimingData;
    action?: string;
    path?: string;
    progress?: {
        stage: string;
        message: string;
        percent: number;
        filesProcessed?: number;
        totalFiles?: number;
    };
    progressHistory?: ProgressInfo[];
}
interface SearchResult {
    success: boolean;
    results?: ExactMatch[] | SemanticMatch[] | GraphMatch[] | FileMatch[] | unknown;
    extra_files?: string[];
    output?: string;
    metadata?: SearchMetadata;
    error?: string;
    status?: unknown;
    message?: string;
}
/**
 * Query intent used to adapt RRF weights (Python parity).
 *
 * Keep this logic aligned with CodexLens Python hybrid search:
 * `codex-lens/src/codexlens/search/hybrid_search.py`
 */
export type QueryIntent = 'keyword' | 'semantic' | 'mixed';
/**
 * Detect query intent using the same heuristic signals as Python:
 * - Code patterns: `.`, `::`, `->`, CamelCase, snake_case, common code keywords
 * - Natural language patterns: >5 words, question marks, interrogatives, common verbs
 */
export declare function detectQueryIntent(query: string): QueryIntent;
/**
 * Intent → weights mapping (Python parity).
 * - keyword: exact-heavy
 * - semantic: vector-heavy
 * - mixed: keep defaults
 */
export declare function adjustWeightsByIntent(intent: QueryIntent, baseWeights: Record<string, number>): Record<string, number>;
export declare function getRRFWeights(query: string, baseWeights?: Record<string, number>): Record<string, number>;
export declare const schema: ToolSchema;
export declare function handler(params: Record<string, unknown>): Promise<ToolResult<SearchResult>>;
/**
 * Execute init action with external progress callback
 * Used by MCP server for streaming progress
 * @param params - Search parameters (path, languages, force)
 * @param onProgress - Optional callback for progress updates
 */
export declare function executeInitWithProgress(params: Record<string, unknown>, onProgress?: (progress: ProgressInfo) => void): Promise<SearchResult>;
export {};
//# sourceMappingURL=smart-search.d.ts.map