// Allow stderr for warning messages in config parsing
#![allow(clippy::print_stderr)]

pub mod config;
pub mod context;
pub mod enable;
pub mod framework;
pub mod input;
pub mod model;
pub mod time;
pub mod util;

// Re-export from config (including OTel configuration and directory management)
pub use config::{
    CURRENT_TUI_CONFIG_VERSION, Config, ConfigSource, DEFAULT_HISTORY, DEFAULT_OTEL_PORT,
    EXAMPLE_THEME_FILENAME, EXAMPLE_THEME_NAME, HooksConfig, OTEL_ENV_KEYS, OtelConfig, OtelMode,
    StorageConfig, TuiColumnProfile, TuiConfig, TuiSortSpec, core_config_path, db_path,
    ensure_initialized, generate_otel_env, mi6_dir, parse_history, themes_dir,
};

// Re-export from model (including all error types)
pub use model::{
    ApiStats, BoxError, ConfigError, Event, EventBuilder, EventOrder, EventQuery, EventType,
    FrameworkResolutionError, InitError, Mi6Error, Order, ScanError, Session, SessionOrder,
    SessionQuery, SessionStatus, Storage, StorageError, StorageStats, StorageStatsQuery,
    StringError, TranscriptError, TtlParseError,
};

// Re-export from framework (including installation)
pub use framework::{
    ClaudeAdapter, CodexAdapter, ConfigFormat, FrameworkAdapter, FrameworkResolutionMode,
    GeminiAdapter, InitOptions, InitResult, InstallHooksResult, ParsedHookInput,
    UninstallHooksResult, all_adapters, default_adapter, detect_all_frameworks, detect_framework,
    generate_config, get_adapter, initialize, initialize_all, installed_frameworks,
    json_to_toml_string, resolve_frameworks,
};

// Re-export from context
pub use context::{
    ClaudeProcessInfo, GitBranchInfo, GitContextUpdate, extract_context, find_claude_process,
    get_branch_info, get_current_branch, get_github_repo, get_local_git_dir, get_parent_pid,
    get_worktree_root, is_branch_changing_command, is_process_alive, parse_branch_info,
    parse_github_repo_from_remote_url,
};
// Deprecated re-export for backwards compatibility
#[expect(
    deprecated,
    reason = "re-exporting deprecated type alias for backwards compatibility"
)]
pub use context::SessionContextUpdate;

// Re-export from input
pub use input::{
    CodexEventType, CodexSessionEntry, CodexSessionParser, CodexSessionScanner,
    ExportLogsServiceRequest, FilePosition, ParsedApiRequest, ParsedCodexEvent, ScanResult,
    SessionMeta, TranscriptEntry, TranscriptParser, TranscriptScanner, codex_sessions_dir,
    extract_first_prompt, extract_session_id_from_filename, find_session_file,
    list_session_files_in_dir, process_logs_request,
};

// Re-export from time
pub use time::{format_timestamp, parse_timestamp_millis, timestamp_millis};

// Re-export from util
pub use util::truncate_string;

// Re-export from enable (high-level API)
pub use enable::{
    DisableResult, EnableError, EnableResult, FrameworkDisablement, FrameworkEnablement,
    FrameworkFailure, PreviewResult, disable, disable_with_options, enable, preview_enable,
};
