"""Tool registry package — split from analysis/tool_registry.py.

Re-exports all tool metadata, dispatcher, and handlers.
"""

# ── Helpers ────────────────────────────────────────────────────────────────
from ._helpers import (
    _json_size,
    _truncate_response,
    _build_filter_expr,
    _resolve_dataset,
    _count_rows,
    _get_numeric_columns,
    NUMERIC_DTYPES,
    NUMERIC_TYPE_NAMES,
)

# ── Registry + dispatch ────────────────────────────────────────────────────
from ._registry import get_tools_meta
from ._dispatch import handle_call

# ── Handlers (tool implementations) ────────────────────────────────────────
from .load_data import _handle_load_data
from .profile import _handle_profile_data
from .filter import _handle_filter_data
from .preprocess import _handle_preprocess_data
from .clustering import _handle_run_clustering, _handle_filter_and_cluster
from .evaluate import _handle_evaluate_clustering
from .features import _handle_extract_features, _save_features_to_db
from .export import _handle_export_results
from .entities import (
    _handle_build_entity_profiles,
    _handle_compute_scores,
    _add_adaptive_scores,
    _ENTITY_KEYWORDS,
    _NUMERIC_TYPES_FOR_AGG,
    _ANOMALY_FEATURE_COLS,
)
from .anomalies import _handle_detect_anomalies, _handle_visualize_anomalies
from .diagnostics import (
    _handle_validate_data,
    _handle_explore_distributions,
    _handle_find_outliers,
    _handle_diagnose_clustering,
    _handle_compare_datasets,
    _handle_export_debug_sample,
    _handle_repair_schema,
)
from .analysis import (
    _handle_analyze_patterns,
    _handle_analyze_temporal,
    _handle_analyze_fft,
    _handle_analyze_tls_health,
    _handle_analyze_geo_distribution,
    _handle_analyze_entity_detail,
)
from .data_mgmt import (
    _handle_list_datasets,
    _handle_drop_dataset,
    _handle_clone_dataset,
)
from .distance_matrix import _handle_compute_distance_matrix

__all__ = [
    # Helpers
    '_json_size', '_truncate_response', '_build_filter_expr', '_resolve_dataset',
    '_count_rows', '_get_numeric_columns', 'NUMERIC_DTYPES', 'NUMERIC_TYPE_NAMES',
    # Registry + dispatch
    'get_tools_meta', 'handle_call',
    # Load
    '_handle_load_data',
    # Profile
    '_handle_profile_data',
    # Filter
    '_handle_filter_data',
    # Preprocess
    '_handle_preprocess_data',
    # Clustering
    '_handle_run_clustering', '_handle_filter_and_cluster',
    # Evaluate
    '_handle_evaluate_clustering',
    # Features
    '_handle_extract_features', '_save_features_to_db',
    # Export
    '_handle_export_results',
    # Entities
    '_handle_build_entity_profiles', '_handle_compute_scores', '_add_adaptive_scores',
    '_ENTITY_KEYWORDS', '_NUMERIC_TYPES_FOR_AGG', '_ANOMALY_FEATURE_COLS',
    # Anomalies
    '_handle_detect_anomalies', '_handle_visualize_anomalies',
    # Diagnostics
    '_handle_validate_data', '_handle_explore_distributions', '_handle_find_outliers',
    '_handle_diagnose_clustering', '_handle_compare_datasets',
    '_handle_export_debug_sample', '_handle_repair_schema',
    # Analysis
    '_handle_analyze_patterns', '_handle_analyze_temporal', '_handle_analyze_fft',
    '_handle_analyze_tls_health', '_handle_analyze_geo_distribution',
    '_handle_analyze_entity_detail',
    # Data management
    '_handle_list_datasets', '_handle_drop_dataset', '_handle_clone_dataset',
    # Distance matrix
    '_handle_compute_distance_matrix',
]
