import type { BaselineProfile } from '../ai/baseline-learner.js';
export interface TuiMeta {
    dbPath: string;
    recordCount: number;
    wsConnected: boolean;
    dbReadOnly: boolean;
    fetchError: string | null;
}
export interface FleetRow {
    instanceId: string;
    instanceName: string;
    status: string;
    hostname: string;
    region?: string;
    totalRequests: number;
    blockedRequests: number;
    totalCostUsd: number;
}
export interface FleetData {
    region: string;
    source: string;
    totalInstances: number;
    activeInstances: number;
    totalRequests: number;
    totalBlocked: number;
    totalCostUsd: number;
    rows: FleetRow[];
}
export interface TuiData {
    overview: OverviewData;
    security: SecurityData;
    cost: CostData;
    health: HealthData;
    ai: AiData;
    audit: AuditData;
    policy: PolicyData;
    instances: InstanceData[];
    fleet: FleetData;
    meta: TuiMeta;
}
export interface OverviewData {
    totalInstances: number;
    activeInstances: number;
    totalRequests: number;
    blockedRequests: number;
    passRate: number;
    totalCostUsd: number;
    burnRatePerHour: number;
    avgLatencyMs: number;
    activeServers: number;
    lastUpdated: string;
}
export interface SecurityData {
    servers: {
        name: string;
        score: number;
        cves: number;
        critical: number;
        auth: boolean;
    }[];
    overallScore: number;
    worstOffenders: string[];
    activeThreats: number;
    lastScan: string;
}
export interface CostData {
    servers: {
        name: string;
        tokens: number;
        cost: number;
        trend: string;
        unpriced?: number;
        models?: string[];
    }[];
    totalCost: number;
    projectedMonthly: number;
    budgetAlerts: string[];
    pricingModel: string;
    unpricedCalls: number;
    pricedCalls: number;
}
export interface HealthData {
    servers: {
        name: string;
        latency: number;
        successRate: number;
        tools: number;
        circuitBreaker: string;
    }[];
    atRisk: string[];
    avgLatency: number;
    totalTools: number;
}
export interface AiLearningDisplay {
    adaptiveThreshold: number;
    truePositiveRate: number | null;
    falsePositiveRate: number | null;
    moduleWeights: Record<string, number>;
    learningInitialized: boolean;
    lastCycleAt: string | null;
    cyclesCompleted: number;
    recordsAnalyzed: number;
    baselinesLearned: number;
    suggestionsGenerated: number;
    labeledOutcomes: number;
}
export interface AiData {
    suggestions: any[];
    baselines: BaselineProfile[];
    learningState: AiLearningDisplay;
    threats: any[];
    report: Record<string, unknown> | null;
    analysis: string;
}
export interface AuditData {
    events: any[];
    total: number;
    blocked: number;
    passed: number;
    flagged: number;
}
export interface PolicyData {
    mode: string;
    activeRules: number;
    autoGeneratedRules: string[];
    rules: any[];
}
export interface InstanceData {
    instanceId: string;
    instanceName: string;
    status: string;
    hostname: string;
    version: string;
    lastHeartbeat: string;
    totalRequests: number;
    blockedRequests: number;
    totalCostUsd: number;
    avgLatencyMs: number;
}
export declare class DataFetcher {
    private db;
    private dbPath;
    private cache;
    private listeners;
    private pollTimer;
    private lastAnalysis;
    private dashboardUrl;
    private ws;
    private wsConnected;
    private learningInFlight;
    private learningRan;
    private lastFetchError;
    private dbReadOnly;
    constructor(dashboardUrl?: string);
    getData(): TuiData | null;
    getDbPath(): string;
    isWsConnected(): boolean;
    onChange(cb: () => void): () => void;
    private notify;
    connectWebSocket(): void;
    /** Re-open read-only handle so WAL commits from proxy/demo are visible while polling. */
    private refreshReadOnlyConnection;
    fetchAll(opts?: {
        skipLearning?: boolean;
    }): Promise<TuiData>;
    recordSuggestionOutcome(suggestion: {
        id?: string;
        ruleName?: string;
        source?: string;
        confidence?: number;
        rule?: import('../policy/policy-types.js').PolicyRule;
    }, action: 'applied' | 'rejected'): Promise<void>;
    private loadLearningDisplay;
    private loadFleetData;
    private tuiAiLearningAllowed;
    private ensureLearningCycle;
    private getTopTools;
    private buildDeterministicAnalysis;
    private buildAnalysisPrompt;
    startPolling(ms?: number): NodeJS.Timeout;
    stop(): void;
}
//# sourceMappingURL=data-fetcher.d.ts.map