.PHONY: all build clean test lint fmt run dev local-setup local-mcp eval

all: build

build:
	uv sync

run:
	uv run thread $(ARGS)

dev:
	THREAD_CLOUD_URL=http://localhost:3000 uv run thread $(filter-out $@,$(MAKECMDGOALS))

local-setup:
	./scripts/setup-local-supabase.sh

local-mcp:
	./scripts/thread-mcp

test:
	uv run pytest -v

eval:
	uv run pytest -v -k "eval" tests/

lint:
	uv run ruff check src/ tests/

fmt:
	uv run ruff format src/ tests/

clean:
	rm -rf build/ .pytest_cache/ src/*.egg-info/

# Catch-all so `make dev login` doesn't fail on "login" as a target
%:
	@:
