.PHONY: help run test lint format build publish mcp clean

# Default goal
.DEFAULT_GOAL := help

help: ## Show this help message
	@awk 'BEGIN {FS = ":.*##"; printf "Usage: make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf "  \033[36m%-15s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)

run: ## Run the harness_browser module
	uv run python -m harness_browser

test: ## Run test suite with coverage
	uv run pytest tests/ -v --cov=harness_browser --cov-report=term-missing

lint: ## Run ruff check + mypy
	uv run ruff check src/ tests/
	uv run mypy src/

format: ## Format code with ruff
	uv run ruff format src/ tests/

build: ## Build wheel + sdist
	uv build

publish: ## Publish to PyPI
	uv publish

mcp: ## Start the MCP server
	uv run python -m harness_browser.mcp_server

clean: ## Remove build/test artifacts
	rm -rf dist/ build/ .coverage htmlcov/ .mypy_cache/ .ruff_cache/ __pycache__
