import type { SearchResultItem, Citation, StageResult } from '../types.js';
import type { SamplingCapableServer } from './sampling.js';
export interface SynthesisResult {
    answer?: string;
    citations?: Citation[];
    fallback: boolean;
    warning?: string;
}
export declare function synthesizeAnswer(results: SearchResultItem[], query: string, server: SamplingCapableServer): Promise<SynthesisResult>;
export declare function buildSourcesText(results: SearchResultItem[]): string;
export declare function buildSynthesisPrompt(query: string, sourcesText: string): string;
export interface StructuredFallbackResult {
    answer: string;
    citations: Citation[];
    warning: string;
}
export declare function buildStructuredFallback(results: SearchResultItem[], query: string): StructuredFallbackResult;
export interface SynthesisInput {
    query: string;
    results: SearchResultItem[];
    samplingServer?: SamplingCapableServer;
    /** Reserved for future per-source truncation; T6 currently relies on MAX_CHARS_PER_SOURCE. */
    maxTotalChars: number;
}
export type SynthesisStatus = 'quota_exceeded';
export interface SynthesizedAnswer {
    answer: string;
    citations: Citation[];
    warning?: string;
    fallback_level: 1 | 2 | 3;
    synthesis_status?: SynthesisStatus;
    synthesis_provider?: string;
    synthesis_model?: string;
    synthesis_advice?: string;
}
export declare function runSynthesis(input: SynthesisInput): Promise<StageResult<SynthesizedAnswer>>;
export declare function extractCitations(answer: string, results: SearchResultItem[]): Citation[];
//# sourceMappingURL=answer-synthesis.d.ts.map