import type { RAGAdminActionPresentation, RAGAdminActionRecord, RAGAdminJobPresentation, RAGAdminJobRecord, AIMessage, RAGAnswerGroundingCaseSnapshotPresentation, RAGAnswerGroundingEvaluationHistory, RAGAnswerGroundingEntityQualityView, RAGAnswerGroundingEvaluationResponse, RAGCorpusHealth, RAGCorpusHealthPresentation, RAGExtractorReadiness, RAGReadinessPresentation, RAGGroundingOverviewPresentation, RAGGroundingProviderCaseComparisonPresentation, RAGGroundingProviderOverviewPresentation, RAGGroundingProviderPresentation, RAGComparisonOverviewPresentation, RAGComparisonPresentation, RAGChunkGraph, RAGChunkExcerpts, RAGExcerptModeCounts, RAGExcerptSelection, RAGChunkGraphNavigation, RAGChunkStructure, RAGDocumentChunkPreview, RAGLabelValueRow, RAGRerankerComparisonEntry, RAGRetrievalComparison, RAGRetrievalComparisonEntry, RAGRetrievalComparisonRun, RAGRetrievalReleaseGroupHistoryPresentation, RAGRetrievalReleaseTimelineSummary, RAGRetrievalTrace, RAGQualityOverviewPresentation, RAGSectionRetrievalDiagnostic, RAGEvaluationCaseTracePresentation, RAGEvaluationEntityQualityView, RAGEvaluationHistory, RAGAnswerGroundingHistoryPresentation, RAGEvaluationHistoryPresentation, RAGEvaluationSuiteSnapshotHistory, RAGEvaluationSuiteSnapshotHistoryPresentation, RAGEvaluationSuiteSnapshotPresentation, RAGEntityQualityViewPresentation, RAGRerankerComparison, RAGAnswerWorkflowState, RAGRetrievalTracePresentation, RAGSource, RAGSourceLabels, RAGSourceGroup, RAGSourceSummary, RAGSyncOverviewPresentation, RAGSyncSourcePresentation, RAGSyncSourceRecord } from "@absolutejs/ai";
import type { RAGStreamProgress } from "../../types/presentation";
export type { RAGStreamProgress } from "../../types/presentation";
import { buildRAGCitationReferenceMap, buildRAGCitations, buildRAGGroundedAnswer, buildRAGGroundedAnswerSectionSummaries, buildRAGGroundingReferences } from "../retrieval/grounding";
export { buildRAGCitationReferenceMap, buildRAGCitations, buildRAGGroundedAnswer, buildRAGGroundedAnswerSectionSummaries, buildRAGGroundingReferences, };
export declare const buildRAGRetrievalTracePresentation: (trace?: RAGRetrievalTrace) => RAGRetrievalTracePresentation;
export declare const buildRAGAdminJobPresentation: (job: RAGAdminJobRecord) => RAGAdminJobPresentation;
export declare const buildRAGAdminJobPresentations: (jobs?: RAGAdminJobRecord[]) => RAGAdminJobPresentation[];
export declare const buildRAGAdminActionPresentation: (action: RAGAdminActionRecord) => RAGAdminActionPresentation;
export declare const buildRAGAdminActionPresentations: (actions?: RAGAdminActionRecord[]) => RAGAdminActionPresentation[];
export declare const buildRAGSyncSourcePresentation: (source: RAGSyncSourceRecord) => RAGSyncSourcePresentation;
export declare const buildRAGSyncSourcePresentations: (sources?: RAGSyncSourceRecord[]) => RAGSyncSourcePresentation[];
export declare const buildRAGReadinessPresentation: (readiness?: RAGExtractorReadiness) => RAGReadinessPresentation;
export declare const buildRAGCorpusHealthPresentation: (health?: RAGCorpusHealth) => RAGCorpusHealthPresentation;
export declare const buildRAGSyncOverviewPresentation: (sources?: RAGSyncSourceRecord[]) => RAGSyncOverviewPresentation;
export declare const buildRAGSourceLabels: ({ metadata, source, title, }: {
    metadata?: Record<string, unknown>;
    source?: string;
    title?: string;
}) => RAGSourceLabels | undefined;
export declare const buildRAGChunkStructure: (metadata?: Record<string, unknown>) => RAGChunkStructure | undefined;
type ExcerptChunkInput = Pick<RAGSource, "chunkId" | "metadata" | "structure" | "text">;
export declare const buildRAGChunkExcerpts: (chunks: ExcerptChunkInput[], activeChunkId?: string) => RAGChunkExcerpts | undefined;
export declare const buildRAGPreferredExcerpt: (excerpts?: RAGChunkExcerpts, structure?: RAGChunkStructure) => string;
export declare const buildRAGExcerptSelection: (excerpts?: RAGChunkExcerpts, structure?: RAGChunkStructure) => RAGExcerptSelection & {
    excerpt: string;
};
export declare const buildRAGExcerptModeCounts: (selections: Array<RAGExcerptSelection | undefined>) => RAGExcerptModeCounts;
type GraphChunkInput = Pick<RAGSource, "chunkId" | "metadata" | "source" | "title" | "labels" | "structure"> & Partial<Pick<RAGSource, "score">>;
export declare const buildRAGChunkGraph: (chunks: GraphChunkInput[]) => RAGChunkGraph;
export declare const buildRAGChunkPreviewGraph: (preview: Pick<RAGDocumentChunkPreview, "chunks" | "document">) => RAGChunkGraph;
export declare const buildRAGChunkPreviewNavigation: (preview: Pick<RAGDocumentChunkPreview, "chunks" | "document">, activeChunkId?: string) => RAGChunkGraphNavigation;
export declare const buildRAGChunkGraphNavigation: (graph: RAGChunkGraph, activeChunkId?: string) => RAGChunkGraphNavigation;
export declare const buildRAGRetrievedState: (messages: AIMessage[]) => {
    citationReferenceMap: import("@absolutejs/ai").RAGCitationReferenceMap;
    citations: import("@absolutejs/ai").RAGCitation[];
    conversationId: string;
    excerptModeCounts: RAGExcerptModeCounts;
    groundedAnswer: import("@absolutejs/ai").RAGGroundedAnswer;
    messageId: string;
    retrievalDurationMs: number | undefined;
    retrievalStartedAt: number | undefined;
    retrievedAt: number | undefined;
    trace: RAGRetrievalTrace | undefined;
    sectionDiagnostics: RAGSectionRetrievalDiagnostic[];
    sourceGroups: RAGSourceGroup[];
    sourceSummaries: RAGSourceSummary[];
    sources: RAGSource[];
} | null;
export declare const buildRAGSourceSummaries: (sources: RAGSource[]) => RAGSourceSummary[];
export declare const buildRAGSectionRetrievalDiagnostics: (sources: RAGSource[], trace?: RAGRetrievalTrace) => RAGSectionRetrievalDiagnostic[];
export declare const buildRAGStreamProgress: ({ error, isStreaming, messages, }: {
    error: string | null;
    isStreaming: boolean;
    messages: AIMessage[];
}) => RAGStreamProgress;
export type RAGStreamProgressState = ReturnType<typeof buildRAGStreamProgress>;
export declare const buildRAGAnswerWorkflowState: ({ error, isStreaming, messages, }: {
    error: string | null;
    isStreaming: boolean;
    messages: AIMessage[];
}) => RAGAnswerWorkflowState;
export declare const buildRAGSourceGroups: (sources: RAGSource[]) => RAGSourceGroup[];
export declare const getLatestAssistantMessage: (messages: AIMessage[]) => AIMessage | undefined;
export declare const getLatestRAGSources: (messages: AIMessage[]) => RAGSource[];
export declare const getLatestRetrievedMessage: (messages: AIMessage[]) => AIMessage | undefined;
export declare const resolveRAGStreamStage: ({ error, isStreaming, messages, }: {
    error: string | null;
    isStreaming: boolean;
    messages: AIMessage[];
}) => "error" | "idle" | "submitting" | "retrieving" | "retrieved" | "streaming" | "complete";
export declare const buildRAGComparisonTraceSummaryRows: (entry: RAGRerankerComparisonEntry | RAGRetrievalComparisonEntry) => RAGLabelValueRow[];
export declare const buildRAGComparisonTraceDiffRows: (entry: RAGRerankerComparisonEntry | RAGRetrievalComparisonEntry, leader?: RAGRerankerComparisonEntry | RAGRetrievalComparisonEntry) => RAGLabelValueRow[];
export declare const buildRAGRetrievalComparisonPresentations: (comparison: RAGRetrievalComparison) => RAGComparisonPresentation[];
export declare const buildRAGRetrievalComparisonOverviewPresentation: (comparison: RAGRetrievalComparison) => RAGComparisonOverviewPresentation;
export declare const buildRAGRerankerComparisonPresentations: (comparison: RAGRerankerComparison) => RAGComparisonPresentation[];
export declare const buildRAGRerankerComparisonOverviewPresentation: (comparison: RAGRerankerComparison) => RAGComparisonOverviewPresentation;
export declare const buildRAGGroundingProviderPresentations: (entries: Array<{
    providerKey: string;
    label: string;
    elapsedMs: number;
    response: RAGAnswerGroundingEvaluationResponse;
}>) => RAGGroundingProviderPresentation[];
export declare const buildRAGGroundingProviderOverviewPresentation: (input: {
    entries: Array<{
        providerKey: string;
        label: string;
        elapsedMs: number;
        response: RAGAnswerGroundingEvaluationResponse;
    }>;
    summary: {
        bestByPassingRate?: string;
        bestByAverageCitationF1?: string;
        bestByResolvedCitationRate?: string;
        fastest?: string;
    };
}) => RAGGroundingProviderOverviewPresentation;
export declare const buildRAGRetrievalOverviewPresentation: (comparison: RAGRetrievalComparison) => RAGQualityOverviewPresentation;
export declare const buildRAGRerankerOverviewPresentation: (comparison: RAGRerankerComparison) => RAGQualityOverviewPresentation;
export declare const buildRAGGroundingOverviewPresentation: (input: {
    groundingEvaluation: RAGAnswerGroundingEvaluationResponse;
    groundingProviderOverview?: RAGGroundingProviderOverviewPresentation | null;
}) => RAGGroundingOverviewPresentation;
export declare const buildRAGQualityOverviewPresentation: (input: {
    retrievalComparison: RAGRetrievalComparison;
    rerankerComparison: RAGRerankerComparison;
    groundingEvaluation: RAGAnswerGroundingEvaluationResponse;
    groundingProviderOverview?: RAGGroundingProviderOverviewPresentation | null;
}) => RAGQualityOverviewPresentation;
export declare const buildRAGGroundingProviderCaseComparisonPresentations: (comparisons: Array<{
    caseId: string;
    label: string;
    entries: Array<{
        providerKey: string;
        label: string;
        status: string;
        coverage: string;
        citationF1: number;
        resolvedCitationRate: number;
        matchedIds: string[];
        missingIds: string[];
        extraIds: string[];
        answerExcerpt: string;
    }>;
    summary: {
        bestByStatus?: string;
        bestByCitationF1?: string;
        bestByResolvedCitationRate?: string;
    };
}>) => RAGGroundingProviderCaseComparisonPresentation[];
export declare const buildRAGEvaluationHistoryRows: (history?: RAGEvaluationHistory) => RAGLabelValueRow[];
export declare const buildRAGEvaluationCaseTracePresentations: (history?: RAGEvaluationHistory) => RAGEvaluationCaseTracePresentation[];
export declare const buildRAGEvaluationHistoryPresentation: (history?: RAGEvaluationHistory) => RAGEvaluationHistoryPresentation;
export declare const buildRAGEvaluationSuiteSnapshotRows: (history?: RAGEvaluationSuiteSnapshotHistory) => RAGLabelValueRow[];
export declare const buildRAGEvaluationSuiteSnapshotPresentations: (history?: RAGEvaluationSuiteSnapshotHistory) => RAGEvaluationSuiteSnapshotPresentation[];
export declare const buildRAGEvaluationSuiteSnapshotHistoryPresentation: (history?: RAGEvaluationSuiteSnapshotHistory) => RAGEvaluationSuiteSnapshotHistoryPresentation;
export declare const buildRAGRetrievalReleaseGroupHistoryPresentation: (input: {
    timeline?: RAGRetrievalReleaseTimelineSummary;
    runs?: RAGRetrievalComparisonRun[];
}) => RAGRetrievalReleaseGroupHistoryPresentation;
export declare const buildRAGAnswerGroundingCaseSnapshotPresentations: (history?: RAGAnswerGroundingEvaluationHistory) => RAGAnswerGroundingCaseSnapshotPresentation[];
export declare const buildRAGAnswerGroundingHistoryRows: (history?: RAGAnswerGroundingEvaluationHistory) => RAGLabelValueRow[];
export declare const buildRAGAnswerGroundingHistoryPresentation: (history?: RAGAnswerGroundingEvaluationHistory) => RAGAnswerGroundingHistoryPresentation;
export declare const buildRAGEvaluationEntityQualityPresentation: (view: RAGEvaluationEntityQualityView, entityType: "source" | "document") => RAGEntityQualityViewPresentation;
export declare const buildRAGAnswerGroundingEntityQualityPresentation: (view: RAGAnswerGroundingEntityQualityView, entityType: "source" | "document") => RAGEntityQualityViewPresentation;
