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

[project]
name = "searchat"
version = "0.6.2"
description = "Semantic search and RAG for local AI coding agent conversations"
authors = [{name = "Searchat Contributors"}]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.10"
keywords = [
    "semantic-search",
    "rag",
    "ai-coding",
    "conversation-search",
    "faiss",
    "duckdb",
    "local-first",
]
classifiers = [
    "Development Status :: 3 - Alpha",
    "Environment :: Console",
    "Environment :: Web Environment",
    "Framework :: FastAPI",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Typing :: Typed",
]

dependencies = [
    "duckdb==1.4.3",
    "pyarrow>=14.0.0",
    "faiss-cpu>=1.7.4",
    "sentence-transformers>=2.3.0",
    "fastapi>=0.100.0",
    "uvicorn>=0.20.0",
    "rich>=13.0.0",
    "tomli>=2.0.1",
    "numpy<2",
    "pandas>=2.0.0",
    "python-dotenv>=1.0.0",
    "watchdog>=3.0.0",
    "litellm>=1.81.3",
    "pygments>=2.17.0",
    "reportlab>=4.2.0",
]

[project.urls]
Homepage = "https://github.com/Mathews-Tom/searchat"
Repository = "https://github.com/Mathews-Tom/searchat.git"
Issues = "https://github.com/Mathews-Tom/searchat/issues"
Changelog = "https://github.com/Mathews-Tom/searchat/blob/master/CHANGELOG.md"

[project.optional-dependencies]

# Backup encryption support (Phase 4)
secure = [
    "cryptography>=42.0.0",
    "keyring>=25.0.0",
]

# MCP support (Phase 2)
mcp = [
    "mcp>=0.1.0",
]

# Embedded LLM support (Phase 3)
embedded = [
    "llama-cpp-python>=0.2.0",
]

# Code-aware symbol extraction (Phase 3)
treesitter = [
    "tree-sitter>=0.21.3",
    "tree-sitter-languages>=1.10.2",
]

# Export formats
pdf = [
    "weasyprint>=60.0",
]
jupyter = [
    "nbformat>=5.9.0",
]

all = [
    "mcp>=0.1.0",
    "llama-cpp-python>=0.2.0",
    "tree-sitter>=0.21.3",
    "tree-sitter-languages>=1.10.2",
    "weasyprint>=60.0",
    "nbformat>=5.9.0",
    "cryptography>=42.0.0",
    "keyring>=25.0.0",
]

# GPU acceleration (NVIDIA CUDA)
# Note: PyTorch CUDA wheels are not on PyPI. Install manually BEFORE installing searchat:
#   uv pip install torch --index-url https://download.pytorch.org/whl/cu124
#   uv pip install -e ".[gpu]"
gpu = [
    "faiss-gpu>=1.7.2",  # GPU-accelerated FAISS (replaces faiss-cpu)
]

[project.scripts]
searchat = "searchat.cli:main"
searchat-web = "searchat.api.app:main"
searchat-mcp = "searchat.mcp.server:run"
searchat-setup-index = "searchat.cli.setup_index:main"
searchat-ghost = "searchat.daemon.ghost:main"

[project.entry-points."searchat.connectors"]
claude = "searchat.core.connectors.claude:ClaudeConnector"
vibe = "searchat.core.connectors.vibe:VibeConnector"
opencode = "searchat.core.connectors.opencode:OpenCodeConnector"
codex = "searchat.core.connectors.codex:CodexConnector"
gemini = "searchat.core.connectors.gemini:GeminiCLIConnector"
continue = "searchat.core.connectors.continue_cli:ContinueConnector"
cursor = "searchat.core.connectors.cursor:CursorConnector"
aider = "searchat.core.connectors.aider:AiderConnector"

[tool.hatch.build.targets.wheel]
packages = ["src/searchat"]
include = [
    "src/searchat/py.typed",
    "src/searchat/config/*.toml",
    "src/searchat/web/index.html",
    "src/searchat/web/static/**",
]

[tool.hatch.build.targets.sdist]
include = [
    "src/**",
    "tests/**",
    "docs/**",
    ".docs/**",
    "README.md",
    "LICENSE",
    "pyproject.toml",
    "CHANGELOG.md",
]

# Pytest configuration moved to pytest.ini for better organization

[tool.coverage.run]
source = ["src/searchat"]
omit = [
    "*/tests/*",
    "*/__main__.py",
    "*/setup.py",
    "*/cli/*.py",
    "*/setup/wizard.py",
    "*/daemon/ghost.py",
    "*/daemon/notify.py",
]

[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = false
exclude_lines = [
    "pragma: no cover",
    "def __repr__",
    "raise AssertionError",
    "raise NotImplementedError",
    "if __name__ == .__main__.:",
    "if TYPE_CHECKING:",
    "@abstractmethod",
]

[dependency-groups]
dev = [
    "pytest>=8.4.2",
    "pytest-asyncio>=1.2.0",
    "pytest-cov>=7.0.0",
    "pytest-mock>=3.11.0",
    "httpx>=0.24.0",
    "build>=1.2.2",
    "twine>=6.2.0",
]
