import type { ContentEncoding } from '@codragraph/graphstore';
import type { RepoMeta } from '../storage/repo-manager.js';
export type AnalyzeProfileOption = 'auto' | 'lean' | 'balanced' | 'power';
export type ResolvedAnalyzeProfile = Exclude<AnalyzeProfileOption, 'auto'>;
export type EmbeddingMode = 'auto' | 'off' | 'on';
export type CompressionOption = ContentEncoding | 'auto';
export interface MachineSnapshot {
    platform: NodeJS.Platform;
    arch: NodeJS.Architecture;
    logicalCpus: number;
    availableParallelism: number;
    totalMemoryBytes: number;
    freeMemoryBytes: number;
    heapLimitBytes: number;
    nodeVersion: string;
    httpEmbeddingsConfigured: boolean;
}
export interface AdaptiveAnalyzePlan {
    requestedProfile: AnalyzeProfileOption;
    profile: ResolvedAnalyzeProfile;
    machine: MachineSnapshot;
    compress: ContentEncoding;
    embeddingMode: EmbeddingMode;
    embeddingNodeLimit: number;
    workerPoolSize: number;
    workerSubBatchSize: number;
    reasons: string[];
}
export interface EmbeddingDecision {
    enabled: boolean;
    reason: string;
    limit: number;
}
export declare const parseAnalyzeProfile: (value?: string) => AnalyzeProfileOption;
export declare const parseEmbeddingMode: (value?: string) => EmbeddingMode;
export declare const parseCompressionOption: (value?: string) => CompressionOption;
export declare const detectMachineSnapshot: () => MachineSnapshot;
export declare const resolveAnalyzeProfile: (requested: AnalyzeProfileOption, machine: MachineSnapshot) => ResolvedAnalyzeProfile;
export declare const resolveEmbeddingMode: (embeddingsFlag: boolean | undefined, requestedMode: string | undefined) => EmbeddingMode;
export declare const resolveCompression: (requested: CompressionOption, profile: ResolvedAnalyzeProfile, existingMeta?: Pick<RepoMeta, "compress"> | null) => ContentEncoding;
export declare const embeddingLimitForProfile: (profile: ResolvedAnalyzeProfile, httpEmbeddingsConfigured: boolean) => number;
export declare const workerPlanForProfile: (profile: ResolvedAnalyzeProfile, machine: Pick<MachineSnapshot, "availableParallelism">) => Pick<AdaptiveAnalyzePlan, "workerPoolSize" | "workerSubBatchSize">;
export declare const resolveAdaptiveAnalyzePlan: (input: {
    profile?: string;
    embeddingMode?: string;
    embeddings?: boolean;
    compress?: string;
    existingMeta?: Pick<RepoMeta, "compress"> | null;
    machine?: MachineSnapshot;
}) => AdaptiveAnalyzePlan;
export declare const decideEmbeddingRun: (plan: Pick<AdaptiveAnalyzePlan, "embeddingMode" | "embeddingNodeLimit" | "profile" | "machine">, stats?: Pick<NonNullable<RepoMeta["stats"]>, "nodes" | "embeddings">) => EmbeddingDecision;
export declare const formatAdaptiveAnalyzePlan: (plan: AdaptiveAnalyzePlan) => string;
