.PHONY: test lint typecheck format serve mcp install check clean build publish

# Run tests
test:
	pytest tests/ -v --tb=short

# Lint with ruff
lint:
	ruff check swarm_at/ tests/

# Type check with mypy
typecheck:
	mypy swarm_at/ --ignore-missing-imports

# Format with ruff
format:
	ruff format swarm_at/ tests/

# Run API server with hot reload
serve:
	uvicorn swarm_at.api.main:app --reload

# Run MCP server
mcp:
	python -m swarm_at.mcp

# Install all dev dependencies
install:
	pip install -e ".[dev,server,mcp,cli]"

# Run test, lint, typecheck in sequence
check: test lint typecheck

# Remove build artifacts and caches
clean:
	find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
	rm -rf .mypy_cache dist/ build/ *.egg-info

# Build distribution packages
build:
	python -m build

# Upload to PyPI (requires TWINE_USERNAME and TWINE_PASSWORD)
publish:
	python -m twine upload dist/*
