import type { CallChain, ClassTreeAnalysis, CodebaseIndex, CodeCommandPayload, CodeEdge, CodeNodeType, CodeSearchResult, ContentMatch, DependencyAnalysis, ParsedFile, RelationMatch } from './types.js';
export declare function createPayload(index: CodebaseIndex, query: Record<string, unknown>, results: unknown): CodeCommandPayload;
export declare function findByName(index: CodebaseIndex, name: string, type?: CodeNodeType, file?: string, limit?: number): CodeSearchResult[];
export declare function findByPattern(index: CodebaseIndex, pattern: string, type?: CodeNodeType, limit?: number): CodeSearchResult[];
export declare function findByType(index: CodebaseIndex, type: CodeNodeType, limit?: number): CodeSearchResult[];
export declare function findContent(index: CodebaseIndex, text: string, limit?: number): ContentMatch[];
export declare function analyzeCalls(index: CodebaseIndex, functionName: string, file?: string): RelationMatch[];
export declare function analyzeCallers(index: CodebaseIndex, functionName: string, file?: string): RelationMatch[];
export declare function analyzeCallChain(index: CodebaseIndex, fromName: string, toName: string, depth?: number, fromFile?: string, toFile?: string): CallChain[];
export declare function analyzeDeps(index: CodebaseIndex, target: string): DependencyAnalysis;
export declare function analyzeTree(index: CodebaseIndex, className: string, file?: string): ClassTreeAnalysis | null;
export interface ModuleCoupling {
    module: string;
    publicSymbolCount: number;
    afferentCoupling: number;
    efferentCoupling: number;
    instability: number;
    topImporters: string[];
    topDependencies: string[];
    keyClasses: Array<{
        name: string;
        parents: string[];
        childCount: number;
        methodCount: number;
    }>;
}
export declare function analyzeModuleCoupling(index: CodebaseIndex, modulePath: string): ModuleCoupling;
export interface ModuleSummaryOptions {
    maxClasses?: number;
    maxFunctions?: number;
    maxEdges?: number;
}
export interface ModuleSummary {
    module: string;
    coupling: ModuleCoupling;
    keyClasses: ModuleCoupling['keyClasses'];
    keyFunctions: Array<{
        name: string;
        relativePath?: string;
        line?: number;
        signature?: string;
        exported: boolean;
        outgoingCalls: number;
        incomingCalls: number;
    }>;
    importEdges: Array<{
        from: string;
        to?: string;
        specifier?: string;
        status: CodeEdge['status'];
    }>;
    exportedApi: Array<{
        name: string;
        type: CodeNodeType;
        relativePath?: string;
        line?: number;
        signature?: string;
    }>;
}
export type MermaidKind = 'import-graph' | 'class-hierarchy' | 'call-graph';
export interface MermaidOptions {
    maxEdges?: number;
    maxNodes?: number;
}
export declare function summarizeModule(index: CodebaseIndex, modulePath: string, options?: ModuleSummaryOptions): ModuleSummary;
export declare function toMermaid(index: CodebaseIndex, kind: MermaidKind, target: string, options?: MermaidOptions): string;
export interface FusedSearchResult {
    nodeId: string;
    path: string;
    relativePath?: string;
    name: string;
    type: CodeNodeType;
    line?: number;
    excerpt?: string;
    signature?: string;
    containerName?: string;
    language?: string;
    score: number;
    sources: Array<{
        method: string;
        rank: number;
    }>;
}
export interface FusedSearchOptions {
    weights?: {
        name?: number;
        pattern?: number;
        content?: number;
    };
    limit?: number;
}
/** Fused search: runs name, pattern, and content search, merges via Reciprocal Rank Fusion */
export declare function fusedSearch(index: CodebaseIndex, query: string, options?: FusedSearchOptions): FusedSearchResult[];
export interface KeySection {
    content: string;
    startLine: number;
    endLine: number;
    reason: string;
}
/** Select the most architecturally significant portion of a file */
export declare function extractKeySection(file: ParsedFile, maxChars: number): KeySection;
