[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "inter-agent-trust-protocol"
version = "0.5.0"
description = "Inter-Agent Trust Protocol (IATP) - The Envoy for AI Agents. A sidecar architecture with typed IPC pipes for preventing cascading hallucinations in autonomous agent networks."
readme = "README.md"
license = {text = "MIT"}
requires-python = ">=3.8"
authors = [
    {name = "Imran Siddique", email = "imran@example.com"}
]
maintainers = [
    {name = "Imran Siddique", email = "imran@example.com"}
]
keywords = [
    "agent",
    "ai",
    "llm",
    "trust",
    "security",
    "sidecar",
    "mesh",
    "governance",
    "policy",
    "hallucination",
    "multi-agent",
    "protocol",
]
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "Intended Audience :: Science/Research",
    "Topic :: Software Development :: Libraries :: Python Modules",
    "Topic :: System :: Distributed Computing",
    "Topic :: Security",
    "Topic :: Scientific/Engineering :: Artificial Intelligence",
    "License :: OSI Approved :: MIT License",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.8",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Operating System :: OS Independent",
    "Typing :: Typed",
]

dependencies = [
    "fastapi>=0.109.1",
    "uvicorn>=0.27.0",
    "pydantic>=2.5.3",
    "httpx>=0.26.0",
    "python-dateutil>=2.8.2",
    "agent-primitives>=0.1.0",
    "click>=8.0.0",
]

[project.optional-dependencies]
dev = [
    "pytest>=7.4.0",
    "pytest-asyncio>=0.21.0",
    "pytest-cov>=4.1.0",
    "mypy>=1.8.0",
    "ruff>=0.1.0",
    "pre-commit>=3.6.0",
]
docs = [
    "mkdocs>=1.5.0",
    "mkdocs-material>=9.5.0",
    "mkdocstrings[python]>=0.24.0",
]
hf = [
    "huggingface-hub>=0.20.0",
    "datasets>=2.16.0",
]
all = [
    "inter-agent-trust-protocol[dev,docs,hf]",
]

[project.urls]
Homepage = "https://github.com/imran-siddique/inter-agent-trust-protocol"
Documentation = "https://github.com/imran-siddique/inter-agent-trust-protocol#readme"
Repository = "https://github.com/imran-siddique/inter-agent-trust-protocol.git"
Issues = "https://github.com/imran-siddique/inter-agent-trust-protocol/issues"
Changelog = "https://github.com/imran-siddique/inter-agent-trust-protocol/blob/main/CHANGELOG.md"

[project.scripts]
iatp = "iatp.cli:cli"

[tool.setuptools]
packages = ["iatp", "iatp.models", "iatp.security", "iatp.sidecar", "iatp.telemetry"]
include-package-data = true

[tool.setuptools.package-data]
"*" = ["py.typed", "*.json"]

# ============================================================================
# Ruff - Fast Python Linter & Formatter
# ============================================================================
[tool.ruff]
target-version = "py38"
line-length = 100
select = [
    "E",      # pycodestyle errors
    "W",      # pycodestyle warnings
    "F",      # Pyflakes
    "I",      # isort
    "B",      # flake8-bugbear
    "C4",     # flake8-comprehensions
    "UP",     # pyupgrade
    "ARG",    # flake8-unused-arguments
    "SIM",    # flake8-simplify
]
ignore = [
    "E501",   # line too long (handled by formatter)
    "B008",   # do not perform function calls in argument defaults
    "B904",   # raise from None
]

[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]  # Allow unused imports in __init__.py
"tests/*" = ["ARG"]       # Allow unused arguments in tests

[tool.ruff.isort]
known-first-party = ["iatp"]

# ============================================================================
# MyPy - Static Type Checking
# ============================================================================
[tool.mypy]
python_version = "3.8"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
follow_imports = "silent"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false

# ============================================================================
# Pytest
# ============================================================================
[tool.pytest.ini_options]
testpaths = ["iatp/tests"]
asyncio_mode = "auto"
addopts = "-v --tb=short"
markers = [
    "slow: marks tests as slow (deselect with '-m \"not slow\"')",
    "integration: marks tests as integration tests",
]

# ============================================================================
# Coverage
# ============================================================================
[tool.coverage.run]
source = ["iatp"]
branch = true
omit = ["iatp/tests/*", "*/__pycache__/*"]

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "def __repr__",
    "raise NotImplementedError",
    "if TYPE_CHECKING:",
    "if __name__ == .__main__.:",
]
show_missing = true
