import type { CodebaseIndex, CodeNode, CodeNodeType, CodeSourceCandidate, CodeSourceSpanV1 } from './types.js';
export type { CodeSourceCandidate } from './types.js';
export type ReadCodeSourceQuery = {
    nodeId: string;
} | {
    name: string;
    file?: string;
    type?: CodeNodeType;
};
export interface ReadCodeSourceOptions {
}
export type ReadCodeSourceResult = {
    status: 'resolved';
    nodeId: string;
    name: string;
    type: CodeNodeType;
    path: string;
    relativePath?: string;
    line: number;
    endLine: number;
    span?: CodeSourceSpanV1;
    containerName?: string;
    source: string;
    /** Parser-proved byte-exact declaration/body slice when available. */
    exactSource?: string;
} | {
    status: 'not_found';
    candidates: CodeSourceCandidate[];
    message: string;
} | {
    status: 'ambiguous';
    candidates: CodeSourceCandidate[];
    message: string;
} | {
    status: 'error';
    message: string;
};
export declare function candidateFromNode(node: CodeNode): CodeSourceCandidate;
/**
 * Confine a path to the repository, or say why it does not belong.
 *
 * Returns a message rather than throwing, because every caller — source reads,
 * entity queries, the MCP root guard — treats an escape as a typed refusal to
 * answer rather than as an exception.
 */
export declare function resolveWithinRepo(repoRoot: string, targetPath: string): {
    path: string;
    relativePath: string;
} | string;
/**
 * Candidate matching shared with `hashCodeSymbols` (src/code/hash.ts): returns
 * the matching source nodes, or an error message when the query's file path
 * escapes the repo root. Exported so key-based resolution cannot diverge from
 * `readCodeSource`'s.
 */
export declare function selectByQuery(index: CodebaseIndex, query: ReadCodeSourceQuery): CodeNode[] | string;
export declare function readCodeSource(index: CodebaseIndex, query: ReadCodeSourceQuery, _options?: ReadCodeSourceOptions): Promise<ReadCodeSourceResult>;
