export type TimeScope = {
    start: string;
    end: string;
    projectId?: string;
    applicationId?: string;
    applicationIds?: string[];
};
export type WorkspacePulseScope = {
    start: string;
    end: string;
    projectIds: string[];
    applicationIds: string[];
};
/** Workspace dashboard: daily component pass/fail counts (functional + security trace evals). */
export declare function buildWorkspacePulseMetricsGraphSqlDenorm(params: WorkspacePulseScope): string;
/** Workspace dashboard: distinct production evals (trace or session scoped). */
export declare function buildWorkspacePulseEvalCountSqlDenorm(params: WorkspacePulseScope): string;
/** Workspace dashboard: daily distinct eval counts for summary sparkline. */
export declare function buildWorkspacePulseEvalDailySqlDenorm(params: WorkspacePulseScope): string;
/** Workspace dashboard: distinct traces with at least one eval result. */
export declare function buildWorkspacePulseTracesEvaluatedSqlDenorm(params: WorkspacePulseScope): string;
/** Workspace dashboard: top failing metrics/plugins (functional + security). */
export declare function buildWorkspacePulseTopFailuresSqlDenorm(params: WorkspacePulseScope & {
    limit: number;
}): string;
/** Treemap success/failure (functional components, trace or session scope). */
export declare function buildMetricFailureTreemapSqlDenorm(params: TimeScope, options: MetricFailureDenormOptions): string;
export type MetricFailureDenormOptions = {
    /** When set, only include rows matching component_pass (treemap success/failure variants). */
    componentPassFilter?: 0 | 1;
};
/** Legacy ClickHouse table — prompt/response/detail rows only; list/count use denorm. */
export declare const EVAL_RESULTS_LEGACY_CH_TABLE = "eval_results";
export type MetricFailureAnalysisFilterParams = TimeScope & {
    isRedteam: number;
    metricName: string;
    metricType: string;
    output?: string;
};
/** Paginated metric-failure-analysis: distinct trace or session count. */
export declare function buildMetricFailureAnalysisCountSqlDenorm(params: MetricFailureAnalysisFilterParams, scope: 'trace' | 'session', idRestrictSql?: string): string;
/** CTE: traces/sessions that have at least one matching component row. */
export declare function buildMetricFailureAnalysisInitialTracesCte(params: MetricFailureAnalysisFilterParams, scope: 'trace' | 'session', idRestrictSql?: string): string;
/** List rows: component aggregates from denorm; prompt from legacy eval_results. */
export declare function buildMetricFailureAnalysisListSqlDenorm(params: MetricFailureAnalysisFilterParams, scope: 'trace' | 'session', options: {
    initialTracesCte: string;
    pageLimit: number;
    pageOffset: number;
    otelTracesTable: string;
    legacyEvalTable?: string;
}): string;
/** Denormalized metric failure total (functional / is_redteam = 0). */
export declare function buildMetricFailureTotalSqlDenorm(params: TimeScope, scope: 'trace' | 'session', options?: MetricFailureDenormOptions): string;
/** Evaluated metric components (pass + fail); not top-level grading_pass row counts. */
export declare function totalEvaluationsFromComponentCountsSql(alias?: string): string;
/** Denormalized session-list eval aggregation (GROUP BY session_id). */
export declare function buildSessionListEvalCteSqlDenorm(sessionIdFilterSql: string, applicationIdsInClause: string): string;
/** Denormalized trace-list eval aggregation: flatten trace_ids, then join on trace_lookup_id. */
export declare function buildTraceListEvalCteSqlDenorm(params: Pick<TimeScope, 'projectId' | 'applicationId' | 'applicationIds'>): string;
export declare function buildSecurityOverviewSqlDenorm(whereCore: string): string;
/** Trace-level eval pass/fail counts (functional); min(grading_pass) per trace. */
export declare function buildObserveEvalStatsSqlDenorm(params: {
    projectId: string;
    start: string;
    end: string;
    appFilterEval: string;
}): string;
export declare function buildObserveEvalStatsFilteredSqlDenorm(params: {
    projectId: string;
    start: string;
    end: string;
    metricIdsList: string;
    pluginIdsList: string;
    appFilterEval: string;
}): string;
/** Maps analytics row to legacy total-records status_priority (0=success, 1=error, 2=fail). */
export declare const ANALYTICS_STATUS_PRIORITY_EXPR = "max(\n        if(grading_pass = 1, 0,\n          if(grading_pass = 0 AND failure_reason != 2, 2,\n            if(error IS NOT NULL AND failure_reason = 2, 1, -1)\n          )\n        )\n      )";
export declare function buildTotalRecordsSqlDenorm(params: {
    start: string;
    end: string;
    projectId: string;
    applicationId: string;
    timeGrouping: string;
    timeFieldName: string;
}): string;
export type AiReliabilityBucketSqlConfig = {
    bucketExpression: string;
    rangeStartExpression: string;
    rangeEndExpression: string;
    fillStep: string;
};
export type AiReliabilitySqlParams = TimeScope & {
    rangeStart: string;
    rangeEnd: string;
};
export declare function buildAiReliabilitySqlDenorm(params: AiReliabilitySqlParams, bucketConfig: AiReliabilityBucketSqlConfig): string;
//# sourceMappingURL=queryAdapter.d.ts.map