#!/usr/bin/env python3
"""cz-kiro-adapter -- Kiro IDE -> Control Zero hook-check bridge (dev shim).

This standalone script is the dev-checkout entry point. The real
implementation lives in ``controlzero.cli.kiro_adapter`` so the installed
wheel can expose it as the ``cz-kiro-adapter`` console script (declared in
pyproject ``[project.scripts]``) -- that is what ``controlzero kiro init``
wires the Kiro IDE hooks to.

Running this file directly (e.g. from a source checkout where the package is
not pip-installed) imports the packaged module by adding the SDK root to
sys.path, so both paths share one implementation. See
docs/integrations/kiro-hook-payloads.md and docs/integrations/kiro.md.
"""

from __future__ import annotations

import os
import sys

try:
    from controlzero.cli.kiro_adapter import main
except ModuleNotFoundError:  # running from a source checkout, package not installed
    _sdk_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    if _sdk_root not in sys.path:
        sys.path.insert(0, _sdk_root)
    from controlzero.cli.kiro_adapter import main


if __name__ == "__main__":
    sys.exit(main())
