/**
 * Brand voice analysis — gathers published content samples and turns them into
 * a draft profile for the Settings > AI form fields.
 */
import { BRAND_VOICE_LIMITS } from './brand-voice.js';
import type { BrandVoiceProfile } from './types.js';
/** A single content sample fed to the analyzer. */
export interface BrandVoiceSample {
    collection: string;
    documentId: string;
    title: string;
    text: string;
}
/** Draft profile fields returned by the analyzer (no `enabled` flag). */
export type BrandVoiceAnalysisDraft = Pick<BrandVoiceProfile, 'name' | 'tone' | 'audience' | 'guidelines' | 'sampleText'>;
export interface BrandVoiceAnalyzeResult {
    draft: BrandVoiceAnalysisDraft;
    sources: Array<{
        collection: string;
        documentId: string;
        title: string;
    }>;
    sampleCount: number;
}
declare const DEFAULT_MAX_SAMPLES = 10;
declare const MAX_SAMPLES_CAP = 15;
/** Fence untrusted CMS content before it is interpolated into an analysis prompt. */
export declare function fenceBrandVoiceSample(text: string, maxLen?: number): string;
/**
 * Build the system + user prompts for brand voice analysis. Kept separate from
 * the runtime call so unit tests can assert on prompt shape without mocking HTTP.
 */
export declare function buildBrandVoiceAnalysisPrompt(samples: BrandVoiceSample[]): {
    system: string;
    prompt: string;
};
/** Strip optional markdown code fences from a model JSON response. */
export declare function stripJsonFences(text: string): string;
/**
 * Parse and normalize a model JSON response into draft brand voice fields.
 * Returns null when the payload is unusable.
 */
export declare function parseBrandVoiceAnalysisResponse(text: string): BrandVoiceAnalysisDraft | null;
export interface GatherBrandVoiceSamplesOptions {
    collections: string[];
    maxSamples?: number;
}
type DocumentRow = {
    id: string;
    collection: string;
    title: string | null;
    plainText: string | null;
    data: unknown;
};
/**
 * Load published content samples from the requested collections. Samples are
 * spread across collections (round-robin by recency) up to `maxSamples`.
 */
export declare function gatherBrandVoiceSamples(db: {
    document: {
        findMany: (args: {
            where: Record<string, unknown>;
            select: Record<string, true>;
            orderBy: Record<string, string>;
            take: number;
        }) => Promise<DocumentRow[]>;
    };
}, options: GatherBrandVoiceSamplesOptions): Promise<BrandVoiceSample[]>;
export declare function toBrandVoiceAnalyzeResult(draft: BrandVoiceAnalysisDraft, samples: BrandVoiceSample[]): BrandVoiceAnalyzeResult;
export { DEFAULT_MAX_SAMPLES as BRAND_VOICE_ANALYZE_DEFAULT_SAMPLES, MAX_SAMPLES_CAP as BRAND_VOICE_ANALYZE_MAX_SAMPLES, BRAND_VOICE_LIMITS, };
//# sourceMappingURL=brand-voice-analyze.d.ts.map