/**
 * Token-Budget-Aware Reasoning System
 *
 * Based on TALE paper (arXiv 2412.18547):
 * - Assess task complexity before processing
 * - Allocate reasoning tokens dynamically
 * - Skip verbose reasoning for simple tasks
 * - Achieve 68.9% token reduction with <5% accuracy loss
 *
 * Key insight: Not all tasks require the same level of reasoning depth.
 * Simple tasks can use quick responses while complex tasks get full reasoning.
 */
import { EventEmitter } from 'events';
export type TaskComplexity = 'trivial' | 'simple' | 'moderate' | 'complex' | 'expert';
export interface ComplexityAssessment {
    level: TaskComplexity;
    score: number;
    factors: ComplexityFactor[];
    suggestedTokenBudget: number;
    suggestedThinkingDepth: ThinkingDepth;
}
export interface ComplexityFactor {
    name: string;
    weight: number;
    detected: boolean;
    contribution: number;
}
export type ThinkingDepth = 'none' | 'brief' | 'standard' | 'deep' | 'exhaustive';
export interface TokenBudgetConfig {
    budgets: Record<TaskComplexity, number>;
    thinkingDepths: Record<TaskComplexity, ThinkingDepth>;
    adaptiveEnabled: boolean;
    maxTotalTokens: number;
    minTokens: number;
}
export interface ReasoningResult {
    response: string;
    tokensUsed: number;
    tokensSaved: number;
    complexityAssessment: ComplexityAssessment;
    thinkingDepth: ThinkingDepth;
}
export interface TaskContext {
    codeContext?: string;
    errorMessage?: string;
    previousAttempts?: number;
    fileCount?: number;
    projectSize?: 'small' | 'medium' | 'large';
    urgency?: 'low' | 'normal' | 'high';
}
export declare class TokenBudgetReasoning extends EventEmitter {
    private config;
    private history;
    constructor(config?: Partial<TokenBudgetConfig>);
    /**
     * Assess task complexity and determine token budget
     */
    assessComplexity(task: string, context?: TaskContext): ComplexityAssessment;
    /**
     * Get optimal token budget for a task
     */
    getTokenBudget(task: string, context?: TaskContext): number;
    /**
     * Get thinking depth for a task
     */
    getThinkingDepth(task: string, context?: TaskContext): ThinkingDepth;
    /**
     * Generate system prompt modifier based on complexity
     */
    getSystemPromptModifier(assessment: ComplexityAssessment): string;
    /**
     * Create a token-budget-aware prompt wrapper
     */
    createBudgetAwarePrompt(task: string, context?: TaskContext): {
        systemModifier: string;
        maxTokens: number;
        assessment: ComplexityAssessment;
    };
    /**
     * Estimate tokens saved compared to max budget
     */
    estimateSavings(assessment: ComplexityAssessment): {
        tokensSaved: number;
        percentageSaved: number;
    };
    /**
     * Get average complexity from history
     */
    getAverageComplexity(): number;
    /**
     * Get complexity distribution from history
     */
    getComplexityDistribution(): Record<TaskComplexity, number>;
    /**
     * Convert score to complexity level
     */
    private scoreToLevel;
    /**
     * Calculate token budget for a complexity level
     */
    private calculateBudget;
    /**
     * Update configuration
     */
    updateConfig(config: Partial<TokenBudgetConfig>): void;
    /**
     * Get current configuration
     */
    getConfig(): TokenBudgetConfig;
    /**
     * Clear history
     */
    clearHistory(): void;
    /**
     * Dispose and clean up resources
     */
    dispose(): void;
}
export declare function getTokenBudgetReasoning(config?: Partial<TokenBudgetConfig>): TokenBudgetReasoning;
export declare function resetTokenBudgetReasoning(): void;
