[build-system]
requires = ["hatchling>=1.18,<2.0"]
build-backend = "hatchling.build"

[project]
name = "truememory"
version = "0.7.6.2"
description = "SOTA-level agent memory at zero infrastructure cost."
readme = "README.md"
license = "AGPL-3.0-only"
requires-python = ">=3.10"
authors = [
    { name = "@Building_Josh" },
]
keywords = ["memory", "ai", "agents", "llm", "rag", "sqlite", "locomo", "mcp", "embeddings"]
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Topic :: Scientific/Engineering :: Artificial Intelligence",
    "Typing :: Typed",
]

dependencies = [
    "model2vec>=0.6.0,<1.0",
    "sqlite-vec>=0.1.0,<1.0",
    "numpy>=1.24.0,<3.0",
    "mcp[cli]>=1.0.0,<2.0",
    "httpx>=0.27.0,<1.0",
    "sentence-transformers>=3.0.0,<6.0",
    "torch>=2.0.0,<3.0",
    "anthropic>=0.80.0,<1.0",
    "psutil>=5.9,<8.0",
    "setproctitle>=1.3,<2.0",
    "packaging>=21.0",
]

[project.optional-dependencies]
# gpu/reranker/agentic kept as empty aliases so existing
# `pip install truememory[gpu]` or `truememory[agentic]` still work.
reranker = []
gpu = []
agentic = []
# A2-1 (#696): HDBSCAN scene clustering is an optional feature — clustering.py
# imports `hdbscan` lazily and degrades gracefully when absent. Declare it as an
# extra so `pip install truememory[clustering]` resolves it, instead of users
# guessing the off-resolver package name from a docstring.
clustering = ["hdbscan>=0.8,<0.9"]
dev = ["pytest>=7.0,<10.0", "pytest-timeout>=2.2,<3.0", "ruff>=0.4,<1.0", "build>=1.2,<2.0", "twine>=5.0,<7.0"]
all = ["truememory[agentic,clustering]"]

[project.scripts]
truememory-mcp = "truememory.mcp_server:main"
truememory-ingest = "truememory.ingest.cli:main"
truememory-model-server = "truememory.model_server:main"

[tool.setuptools.package-data]
truememory = ["assets/*.icns"]

[project.urls]
Homepage = "https://github.com/buildingjoshbetter/TrueMemory"
Repository = "https://github.com/buildingjoshbetter/TrueMemory"
Documentation = "https://github.com/buildingjoshbetter/TrueMemory#readme"
Issues = "https://github.com/buildingjoshbetter/TrueMemory/issues"
Changelog = "https://github.com/buildingjoshbetter/TrueMemory/blob/main/CHANGELOG.md"

[tool.pytest.ini_options]
testpaths = ["tests"]
# Issue #426: register custom markers and fail on typos so the gate can
# reliably exclude network/model-download tests via `-m "not network"`.
addopts = "--strict-markers --timeout=120"
markers = [
    "network: test performs real network I/O (e.g. HuggingFace model download). Excluded from the deterministic CI gate via `-m \"not network\"`; run in a dedicated non-gating job.",
]

[tool.ruff.lint]
# Default ruleset is fine for the core codebase. Per-file ignores below.

[tool.ruff.lint.per-file-ignores]
# __init__.py files re-export submodule symbols as the public API. Ruff
# flags these as F401 ("imported but unused") because they aren't consumed
# inside the file itself — but they ARE the file's purpose. Standard
# idiom is to ignore F401 for __init__ modules.
"__init__.py" = ["F401"]
"truememory/reranker.py" = ["E402"]
"truememory/vector_search.py" = ["E402"]

[tool.hatch.build.targets.wheel]
packages = ["truememory"]

# CLAUDE_TEMPLATE.md lives inside the package at truememory/ingest/CLAUDE_TEMPLATE.md
# so it's auto-included in the wheel — no force-include needed.

[tool.hatch.build.targets.sdist]
# Explicit exclude list so the sdist stays tight (~400KB compressed instead of 36MB).
# Without these, hatchling ships every untracked non-gitignored file including
# _working/ (149MB of paper drafts, audit logs, bench archives).
exclude = [
    "/_working",
    "/tests",  # A2-4 (#697): tests are not needed in the source distribution
    "/.claude",
    "/dist",
    "/build",
    "/.venv",
    "/.venv*",
    "/.pytest_cache",
    "/.ruff_cache",
    "/.github",
    "/install.sh",
    "/assets/charts/*.html",
    "/assets/charts/*.png",
    # Hunter F36: exclude all benchmarks from sdist (used to exclude only the
    # 44MB locomo10.json and results/; the Modal bench scripts still shipped,
    # amplifying doc-drift findings like F13/F18 to PyPI source-download users).
    # Users who want to reproduce benchmarks clone the repo.
    "/benchmarks",
    "*.pyc",
    "__pycache__",
    ".DS_Store",
]
