export interface LedgerEntry {
    id: string;
    timestamp: string;
    sessionId: string;
    toolName: string;
    specId?: string;
    model: string;
    inputTokens: number;
    outputTokens: number;
    totalTokens: number;
    costUsd: number;
    estimatedTokens?: number;
    estimatedCostUsd?: number;
    cached: boolean;
    optimizationSavings?: number;
}
export interface LedgerFilter {
    period?: 'today' | 'week' | 'month' | 'all_time';
    specId?: string;
    toolName?: string;
    model?: string;
    sessionId?: string;
}
export interface LedgerAggregation {
    totalTokens: number;
    totalInputTokens: number;
    totalOutputTokens: number;
    totalCostUsd: number;
    totalEstimatedCostUsd: number;
    entryCount: number;
    uniqueTools: number;
    uniqueModels: number;
    uniqueSessions: number;
    avgTokensPerCall: number;
    avgCostPerCall: number;
    tokensByTool: Record<string, number>;
    costByTool: Record<string, number>;
    tokensByModel: Record<string, number>;
    costByModel: Record<string, number>;
    estimationAccuracy: number;
    overEstimationPercent: number;
}
export interface MonthlyLedger {
    month: string;
    entries: LedgerEntry[];
    aggregation: LedgerAggregation;
}
export interface BudgetConfig {
    monthlyLimitUsd?: number;
    warningThresholdPercent: number;
    criticalThresholdPercent: number;
}
export interface LedgerBudgetStatus {
    monthlyLimitUsd: number | null;
    spentUsd: number;
    remainingUsd: number | null;
    percentUsed: number | null;
    projectedMonthlyUsd: number;
    projectedExhaustionDay: number | null;
    isWarning: boolean;
    isCritical: boolean;
    isOverBudget: boolean;
    daysInMonth: number;
    daysElapsed: number;
    dailyAvgUsd: number;
}
export interface DailyBreakdown {
    date: string;
    totalTokens: number;
    totalCostUsd: number;
    callCount: number;
    topTool: string;
    topModel: string;
}
export interface TrendResult {
    direction: 'increasing' | 'stable' | 'decreasing';
    changePercent: number;
    description: string;
}
export interface Anomaly {
    date: string;
    type: 'spike' | 'unusual_model' | 'high_cost_tool';
    severity: 'info' | 'warning' | 'critical';
    description: string;
    value: number;
    threshold: number;
}
export interface TopConsumer {
    name: string;
    tokens: number;
    costUsd: number;
    percentage: number;
    callCount: number;
}
export interface OptimizationSavings {
    tokensSavedByCache: number;
    tokensSavedByOptimization: number;
    totalTokensSaved: number;
    costSavedUsd: number;
    savingsPercent: number;
}
export interface ReconciliationInput {
    specId: string;
    estimatedInputTokens: number;
    estimatedOutputTokens: number;
    estimatedCostUsd: number;
    estimatedModel: string;
    actualEntries: LedgerEntry[];
}
export interface ReconciliationResult {
    specId: string;
    estimated: {
        inputTokens: number;
        outputTokens: number;
        totalTokens: number;
        costUsd: number;
        model: string;
    };
    actual: {
        inputTokens: number;
        outputTokens: number;
        totalTokens: number;
        costUsd: number;
        models: string[];
        callCount: number;
    };
    deviation: {
        tokenPercent: number;
        costPercent: number;
        absoluteTokenDiff: number;
        absoluteCostDiff: number;
        direction: 'over' | 'under' | 'accurate';
    };
    accuracy: {
        tokenAccuracy: number;
        costAccuracy: number;
        grade: 'excellent' | 'good' | 'fair' | 'poor';
    };
    calibrationSuggestion?: string;
}
export interface CalibrationData {
    specId: string;
    timestamp: string;
    estimatedTokens: number;
    actualTokens: number;
    ratio: number;
}
export interface TokenIntelligenceInput {
    period?: string;
    groupBy?: string;
    view?: string;
    specId?: string;
    projectPath?: string;
}
export interface LedgerAccumulatorState {
    totalTokens: number;
    totalInputTokens: number;
    totalOutputTokens: number;
    totalCostUsd: number;
    totalEstimatedCostUsd: number;
    tokensByTool: Record<string, number>;
    costByTool: Record<string, number>;
    tokensByModel: Record<string, number>;
    costByModel: Record<string, number>;
    tools: Set<string>;
    models: Set<string>;
    sessions: Set<string>;
    estimatedSum: number;
    actualForEstimated: number;
    estimatedCount: number;
}
export interface DailyTotal {
    date: string;
    tokens: number;
    costUsd: number;
    calls: number;
}
export interface SimpleTokenTrend {
    direction: 'increasing' | 'decreasing' | 'stable';
    changePercent: number;
}
export interface SimpleTokenAnomaly {
    date: string;
    severity: 'critical' | 'warning';
    description: string;
    tokens: number;
}
export interface RankedConsumer {
    rank: number;
    name: string;
    tokens: number;
    costUsd: number;
    percentOfTotal: number;
}
export interface TokenSavingsToolEntry {
    tool: string;
    savingsPct: number;
    specGuided: number;
    unstructured: number;
}
export interface TokenSavingsMonthEntry {
    month: string;
    savingsPct: number | null;
}
export interface TokenSavingsReport {
    period: string;
    totalEntries: number;
    specGuidedEntries: number;
    unstructuredEntries: number;
    avgTokensSpecGuided: number;
    avgTokensUnstructured: number;
    savingsPct: number | null;
    estimatedSavingsTotal: number;
    confidenceLevel: 'high' | 'medium' | 'low' | 'insufficient';
    topSavingTools: TokenSavingsToolEntry[];
    monthlyTrend: TokenSavingsMonthEntry[];
}
//# sourceMappingURL=token-ledger.d.ts.map