"""Universal answer quality pipeline shared by server and desktop runtimes."""

from iuve_connect_agents.shared.answer_quality.answer_level import (
    ANSWER_LEVELS,
    classify_answer_level,
    classify_answer_level_rules,
    detect_level_mismatch,
)
from iuve_connect_agents.shared.answer_quality.contract import StructuredAnswerContract
from iuve_connect_agents.shared.answer_quality.ecosystem_principles import (
    canonical_principles_path,
    load_ecosystem_principles,
    principles_block_for_prompt,
)
from iuve_connect_agents.shared.answer_quality.normalizer import normalize_answer
from iuve_connect_agents.shared.answer_quality.pipeline import AnswerQualityContext, AnswerQualityPipeline
from iuve_connect_agents.shared.answer_quality.prompt_audit import audit_prompt_context, deduplicate_titles
from iuve_connect_agents.shared.answer_quality.renderer import strip_duplicate_renderer_title
from iuve_connect_agents.shared.answer_quality.semantic_dedup import deduplicate_blocks, deduplicate_chunks
from iuve_connect_agents.shared.answer_quality.source_validator import is_valid_source_line, strip_fake_sources
from iuve_connect_agents.shared.answer_quality.telemetry import (
    QUALITY_EVENT_NAMES,
    ensure_quality_meta,
    event_count,
    new_correlation_id,
    record_event,
    set_correlation_id,
)

__all__ = [
    "ANSWER_LEVELS",
    "AnswerQualityContext",
    "AnswerQualityPipeline",
    "QUALITY_EVENT_NAMES",
    "StructuredAnswerContract",
    "audit_prompt_context",
    "canonical_principles_path",
    "classify_answer_level",
    "classify_answer_level_rules",
    "deduplicate_blocks",
    "deduplicate_chunks",
    "deduplicate_titles",
    "detect_level_mismatch",
    "ensure_quality_meta",
    "event_count",
    "is_valid_source_line",
    "load_ecosystem_principles",
    "new_correlation_id",
    "normalize_answer",
    "principles_block_for_prompt",
    "record_event",
    "set_correlation_id",
    "strip_duplicate_renderer_title",
    "strip_fake_sources",
]
