default:
    @just --list

test:
    uv run python -m pytest tests/ -v --tb=short

test-coverage:
    uv run pytest tests/ -v --tb=short --cov=src --cov-report=html --cov-report=term

run:
    uv run python -m src.server

run-http:
    uv run python -m src.server --transport http --host localhost --port 8000

lint:
    @command -v ruff >/dev/null 2>&1 && ruff check src/ tests/ || echo "ruff not available"

format:
    @command -v ruff >/dev/null 2>&1 && ruff format src/ tests/ || echo "ruff not available"

typecheck:
    @command -v basedpyright >/dev/null 2>&1 && basedpyright src/ || echo "basedpyright not available"

# Build package
build:
    uv build

# Publish to TestPyPI
publish-test:
    uv publish --index testpypi

# Publish to PyPI
publish:
    uv publish

# Version bumping
bump-patch:
    uv version patch

bump-minor:
    uv version minor

bump-major:
    uv version major

clean:
    rm -rf build/
    rm -rf dist/
    rm -rf *.egg-info/
    rm -rf .pytest_cache/
    rm -rf .coverage
    rm -rf htmlcov/
    find . -type d -name __pycache__ -exec rm -rf {} +
    find . -type f -name "*.pyc" -delete