# reasonkit-think — use `just` per project conventions (CONS-017)

default:
    @just --list

build:
    CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-{{justfile_directory()}}/target}" cargo build --release

check:
    CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-{{justfile_directory()}}/target}" cargo fmt --check
    CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-{{justfile_directory()}}/target}" cargo clippy -- -D warnings
    CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-{{justfile_directory()}}/target}" cargo test

fmt:
    CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-{{justfile_directory()}}/target}" cargo fmt

# Rebuild release binary + validate workspace MCP wiring + smoke test.
mcp-refresh:
    #!/usr/bin/env bash
    set -euo pipefail
    ROOT="{{justfile_directory()}}"
    CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-$ROOT/target}" cargo build --release
    python3 -m json.tool "$ROOT/../.mcp.json" >/dev/null
    test -x "$ROOT/target/release/reasonkit-think-mcp"
    python3 "$ROOT/scripts/smoke_test.py"
    echo "reasonkit-think MCP refresh OK"

# Re-fetch reference implementation (optional; shallow)
bootstrap-reference:
    #!/usr/bin/env bash
    set -euo pipefail
    REF="reference/mcp-sequentialthinking-tools"
    rm -rf "$REF"
    git clone --depth 1 https://github.com/spences10/mcp-sequentialthinking-tools.git "$REF"
    rm -rf "$REF/.git"
