/**
 * File-path recognition for explore queries.
 *
 * Agents routinely name files by path in a `codegraph_explore` query —
 * "the scroll logic in src/routes/m/projects/[id]/runs/[runId]/+page.svelte" —
 * and until this module existed those spans were SHREDDED by the downstream
 * tokenizers instead of being read as file references:
 *
 *   - the named-symbol seeder splits on `[\s,()[\]]+`, so SvelteKit/Next
 *     bracketed segments (`[id]`, `[runId]`) and route groups (`(protected)`)
 *     exploded the path into fragments; the identifier-shaped survivors
 *     (`runId`, `scope`) then seeded as "symbols the agent named" and
 *     headlined the blast radius;
 *   - FTS saw the fragments (`page`, `chat`, `runs`) and admitted every
 *     sibling `+page.svelte` in the repo, which ate the output envelope and
 *     truncated the files the agent actually asked for.
 *
 * `extractQueryPaths` finds path-like spans — slashed paths, dotted basenames,
 * and extension-less kebab basenames (`background-image-table`, the spelling
 * import paths and prose actually use) — resolves them against the INDEXED
 * file list (resolution IS the detector — `and/or`, `gen_server:call/2`,
 * `non-blocking` and other path-shaped non-paths match nothing and are left
 * alone), and returns the matches as pinned files plus the query with those
 * spans removed.
 * Callers treat pinned files as first-class: guaranteed admission, top rank,
 * funded first. Pure string work — no DB, no fs — so it is trivially testable
 * and safe inside the query-pool workers. The one question string shape cannot
 * answer (is this dotless slashed span, `scripts/deploy`, a real file that is
 * merely unindexed, or is it prose like `and/or`?) is delegated to an OPTIONAL
 * `existsOnDisk` predicate the caller injects — the fs access stays at the call
 * site, which owns the project root, and this module stays pure.
 */
export interface QueryPathExtraction {
    /** The query with resolved/clearly-path spans removed, whitespace-joined. */
    strippedQuery: string;
    /** Indexed file paths the query named, appearance-ordered, deduped. */
    pinnedFiles: string[];
    /**
     * Spans that are unambiguously path-shaped but resolved to nothing (stale
     * path, unindexed file) or to too many files (bare `+page.svelte`). Stripped
     * from the query — their fragments could only mint junk matches — and
     * surfaced to the agent so the miss is visible instead of silent.
     */
    unresolvedPathSpans: string[];
    /**
     * Line spans the query anchored to a pinned file, 1-based and inclusive:
     * `compiler.py:776`, `foo.ts:12-40`, `foo.ts#L88-L120`, or prose next to a
     * path (`compiler.py lines 900-1003`, `L900-L1003 of compiler.py`). An agent
     * writes these when it wants THOSE lines — typically the body a previous
     * response elided — so a pin that drops them answers a different question
     * (the file's most relevant clusters) than the one asked. Only a span whose
     * path resolved to exactly one file is kept: a line number means nothing
     * across two candidate files.
     */
    lineAnchors: QueryLineAnchor[];
    /**
     * Files a span matched but did NOT pin: the span named several files, some
     * of which define a symbol the query also names, and these define none.
     * Surfaced so a set-aside file is visible, not silently dropped.
     */
    setAsideMatches: QuerySetAsideMatch[];
}
export interface QuerySetAsideMatch {
    /** The span as the query wrote it, normalized (`editorOptions.ts`). */
    span: string;
    files: string[];
}
export interface QueryLineAnchor {
    file: string;
    start: number;
    end: number;
}
/**
 * Cheap pre-gate so callers only fetch the indexed file list when the query
 * could possibly contain a path: a slash, a dot-extension-shaped tail
 * (`chat-manager.ts`), or a hyphen-joined word (`background-image-table` —
 * kebab files are named WITHOUT their extension more often than with, so the
 * shape must open the gate on its own). Extensions cap at 8 chars, which
 * keeps `Class.method` spans (`app.isPackaged`) from qualifying; the kebab
 * alternative requires clean non-word boundaries, which keeps `--flags` and
 * snake_case-with-a-dash hybrids from firing it.
 */
export declare function queryMightContainPaths(query: string): boolean;
export declare function extractQueryPaths(query: string, indexedPaths: readonly string[], opts?: {
    maxPins?: number;
    maxMatchesPerSpan?: number;
    /**
     * Does this repo-relative span name a real FILE in the project? Optional,
     * injected by the caller (see the module docstring): it is the only way to
     * tell a dotless path the index simply doesn't hold (`scripts/deploy`)
     * from slashed prose (`and/or`), and it must stay out of this module.
     * Must not throw — the caller absorbs fs errors and returns false.
     */
    existsOnDisk?: (relPath: string) => boolean;
    /**
     * Which indexed files define a symbol spelled like this query token
     * (`clampedInt`, `SQLCompiler.as_sql`)? Optional, injected by the caller
     * for the same reason as `existsOnDisk`: the answer lives in the index,
     * and this module stays DB-free. Consulted only when a span matches
     * several files (a basename two directories share): the matches that
     * define a symbol the query also names are pinned, the rest set aside.
     * Must not throw — the caller absorbs lookup errors and returns nothing.
     */
    symbolFiles?: (symbol: string) => Iterable<string>;
}): QueryPathExtraction;
//# sourceMappingURL=query-paths.d.ts.map