import type { CandidateFile, CandidateOmissionReason, EvidenceAtom, EvidenceAtomProvenanceKind } from "@oscharko-dev/keiko-contracts/connected-context";
import type { WorkspaceFs } from "./fs.js";
import { type IgnoreMatcher } from "./ignore.js";
import type { LineMatcher } from "./repoSearchMatchers.js";
import type { DiscoveredFile, WorkspaceInfo } from "./types.js";
export interface ScopeShape {
    readonly workspace: WorkspaceInfo;
    readonly scopeId: string;
    readonly relativePaths: readonly string[];
}
export interface LimitsShape {
    readonly maxFilesScanned: number;
    readonly maxMatchesReturned: number;
    readonly maxBytesPerFileScanned: number;
    readonly elapsedMsMax: number;
}
export interface AtomShape {
    readonly scopeId: string;
    readonly scopePath: string;
    readonly lineRange: {
        readonly startLine: number;
        readonly endLine: number;
    } | undefined;
    readonly provenanceKind: EvidenceAtomProvenanceKind;
    readonly tool: string;
    readonly queryFingerprint: string;
    readonly score: number;
    readonly emittedAtMs: number;
}
export declare function buildAtom(shape: AtomShape): EvidenceAtom;
export declare function buildCandidate(scopePath: string, omitted: CandidateOmissionReason | undefined): CandidateFile;
export interface CandidateSet {
    readonly files: readonly DiscoveredFile[];
    readonly truncated: boolean;
}
export declare function gatherCandidates(scope: ScopeShape, limits: LimitsShape, fs: WorkspaceFs): CandidateSet;
export declare function probeBinary(fs: WorkspaceFs, abs: string, size: number): Promise<boolean>;
export interface SearchTextRunner {
    readonly scope: ScopeShape;
    readonly limits: LimitsShape;
    readonly fs: WorkspaceFs;
    readonly nowMs: () => number;
    readonly startMs: number;
    readonly matcher: LineMatcher;
    readonly ignoreMatcher: IgnoreMatcher;
    readonly fingerprint: string;
}
export interface RunState {
    filesScanned: number;
    matchesReturned: number;
    truncated: boolean;
}
export declare function elapsed(runner: SearchTextRunner): number;
export declare function hitLimit(runner: SearchTextRunner, state: RunState): boolean;
export declare function scanFile(runner: SearchTextRunner, file: DiscoveredFile, state: RunState, atoms: EvidenceAtom[], candidates: CandidateFile[]): Promise<void>;
//# sourceMappingURL=repoSearchScan.d.ts.map