import { z } from 'zod';
import { type TokenizerName } from '../tokens.js';
import type { CodebaseIndex, CodeNode, CodeSourceCandidate } from './types.js';
export declare const CodeDocKindSchema: z.ZodEnum<{
    function: "function";
    enum: "enum";
    class: "class";
    interface: "interface";
    "type-alias": "type-alias";
    variable: "variable";
}>;
export declare const CodeDocQuerySchema: z.ZodUnion<readonly [z.ZodObject<{
    nodeId: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
    name: z.ZodString;
    relativePath: z.ZodOptional<z.ZodString>;
    kind: z.ZodOptional<z.ZodEnum<{
        function: "function";
        enum: "enum";
        class: "class";
        interface: "interface";
        "type-alias": "type-alias";
        variable: "variable";
    }>>;
    containerName: z.ZodOptional<z.ZodString>;
}, z.core.$strip>]>;
export type CodeDocQuery = z.infer<typeof CodeDocQuerySchema>;
export interface ReadCodeDocsOptions {
    tokenizer?: TokenizerName;
    countTokens?: (text: string) => number;
}
export interface CodeDocHonesty {
    freshness: 'mixed-index-and-working-tree';
    stalenessReason: string;
    truncation: {
        truncated: false;
    };
    coverage: {
        candidatesConsidered: number;
        symbolsMatched: number;
        fullSourceRead: boolean;
    };
    ambiguityCount: number;
}
interface CodeDocBase {
    query?: CodeDocQuery;
    honesty: CodeDocHonesty;
}
export type CodeDocResult = (CodeDocBase & {
    status: 'resolved';
    query: CodeDocQuery;
    nodeId: string;
    name: string;
    type: CodeNode['type'];
    path: string;
    relativePath: string;
    line: number;
    endLine: number;
    containerName?: string;
    signature: string;
    params: string[];
    docComment?: string;
    bodyTokens: number;
    tokenizer: string;
    bodySpanExact: boolean;
}) | (CodeDocBase & {
    status: 'not_found' | 'ambiguous';
    query: CodeDocQuery;
    candidates: CodeSourceCandidate[];
    message: string;
}) | (CodeDocBase & {
    status: 'unsupported';
    query: CodeDocQuery;
    candidate: CodeSourceCandidate;
    message: string;
}) | (CodeDocBase & {
    status: 'error';
    message: string;
});
export interface CodeDocHonestyDelta {
    freshness?: CodeDocHonesty['freshness'];
    stalenessReason?: string;
    truncation?: CodeDocHonesty['truncation'];
    coverage?: Partial<CodeDocHonesty['coverage']>;
    ambiguityCount?: number;
}
type CompactResult<T> = T extends CodeDocResult ? Omit<T, 'honesty'> & {
    honestyDelta?: CodeDocHonestyDelta;
} : never;
export type CompactCodeDocResult = CompactResult<CodeDocResult>;
export interface CodeDocHonestyEnvelope {
    honesty: CodeDocHonesty;
    results: CompactCodeDocResult[];
}
/** Merge an envelope baseline with one result's optional honesty delta. */
export declare function mergeCodeDocHonesty(base: CodeDocHonesty, delta: CodeDocHonestyDelta | undefined): CodeDocHonesty;
/**
 * Hoist the modal effective honesty value into one batch envelope. Positional
 * ties keep the first observed value, and every differing result carries the
 * exact delta required to reconstruct its original effective honesty.
 */
export declare function compactCodeDocHonesty(results: readonly CodeDocResult[]): CodeDocHonestyEnvelope;
/**
 * Read symbol contracts in a positionally aligned batch. Source is reread only
 * to derive the contract and body price; no result contains the body itself.
 */
export declare function readCodeDocs(index: CodebaseIndex, queries: readonly CodeDocQuery[], options?: ReadCodeDocsOptions): Promise<CodeDocResult[]>;
export {};
