import type { ToolboxTool } from "./Tool.js";
/**
 * A single search result with its relevance score and match source.
 */
export interface SearchResult {
    tool: ToolboxTool;
    /** Relevance score where lower is better (0 = exact name match). */
    score: number;
    /** Which field produced the best match for this tool. */
    matchedOn: "name" | "description" | "searchHint" | "alias";
}
/**
 * Stateless keyword search engine with TF-IDF-style scoring for ToolboxTool
 * arrays. All state comes from the `tools` parameter -- the class holds no
 * mutable data between calls.
 *
 * Scoring algorithm (lower is better):
 *  1. Exact tool name match                        -> 0
 *  2. Tool name contains a query keyword            -> 10
 *  3. Alias matches a query keyword                 -> 15
 *  4. searchHint contains a keyword                 -> 20  (minus 2 per extra match)
 *  5. Description contains a keyword                -> 30  (minus 2 per extra match)
 *  6. Multiple keyword matches further reduce score
 */
export declare class ToolSearchEngine {
    /**
     * Search tools by keyword query.
     *
     * @param tools  - The full tool collection to search against.
     * @param query  - Free-text query (split on whitespace into keywords).
     * @param limit  - Maximum number of results (default 10).
     * @returns Results sorted by relevance (best first, lowest score).
     */
    search(tools: ToolboxTool[], query: string, limit?: number): SearchResult[];
    /**
     * Direct select: find tools by exact name.
     *
     * Supports comma-separated names (the `select:Read,Edit,Grep` pattern).
     * The `select:` prefix is stripped automatically if present.
     *
     * @param tools - The full tool collection.
     * @param names - Comma-separated tool names, optionally prefixed with `select:`.
     * @returns Matched tools in the order they were requested (missing names are skipped).
     */
    selectByName(tools: ToolboxTool[], names: string): ToolboxTool[];
    /**
     * Tokenize a query string into lowercase keywords, filtering out tokens
     * shorter than {@link MIN_TOKEN_LENGTH} characters.
     */
    private tokenize;
    /**
     * Score a single tool against the given keywords.
     *
     * Returns `null` when no keyword matches any searchable field,
     * meaning the tool should be excluded from results entirely.
     */
    private scoreTool;
    private levenshtein;
}
