UV ?= uv
PROFILE ?= default

.DEFAULT_GOAL := help
.PHONY: help sync test audit build package-check check release-check serve

help:
	@printf '%s\n' \
	  'agent-activity development tasks' \
	  '  make sync                 Sync development dependencies' \
	  '  make test                 Run the unittest suite' \
	  '  make audit                Audit locked development dependencies' \
	  '  make build                Build wheel and source distribution' \
	  '  make package-check        Validate and smoke-test the wheel' \
	  '  make check                Run tests and package checks' \
	  '  make release-check        Run the complete release verification' \
	  '  make serve PROFILE=work   Start the stdio MCP server'

sync:
	$(UV) sync --locked --group dev

test:
	$(UV) run --locked --group dev python -m unittest discover -s tests -v

audit:
	$(UV) run --locked --group dev pip-audit --skip-editable

build:
	$(UV) run --locked --group dev python -m build --sdist --wheel

package-check: build
	$(UV) run --locked --group dev twine check dist/*
	$(UV) run --locked --group dev python scripts/smoke_distribution.py dist/*.whl

check: test audit package-check

release-check: check

serve:
	$(UV) run --locked --group dev agent-activity --profile "$(PROFILE)" serve
