export type OutputFormat = 'count_only' | 'files_only' | 'locations' | 'matches' | 'context' | 'with_stats' | 'with_preview' | 'signatures' | 'full';
export type SymbolKind = 'function' | 'class' | 'interface' | 'type' | 'variable' | 'constant' | 'enum';
export interface QueryBase {
    id: string;
    mode: 'files' | 'content' | 'symbols' | 'references' | 'structural';
    path?: string;
}
export interface FilesQuery extends QueryBase {
    mode: 'files';
    patterns?: string[];
    exclude?: string[];
    min_size?: number;
    max_size?: number;
    modified_after?: string;
    modified_before?: string;
    respect_gitignore?: boolean;
    sort_by?: 'name' | 'size' | 'modified';
    sort_order?: 'asc' | 'desc';
    has_content?: string;
    is_empty?: boolean;
    follow_symlinks?: boolean;
    include_hidden?: boolean;
}
export interface ContentQuery extends QueryBase {
    mode: 'content';
    pattern?: string;
    pattern_base64?: string;
    glob?: string;
    case_sensitive?: boolean;
    whole_word?: boolean;
    multiline?: boolean;
    negate?: boolean;
    ranked?: boolean;
    preview_replace?: string;
    relationships?: boolean;
}
export interface SymbolsQuery extends QueryBase {
    mode: 'symbols';
    query?: string;
    kinds?: SymbolKind[];
    exported_only?: boolean;
    include_private?: boolean;
    group_by?: 'file' | 'kind' | 'none';
}
export interface ReferencesQuery extends QueryBase {
    mode: 'references';
    symbol: string;
    file: string;
    line: number;
    column: number;
}
export interface StructuralQuery extends QueryBase {
    mode: 'structural';
    pattern: string;
    lang?: 'ts' | 'tsx' | 'js' | 'jsx' | 'css' | 'html';
    glob?: string;
}
export type FindQuery = FilesQuery | ContentQuery | SymbolsQuery | ReferencesQuery | StructuralQuery;
export interface OutputOptions {
    format?: OutputFormat;
    context_before?: number;
    context_after?: number;
    expand_to?: 'line' | 'block' | 'function' | 'class';
    max_results?: number;
    max_per_item?: number;
    max_total_matches?: number;
    max_tokens?: number;
    preview_lines?: number;
    max_line_length?: number;
}
export interface FindInput {
    queries: FindQuery[];
    output?: OutputOptions;
    parallel?: boolean;
}
type CountResult = {
    count: number;
    file_count?: number;
    source?: string;
};
type FilesResult = {
    files: string[];
    count: number;
    source?: string;
};
type LocationsResult<TLocation> = {
    locations: TLocation[];
    count: number;
    source?: string;
};
interface CacheKey {
    pattern: string;
    glob: string;
    path: string;
    flags: string;
}
interface CacheValue {
    files: string[];
    matchedFiles: Map<string, {
        content: string;
        matches: ContentMatch[];
    }>;
    totalMatches: number;
    fileMtimes: Map<string, number>;
}
export interface ContentMatch {
    file: string;
    line: number;
    text: string;
    startLine?: number;
    endLine?: number;
    context_before?: string[];
    context_after?: string[];
}
export declare function makeCountResult(count: number, source?: string, fileCount?: number): CountResult;
export declare function makeFilesResult(files: string[], count: number, source?: string): FilesResult;
export declare function makeLocationsResult<TLocation>(locations: TLocation[], count: number, source?: string): LocationsResult<TLocation>;
export declare const VALID_SYMBOL_KINDS: Set<string>;
export declare function isHiddenOrSkippedSegment(segment: string, includeHidden: boolean): boolean;
export declare function shouldSkipRelativePath(relativePath: string, includeHidden: boolean): boolean;
export declare function isBinary(filePath: string): Promise<boolean>;
export declare function collectTextFiles(dirPath: string): Promise<string[]>;
export declare function readTextFile(filePath: string): Promise<string | null>;
export declare function collectGlobFiles(basePath: string, patterns: string[], includeHidden: boolean, followSymlinks: boolean): Promise<Set<string>>;
export declare function matchesGlob(glob: InstanceType<typeof Bun.Glob>, filePath: string, basePath: string): boolean;
export declare function toSymbolKind(kind: string | undefined): SymbolKind;
export declare function matchesSymbolQuery(name: string, queryRegex: RegExp | null): boolean;
export declare function loadFileLines(filePath: string): Promise<string[]>;
export declare function groupByKey<T extends {
    file: string;
    kind: string;
}>(items: T[], groupBy: 'file' | 'kind' | 'none'): Record<string, T[]> | null;
export declare function validateSearchPath(path: string | undefined, projectRoot: string): string | {
    error: string;
};
export declare function buildGitignoreMatcher(gitignorePath: string): ((rel: string) => boolean) | null;
export declare function collectFilesForSearch(basePath: string, queryGlob: string | undefined): Promise<string[]>;
export interface ImportGraphLike {
    findImports(file: string): string[];
    findDependents(file: string): string[];
}
export declare class FindRuntimeService {
    private readonly searchCache;
    private importGraph;
    private importGraphBuiltAt;
    searchCacheGet(key: CacheKey): CacheValue | null;
    searchCacheSet(key: CacheKey, value: CacheValue): void;
    searchCacheIsValid(cached: CacheValue): Promise<boolean>;
    getImportGraph(projectRoot: string): Promise<ImportGraphLike>;
}
export {};
//# sourceMappingURL=shared.d.ts.map