/**
 * Website Analysis Service — Independent, Reusable Brand Extraction Pipeline
 *
 * Analyzes a website URL and produces a structured AnalysisDraft with per-field
 * confidence scores and source provenance. Designed for KR3 "magic onboarding"
 * but intentionally independent of the onboarding flow for reuse in template
 * previews, competitor analysis, and brand profile updates.
 *
 * Pipeline (4 stages with streaming progress):
 * 1. Fetch homepage — DNS/SSL/redirect handling, robots.txt respect
 * 2. Discover pages — find about/services/products/team pages (same-domain)
 * 3. Extract content — HTML-to-text, metadata extraction from all pages
 * 4. Generate draft — LLM structured extraction with confidence + source
 *
 * @module services/onboarding/website-analysis.service
 */
import { WebsiteExtractorService } from './website-extractor.service.js';
import type { AnalysisDraft, AnalysisOptions, AnalysisResult, TemplateRecommendation } from './website-analysis.types.js';
/**
 * WebsiteAnalysisService provides an independent, reusable pipeline for
 * extracting structured brand data from a website URL.
 *
 * Uses WebsiteExtractorService for low-level fetching/parsing, then adds:
 * - Structured AnalysisDraft output with per-field confidence + source
 * - 4-stage streaming progress events
 * - Template recommendation based on extracted profile
 * - Partial results on failure (graceful degradation)
 *
 * @example
 * ```typescript
 * const service = WebsiteAnalysisService.getInstance();
 * const result = await service.analyze({
 *   url: 'https://example.com',
 *   onProgress: (event) => console.log(event.stage, event.progress),
 * });
 * ```
 */
export declare class WebsiteAnalysisService {
    private static instance;
    private readonly logger;
    private extractor;
    private constructor();
    /**
     * Get the singleton instance.
     *
     * @returns WebsiteAnalysisService instance
     */
    static getInstance(): WebsiteAnalysisService;
    /**
     * Reset the singleton (for testing).
     */
    static resetInstance(): void;
    /**
     * Override the extractor (for testing).
     *
     * @param extractor - Custom WebsiteExtractorService instance
     */
    setExtractor(extractor: WebsiteExtractorService): void;
    /**
     * Analyze a website and produce a structured AnalysisDraft.
     *
     * Runs the 4-stage pipeline with streaming progress events.
     * Returns partial results on failure (graceful degradation).
     *
     * @param options - Analysis options including URL and progress callback
     * @returns Analysis result with draft, timing, and metadata
     */
    analyze(options: AnalysisOptions): Promise<AnalysisResult>;
    /**
     * Enrich the draft with data from page metadata (title, og tags, meta description).
     * Used as fallback when LLM extraction is unavailable.
     *
     * @param draft - Draft to enrich
     * @param pages - Processed pages with metadata
     */
    private enrichDraftFromMetadata;
    /**
     * Map LLM extraction result to AnalysisDraft fields with confidence + source.
     *
     * @param draft - Draft to populate
     * @param result - Raw LLM extraction result
     * @param pages - Source pages for provenance
     */
    private mapLlmResultToDraft;
    /**
     * Identify fields that were not extracted and add to missingFields.
     *
     * @param draft - Draft to check
     */
    private identifyMissingFields;
    /**
     * Recommend a template based on the extracted brand profile.
     * Uses rule-based industry matching (can evolve to LLM-based later).
     *
     * @param draft - Current analysis draft
     * @returns Template recommendation with confidence and reason
     */
    recommendTemplate(draft: AnalysisDraft): TemplateRecommendation;
    /**
     * Create a progress event for streaming UI updates.
     *
     * @param stage - Current pipeline stage
     * @param message - Human-readable status message
     * @param progress - Percentage complete (0-100)
     * @param partialDraft - Optional partial draft
     * @param error - Optional error message
     * @returns Progress event
     */
    private createProgress;
    /**
     * Create an AnalysisField with full provenance.
     *
     * @param value - Extracted value
     * @param confidence - Confidence level
     * @param url - Source page URL
     * @param snippet - Relevant source snippet
     * @param pageTitle - Source page title
     * @param method - Extraction method
     * @returns Complete AnalysisField
     */
    private createField;
    /**
     * Normalize a URL: add protocol if missing, ensure trailing format.
     *
     * @param url - Raw URL input
     * @returns Normalized URL with protocol
     */
    private normalizeUrl;
    /**
     * Build the final AnalysisResult object.
     *
     * @param success - Whether analysis completed successfully
     * @param draft - The analysis draft
     * @param startTime - Pipeline start timestamp
     * @param pagesFetched - Number of pages fetched
     * @param error - Optional error message
     * @returns Complete analysis result
     */
    private buildResult;
}
//# sourceMappingURL=website-analysis.service.d.ts.map