.PHONY: install dev test lint typecheck clean docker-up docker-down

install:
	pip install -e ".[dev]"
	@echo "Installed agensflow-mcp + dev deps."

dev:
	uvicorn agensflow_mcp.app:app --reload --host 0.0.0.0 --port 8000

test:
	pytest -v

test-cov:
	pytest -v --cov=src/agensflow_mcp --cov-report=term --cov-report=html

lint:
	ruff check src tests
	ruff format --check src tests

format:
	ruff format src tests
	ruff check --fix src tests

typecheck:
	mypy src

docker-up:
	docker compose up --build -d
	@echo "Postgres + app running at http://localhost:8000"

docker-down:
	docker compose down

clean:
	find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
	find . -type d -name '.pytest_cache' -exec rm -rf {} + 2>/dev/null || true
	rm -rf htmlcov .coverage .mypy_cache .ruff_cache data/ *.egg-info build/ dist/
