import type { MeasuredUsageState } from "./token-intelligence.js";
export type EstimationMethod = "rough estimate (chars/4 heuristic)";
export interface TokenEstimate {
    selectedTokens: number;
    fullRepoTokens: number;
    savingsPercent: number;
    estimationMethod: EstimationMethod;
    estimateNote: string;
    fileBreakdown: Array<{
        file: string;
        tokens: number;
        selected: boolean;
    }>;
    directoryBreakdown: Array<{
        directory: string;
        tokens: number;
        fileCount: number;
        selectedTokens: number;
        selectedFileCount: number;
    }>;
    wastedFiles: WastedFileReport;
    heavyDirectories: HeavyDirectoryReport;
    tokenBreakdown: TokenBreakdownState;
    measuredUsage: MeasuredUsageState;
}
export interface WastedFileReport {
    files: Array<{
        file: string;
        tokens: number;
        reason: string;
    }>;
    totalWastedTokens: number;
    removalSavingsPercent: number;
}
export interface HeavyDirectoryReport {
    directories: Array<{
        directory: string;
        tokens: number;
        fileCount: number;
        percentOfRepo: number;
        suggestion: string;
    }>;
}
export interface TokenUsageState {
    artifactType: "kiwi-control/token-usage";
    version: 4;
    timestamp: string;
    task: string;
    selected_tokens: number;
    full_repo_tokens: number;
    savings_percent: number;
    file_count_selected: number;
    file_count_total: number;
    estimation_method: EstimationMethod;
    estimate_note: string;
    top_directories: Array<{
        directory: string;
        tokens: number;
        fileCount: number;
    }>;
    wasted_files: Array<{
        file: string;
        tokens: number;
        reason: string;
    }>;
    wasted_tokens_total: number;
    wasted_removal_savings_percent: number;
    heavy_directories: Array<{
        directory: string;
        tokens: number;
        fileCount: number;
        percentOfRepo: number;
        suggestion: string;
    }>;
    measured_usage: {
        available: boolean;
        source: MeasuredUsageState["source"];
        total_tokens: number;
        total_runs: number;
        note: string;
    };
}
export interface TokenReductionCategory {
    category: "node_modules" | "dist" | "skipped dirs" | "selection filter";
    estimated_tokens_avoided: number;
    file_count: number;
    basis: "measured" | "heuristic";
    note: string;
}
export interface TokenBreakdownState {
    artifactType: "kiwi-control/token-breakdown";
    version: 1;
    timestamp: string;
    task: string;
    selected_tokens: number;
    full_repo_tokens: number;
    savings_percent: number;
    partial_scan: boolean;
    categories: TokenReductionCategory[];
}
export declare function estimateTokens(targetRoot: string, selectedFiles: string[], task?: string): Promise<TokenEstimate>;
export declare function persistTokenUsage(targetRoot: string, task: string, estimate: TokenEstimate): Promise<string>;
export declare function persistTokenBreakdown(targetRoot: string, breakdown: TokenBreakdownState): Promise<string>;
//# sourceMappingURL=token-estimator.d.ts.map