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

[project]
name = "context-engine"
version = "0.1.0"
description = "Long-term memory infrastructure for AI Agents"
readme = "README.md"
license = { text = "Apache-2.0" }
requires-python = ">=3.11"
authors = [
    { name = "ContextEngine Team" }
]
keywords = ["ai", "agents", "memory", "llm", "rag"]
classifiers = [
    "Development Status :: 3 - Alpha",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: Apache Software License",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Topic :: Scientific/Engineering :: Artificial Intelligence",
]

dependencies = [
    "psycopg2-binary>=2.9.0",
    "pyagfs>=1.4.0",
    "openai>=1.0.0",
    "apscheduler>=3.10.0",
    "jinja2>=3.1.0",
    "pyyaml>=6.0",
    "flask>=3.0.0",
    "gunicorn>=21.0.0",
    "rich>=13.0.0",
    "httpx>=0.25.0",
    "requests>=2.28.0",
    "python-dotenv>=1.0.0",
    "json-repair>=0.7.0",
    "rank-bm25>=0.2.2",
    "nltk>=3.9.4",
]

[project.scripts]
ogmem = "cli.main:main"

[project.optional-dependencies]
dev = [
    "pytest>=8.0",
    "pytest-asyncio>=0.24",
    "pytest-cov>=5.0",
    "ruff>=0.1.0",
    "mypy>=1.0.0",
]
opengauss = []  # psycopg2-binary now in core dependencies
chroma = ["chromadb>=0.4.0"]
sentence-transformers = ["sentence-transformers>=2.0.0"]

# E2E eval dependencies
e2e = [
    "matplotlib>=3.5.0",
    "numpy>=1.21.0",
]

# All extras
all = [
    "context-engine[opengauss,chroma,sentence-transformers]",
]

[project.urls]
Homepage = "https://gitcode.com/opengauss/oGMemory"
Documentation = "https://gitcode.com/opengauss/oGMemory/blob/dev/README.md"
Repository = "https://gitcode.com/opengauss/oGMemory.git"
Issues = "https://gitcode.com/opengauss/oGMemory/issues"

[tool.hatch.build.targets.wheel]
packages = [
    "cli",
    "core",
    "fs",
    "extraction",
    "commit",
    "index",
    "retrieval",
    "providers",
    "service",
    "server",
    "session",
]

[tool.hatch.build.targets.sdist]
include = [
    "/README.md",
    "/LICENSE",
    "/core",
    "/fs",
    "/extraction",
    "/commit",
    "/index",
    "/retrieval",
    "/providers",
    "/service",
    "/server",
    "/session",
]

[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
addopts = "--tb=short"
markers = [
    "integration: marks tests as integration tests (require AGFS or full setup)",
]

[tool.coverage.run]
source = ["core", "fs", "extraction", "commit", "index", "retrieval", "providers", "service"]
omit = ["tests/*"]

# Ruff linting configuration
[tool.ruff]
line-length = 100
target-version = "py311"

[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "UP"]
ignore = ["E501"]  # line-length handled by formatter

[tool.ruff.lint.isort]
known-first-party = ["core", "fs", "extraction", "commit", "index", "retrieval", "providers", "service"]

# MyPy configuration
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
[[tool.mypy.overrides]]
module = "pyagfs.*"
ignore_missing_imports = true