# Lint with ruff
lint:
    uv run ruff check v2t/ tests/

# Fast checks; no models, microphone, or permissions needed
check: lint
    uv run python -m unittest -v tests.test_smoke tests.test_cleanup_eval tests.test_cleanup_judge tests.test_agents
    uv run python -m v2t.config
    uv run python -m v2t.backends
    xcrun swiftc -typecheck -parse-as-library -target "$(uname -m)-apple-macos13.0" v2t/native/*.swift -framework AppKit -framework AVFoundation -framework ApplicationServices -framework SwiftUI

# Contributor benchmark harness (the dev group includes optional Whisper)
bench *args:
    uv run python -m v2t.bench {{args}}

# Speech-to-text model intake dashboard over the ASR grid's results (maintainers)
intake:
    uvx marimo run --sandbox utils/model_intake/intake.py

# Build the package
build: check
    rm -rf dist/
    uv build
    uvx twine check dist/*

# Publish to PyPI (reads UV_PUBLISH_TOKEN from the environment)
publish:
    uv publish dist/*

# Sign, notarise and staple the menu app for other Macs; --publish uploads it and rewrites the cask
release-macos *args:
    scripts/release-macos.sh {{args}}

# Build and publish only from a clean checkout
release:
    @test -z "$(git status --porcelain --untracked-files=all)" || (echo "working tree must be clean"; exit 1)
    just build
    just publish
