export declare const OTEL_TRACES_TABLE_NAME = "otel_traces";
export declare const EVAL_RESULTS_TABLE_NAME = "eval_results";
/** Per-trace DAG metadata: tools, agents, models; used to filter traces by node. */
export declare const TRACE_DAG_METADATA_TABLE = "trusys_dev.trace_dag_metadata";
/** Global view metrics returned when focusNodeId is not set (from OTEL + eval). */
export interface DashboardDagMetadata {
    totalTraces: number;
    tracesEvaluated: number;
    evaluationPassed: number;
    evaluationsFailed: number;
    totalExceptions: number;
    /** From monitoringConfig: 'count' | 'percent' */
    samplingFrequency?: string;
    samplingCount?: number;
    samplingPercentage?: number;
    /** Global view: trace count. Focus view: incoming call count only when from agent/prompt/response. */
    totalRequest?: number;
    /** Global view: trace count. Focus view: outgoing call count only when to agent/prompt/response. */
    totalResponse?: number;
    /** Set when focusNodeId is present; signals that metadata is focus-scoped. */
    focusedNodeId?: string;
}
export declare class ObserveChartsService {
    private readonly TABLE_SWITCH_DAYS;
    private readonly MAX_LOOKBACK_DAYS;
    private readonly tableColumnsCache;
    private getTableColumns;
    private isNotEmpty;
    private buildFiltersCondition;
    /**
     * Builds a search filter that handles whitespace variations (newlines, tabs, multiple spaces).
     * Normalizes both the search term and the data fields before matching.
     */
    private buildSearchFilter;
    private getTableSelectionConfig;
    /**
     * Generates a CTE that creates a complete time series (all hours or days) between start and end
     * This ensures all time periods are included even if there's no data
     */
    private generateTimeSeriesCTE;
    private fillTimeSeriesByDimension;
    getAgentRunAnalysis: (payload: Record<string, any>) => Promise<any[]>;
    getAgentRunBreakdown: (payload: Record<string, any>) => Promise<Record<string, unknown>[]>;
    getToolCallBreakdown: (payload: Record<string, any>) => Promise<Record<string, unknown>[]>;
    getResponseTimeByModel: (payload: Record<string, any>) => Promise<Record<string, unknown>[]>;
    getResponseTimeByModelSummary: (payload: Record<string, any>) => Promise<any[]>;
    getResponseTimeByAgent: (payload: Record<string, any>) => Promise<Record<string, unknown>[]>;
    getResponseTimeByAgentSummary: (payload: Record<string, any>) => Promise<any[]>;
    getTokenConsumptionPerModelDonut: (payload: Record<string, any>) => Promise<any[]>;
    getTokenConsumptionPerModelChart: (payload: Record<string, any>) => Promise<Record<string, unknown>[]>;
    getTokenConsumptionPerAgentDonut: (payload: Record<string, any>) => Promise<any[]>;
    getTokenConsumptionPerAgentChart: (payload: Record<string, any>) => Promise<Record<string, unknown>[]>;
    /**
     * Get unique agent and tool node names from aggregated_trace_dag_nodes (no date-range filter).
     * Returns agents and tools in separate arrays for the "Agents" and "Tools" filter categories.
     */
    getUniqueAgentsAndTools: (payload: Record<string, any>) => Promise<{
        agents: Array<{
            id: string;
            label: string;
            value: string;
        }>;
        tools: Array<{
            id: string;
            label: string;
            value: string;
        }>;
    }>;
    /**
     * Get aggregated DAG (nodes + edges) for dashboard flow view.
     * Uses aggregated_trace_dag_nodes and aggregated_trace_dag_edges with same filters as other charts.
     */
    getDashboardDag: (payload: Record<string, any>) => Promise<{
        nodes: any[];
        edges: any[];
        metadata?: DashboardDagMetadata;
    }>;
    /**
     * Common query builder for prompt traces
     * @param options Configuration options for the query
     */
    private _buildPromptTracesQuery;
    /**
     * Common query builder for exception traces
     * @param options Configuration options for the query
     */
    private _buildExceptionTracesQuery;
    getSlowestPromptsAnalysis: (payload: Record<string, any>) => Promise<any[]>;
    getExpensivePromptsAnalysis: (payload: Record<string, any>) => Promise<any[]>;
    getPromptTraces: (payload: Record<string, any>) => Promise<{
        traces: any[];
        total: number;
    }>;
    getAllPromptTracesForDownload: (payload: Record<string, any>) => Promise<any[]>;
    getExceptionTraces: (payload: Record<string, any>) => Promise<{
        traces: any[];
        total: number;
    }>;
    getAllExceptionTracesForDownload: (payload: Record<string, any>) => Promise<any[]>;
    /**
     * Fetch paginated traces that match a given tool or agent node.
     * Pipeline: (1) trace_dag_metadata → which traces have that tool/agent; (2) eval_results → which of those were evaluated;
     * (3) for evaluated traces return component pass/fail counts and result rows.
     */
    getNodeTraces: (payload: Record<string, any>) => Promise<{
        traces: {
            id: string;
            trace_id: string;
            created_at: string;
            prompt: any;
            response: any;
            success: number;
            functionalComponentPassCount: number;
            functionalComponentFailCount: number;
            securityComponentPassCount: number;
            securityComponentFailCount: number;
            totalEvaluations: number;
            results: {
                grading_result: any;
                failure_reason: any;
                error: any;
                success: number;
                id: string;
                is_redteam: number;
            }[];
        }[];
        total: number;
    }>;
    getAgentAnalysisSummary: (payload: Record<string, any>) => Promise<any>;
    getSystemHealth: (payload: Record<string, any>) => Promise<{
        passedRequests: number;
        failedRequests: number;
        passPercentage: string;
    }>;
    getGroup1Metrics: (payload: Record<string, any>) => Promise<any>;
    getGroup2Metrics: (payload: Record<string, any>) => Promise<{
        'total-tokens': number;
        'total-cost': number;
        'avg-tokens-request': number;
        'avg-cost-request': number;
        'total-request-duration': number;
        'avg-duration-request': number;
    }>;
    /** Returns a single metric value for board widget cards. Uses one minimal query per metric. */
    getSingleMetric: (metricKey: string, payload: Record<string, any>) => Promise<number>;
    getCacheReadTokens: (payload: Record<string, any>) => Promise<{
        timestamp: Date;
        value: number;
    }[]>;
    getCacheSummaryMetrics: (payload: Record<string, any>) => Promise<{
        'total-cost': number;
        'cache-hit': number;
        'avg-time-saved': number;
        'cost-saved': number;
    }>;
    getTimeToFirstTokenHistogram: (payload: Record<string, any>) => Promise<{
        bin: string;
        count: number;
    }[]>;
    getTotalResponseTimeHistogram: (payload: Record<string, any>) => Promise<{
        bin: string;
        count: number;
    }[]>;
    getTimeToFirstTokenVsResponseTime: (payload: Record<string, any>) => Promise<{
        timestamp: Date;
        totalResponseTime: number;
        avgTimeToFirstToken: number;
    }[]>;
    getTimeToFirstTokenScatter: (payload: Record<string, any>) => Promise<{
        timeToFirstToken: number;
        totalResponseTime: number;
    }[]>;
    getTracesPerTime: (payload: Record<string, any>) => Promise<{
        timestamp: Date;
        value: number;
    }[]>;
    getTimeToFirstTokenChart: (payload: Record<string, any>) => Promise<{
        timestamp: Date;
        avgTimeToFirstToken: number;
    }[]>;
    getResponseTimeChart: (payload: Record<string, any>) => Promise<{
        timestamp: Date;
        totalResponseTime: number;
    }[]>;
    getTokensAnalysis: (payload: Record<string, any>) => Promise<{
        timestamp: Date;
        tokens: number;
    }[]>;
}
export declare const observeChartsService: ObserveChartsService;
//# sourceMappingURL=observeCharts.d.ts.map