"""Platform helpers for CleverAgents."""

from __future__ import annotations

import sys
from importlib import import_module
from types import ModuleType


def ensure_cli_importable() -> ModuleType:
    """Ensure ``cleveragents.cli`` can be imported when running in packaged contexts."""
    module_name = "cleveragents.cli"
    if module_name in sys.modules:
        return sys.modules[module_name]
    module = import_module(module_name)
    return module
