[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "agent-aegis"
version = "0.4.2"
description = "Auto-instrument AI agent frameworks with operational governance. One line to govern LangChain, CrewAI, OpenAI, Anthropic — injection blocking, PII masking, action policy, audit trail. Zero code changes."
readme = "README.md"
license = "MIT"
requires-python = ">=3.11"
authors = [{ name = "Acacian" }]
keywords = [
    "ai", "agent", "governance", "policy", "approval", "audit",
    "auto-instrumentation", "guardrails", "prompt-injection", "pii-detection",
    "langchain", "crewai", "openai", "anthropic", "safety",
    "mcp", "cost-management", "supply-chain-security", "a2a", "observability",
]
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Topic :: Software Development :: Libraries :: Python Modules",
    "Topic :: Scientific/Engineering :: Artificial Intelligence",
    "Topic :: Security",
    "Typing :: Typed",
]
dependencies = ["pyyaml>=6.0"]

[project.urls]
Homepage = "https://github.com/Acacian/aegis"
Documentation = "https://acacian.github.io/aegis/"
Playground = "https://acacian.github.io/aegis/playground/"
Repository = "https://github.com/Acacian/aegis"
Issues = "https://github.com/Acacian/aegis/issues"
Discussions = "https://github.com/Acacian/aegis/discussions"
Changelog = "https://github.com/Acacian/aegis/blob/main/CHANGELOG.md"

[project.optional-dependencies]
playwright = ["playwright>=1.40"]
langchain = ["langchain-core>=0.2"]
crewai = ["crewai>=0.50"]
openai-agents = ["openai-agents>=0.1"]
anthropic = ["anthropic>=0.30"]
httpx = ["httpx>=0.27"]
mcp = ["mcp>=1.0"]
server = ["starlette>=0.37", "uvicorn>=0.29"]
redis = ["redis>=5.0"]
postgres = ["asyncpg>=0.29"]
all = [
    "playwright>=1.40",
    "langchain-core>=0.2",
    "crewai>=0.50",
    "openai-agents>=0.1",
    "anthropic>=0.30",
    "httpx>=0.27",
    "mcp>=1.0",
    "starlette>=0.37",
    "uvicorn>=0.29",
    "redis>=5.0",
    "asyncpg>=0.29",
]
dev = [
    "pytest>=8.0",
    "pytest-asyncio>=0.23",
    "pytest-cov>=5.0",
    "ruff>=0.3",
    "mypy>=1.10",
    "types-PyYAML>=6.0",
    "playwright>=1.40",
    "httpx>=0.27",
    "starlette>=0.37",
    "uvicorn>=0.29",
    "jsonschema>=4.0",
]

[project.scripts]
aegis = "aegis.cli.main:main"
aegis-mcp-server = "aegis.mcp_server:main"

[tool.hatch.build.targets.wheel]
packages = ["src/aegis"]

[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"

[tool.ruff]
target-version = "py311"
line-length = 99

[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "SIM"]

[tool.coverage.run]
source = ["aegis"]

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "if TYPE_CHECKING:",
    "if __name__ ==",
    "raise NotImplementedError",
    "\\.\\.\\.",
]

[tool.mypy]
python_version = "3.11"
strict = true
warn_return_any = true
warn_unused_configs = true

[[tool.mypy.overrides]]
module = ["playwright.*", "langchain_core.*", "crewai.*", "agents.*", "httpx.*", "mcp.*", "starlette.*", "uvicorn.*", "redis.*", "asyncpg.*", "anthropic.*", "openai.*"]
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = ["aegis.mcp_server", "aegis.adapters.openai_agents"]
disallow_untyped_decorators = false

[[tool.mypy.overrides]]
module = ["aegis.runtime.audit_redis", "aegis.core.rate_limiter_redis"]
warn_unused_ignores = false

[[tool.mypy.overrides]]
module = ["aegis.integrations.patch_openai", "aegis.integrations.patch_anthropic"]
warn_unused_ignores = false
