import { z } from 'zod';
import { type CodeEdge, type CodebaseIndex } from './types.js';
export declare const CODE_MODULE_CLUSTERS_VERSION: 1;
export declare const CODE_MODULE_CLUSTER_DEFAULT_LIMIT = 100;
export declare const CODE_MODULE_CLUSTER_HARD_LIMIT = 1000;
export declare const CODE_MODULE_CLUSTER_DEFAULT_MAX_MEMBERS = 500;
export declare const CODE_MODULE_CLUSTER_HARD_MAX_MEMBERS = 10000;
export declare const CODE_MODULE_CLUSTER_DEFAULT_MAX_ENTRY_POINTS = 50;
export declare const CODE_MODULE_CLUSTER_HARD_MAX_ENTRY_POINTS = 1000;
export declare const CODE_MODULE_CLUSTER_DEFAULT_MAX_DEPENDENCIES = 100;
export declare const CODE_MODULE_CLUSTER_HARD_MAX_DEPENDENCIES = 1000;
export declare const CODE_MODULE_CLUSTER_LABEL_PROPAGATION_PASSES = 10;
export declare const CODE_MODULE_CLUSTER_EVIDENCE_DETAIL_LIMIT = 50;
export declare const CodeModuleClusterOptionsSchema: z.ZodObject<{
    limit: z.ZodOptional<z.ZodNumber>;
    maxMembers: z.ZodOptional<z.ZodNumber>;
    maxEntryPoints: z.ZodOptional<z.ZodNumber>;
    maxDependencies: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
export type CodeModuleClusterOptions = z.infer<typeof CodeModuleClusterOptionsSchema>;
export declare const CodeModuleClusterEntryPointSchema: z.ZodObject<{
    nodeId: z.ZodString;
    name: z.ZodString;
    kind: z.ZodEnum<{
        function: "function";
        file: "file";
        enum: "enum";
        module: "module";
        class: "class";
        interface: "interface";
        "type-alias": "type-alias";
        variable: "variable";
        parameter: "parameter";
    }>;
    relativePath: z.ZodString;
    span: z.ZodObject<{
        version: z.ZodLiteral<1>;
        offsetEncoding: z.ZodLiteral<"utf8-bytes">;
        endExclusive: z.ZodLiteral<true>;
        startLine: z.ZodNumber;
        startColumn: z.ZodOptional<z.ZodNumber>;
        endLine: z.ZodNumber;
        endColumn: z.ZodOptional<z.ZodNumber>;
        startByte: z.ZodOptional<z.ZodNumber>;
        endByte: z.ZodOptional<z.ZodNumber>;
        exact: z.ZodBoolean;
    }, z.core.$strip>;
}, z.core.$strip>;
export type CodeModuleClusterEntryPoint = z.infer<typeof CodeModuleClusterEntryPointSchema>;
export declare const CodeModuleClusterDependencySchema: z.ZodObject<{
    toClusterId: z.ZodString;
    importCount: z.ZodNumber;
}, z.core.$strip>;
export type CodeModuleClusterDependency = z.infer<typeof CodeModuleClusterDependencySchema>;
export declare const CodeModuleClusterSchema: z.ZodObject<{
    id: z.ZodString;
    label: z.ZodString;
    keywords: z.ZodArray<z.ZodString>;
    size: z.ZodNumber;
    cohesion: z.ZodNumber;
    members: z.ZodArray<z.ZodString>;
    entryPoints: z.ZodArray<z.ZodObject<{
        nodeId: z.ZodString;
        name: z.ZodString;
        kind: z.ZodEnum<{
            function: "function";
            file: "file";
            enum: "enum";
            module: "module";
            class: "class";
            interface: "interface";
            "type-alias": "type-alias";
            variable: "variable";
            parameter: "parameter";
        }>;
        relativePath: z.ZodString;
        span: z.ZodObject<{
            version: z.ZodLiteral<1>;
            offsetEncoding: z.ZodLiteral<"utf8-bytes">;
            endExclusive: z.ZodLiteral<true>;
            startLine: z.ZodNumber;
            startColumn: z.ZodOptional<z.ZodNumber>;
            endLine: z.ZodNumber;
            endColumn: z.ZodOptional<z.ZodNumber>;
            startByte: z.ZodOptional<z.ZodNumber>;
            endByte: z.ZodOptional<z.ZodNumber>;
            exact: z.ZodBoolean;
        }, z.core.$strip>;
    }, z.core.$strip>>;
    dependencies: z.ZodArray<z.ZodObject<{
        toClusterId: z.ZodString;
        importCount: z.ZodNumber;
    }, z.core.$strip>>;
    truncated: z.ZodBoolean;
    omitted: z.ZodObject<{
        members: z.ZodNumber;
        entryPoints: z.ZodNumber;
        dependencies: z.ZodNumber;
    }, z.core.$strip>;
}, z.core.$strip>;
export type CodeModuleCluster = z.infer<typeof CodeModuleClusterSchema>;
export declare const CodeModuleClusterResultSchema: z.ZodObject<{
    status: z.ZodLiteral<"resolved">;
    version: z.ZodLiteral<1>;
    clusters: z.ZodArray<z.ZodObject<{
        id: z.ZodString;
        label: z.ZodString;
        keywords: z.ZodArray<z.ZodString>;
        size: z.ZodNumber;
        cohesion: z.ZodNumber;
        members: z.ZodArray<z.ZodString>;
        entryPoints: z.ZodArray<z.ZodObject<{
            nodeId: z.ZodString;
            name: z.ZodString;
            kind: z.ZodEnum<{
                function: "function";
                file: "file";
                enum: "enum";
                module: "module";
                class: "class";
                interface: "interface";
                "type-alias": "type-alias";
                variable: "variable";
                parameter: "parameter";
            }>;
            relativePath: z.ZodString;
            span: z.ZodObject<{
                version: z.ZodLiteral<1>;
                offsetEncoding: z.ZodLiteral<"utf8-bytes">;
                endExclusive: z.ZodLiteral<true>;
                startLine: z.ZodNumber;
                startColumn: z.ZodOptional<z.ZodNumber>;
                endLine: z.ZodNumber;
                endColumn: z.ZodOptional<z.ZodNumber>;
                startByte: z.ZodOptional<z.ZodNumber>;
                endByte: z.ZodOptional<z.ZodNumber>;
                exact: z.ZodBoolean;
            }, z.core.$strip>;
        }, z.core.$strip>>;
        dependencies: z.ZodArray<z.ZodObject<{
            toClusterId: z.ZodString;
            importCount: z.ZodNumber;
        }, z.core.$strip>>;
        truncated: z.ZodBoolean;
        omitted: z.ZodObject<{
            members: z.ZodNumber;
            entryPoints: z.ZodNumber;
            dependencies: z.ZodNumber;
        }, z.core.$strip>;
    }, z.core.$strip>>;
    total: z.ZodNumber;
    omitted: z.ZodNumber;
    truncated: z.ZodBoolean;
    unclusteredFiles: z.ZodNumber;
    honesty: z.ZodObject<{
        freshness: z.ZodLiteral<"index-snapshot">;
        stalenessReason: z.ZodString;
        coverage: z.ZodObject<{
            status: z.ZodEnum<{
                full: "full";
                partial: "partial";
            }>;
            indexedFiles: z.ZodNumber;
            clusteredFiles: z.ZodNumber;
            unclusteredFiles: z.ZodNumber;
            skippedFiles: z.ZodNumber;
            budgetDroppedFiles: z.ZodNumber;
            parserGapFiles: z.ZodNumber;
            importGapFiles: z.ZodNumber;
            resolvedLocalImports: z.ZodNumber;
            uniqueLocalImportEdges: z.ZodNumber;
            unreachableImportEndpoints: z.ZodNumber;
            unresolvedImports: z.ZodNumber;
            externalImports: z.ZodNumber;
            unclusteredDependencyEdges: z.ZodNumber;
        }, z.core.$strip>;
        evidenceGaps: z.ZodObject<{
            skippedFiles: z.ZodArray<z.ZodObject<{
                path: z.ZodString;
                relativePath: z.ZodString;
                reason: z.ZodString;
            }, z.core.$strip>>;
            skippedFilesOmitted: z.ZodNumber;
            parserGapPaths: z.ZodArray<z.ZodString>;
            parserGapPathsOmitted: z.ZodNumber;
            importGapPaths: z.ZodArray<z.ZodString>;
            importGapPathsOmitted: z.ZodNumber;
        }, z.core.$strip>;
        omissions: z.ZodObject<{
            clusters: z.ZodNumber;
            members: z.ZodNumber;
            entryPoints: z.ZodNumber;
            dependencies: z.ZodNumber;
        }, z.core.$strip>;
        bounds: z.ZodObject<{
            maxClusters: z.ZodNumber;
            maxMembers: z.ZodNumber;
            maxEntryPoints: z.ZodNumber;
            maxDependencies: z.ZodNumber;
            propagationPasses: z.ZodLiteral<10>;
        }, z.core.$strip>;
    }, z.core.$strip>;
}, z.core.$strip>;
export type CodeModuleClusterResult = z.infer<typeof CodeModuleClusterResultSchema>;
interface ResolvedLocalImport {
    from: string;
    to: string;
    edge: CodeEdge;
}
interface FullModuleCluster {
    id: string;
    members: readonly string[];
}
/** Full, unbounded assignment reused by flow tracing before either surface truncates presentation. */
export interface CodeModuleClusterAssignment {
    clusters: readonly FullModuleCluster[];
    clusterIdByPath: ReadonlyMap<string, string>;
    resolvedLocalImports: readonly ResolvedLocalImport[];
    uniqueUndirectedEdges: readonly (readonly [string, string])[];
    pathByIndexPath: ReadonlyMap<string, string>;
    unreachableImportEndpoints: number;
}
/** Deterministic asynchronous label propagation over the undirected local-import graph. */
export declare function buildCodeModuleClusterAssignment(index: CodebaseIndex): CodeModuleClusterAssignment;
/** Cluster checkout modules from resolved local imports with deterministic, bounded output. */
export declare function clusterCodeModules(index: CodebaseIndex, rawOptions?: CodeModuleClusterOptions): CodeModuleClusterResult;
export {};
