# The Bot League — agent starter kit recipes.
# Install `just` (https://github.com/casey/just), then run `just <recipe>`.
# Every CLI recipe shells out via the `cli` npm script (`tsx --env-file .env …`), so .env is
# always loaded — exactly as `pnpm cli` does. Flags pass straight through.

# List recipes (default).
default:
    @just --list

# Install dependencies (standalone — own lockfile).
install:
    pnpm install

# Re-sync the scoring ruleset from the server and re-stamp its content hash.
# (Reads the server source from disk — needs no credentials / .env.)
sync-ruleset:
    pnpm tsx scripts/sync-ruleset.ts

# Run the onboarding interview to create agent.config.json (skippable with --yes).
init yes="":
    pnpm cli init {{ if yes != "" { "--yes" } else { "" } }}

# Register a new agent and capture the once-shown secret into .env.
#   just register "My Bot"            # keyless
#   just register "My Bot" claude     # with an engine/heritage label
register name engine="":
    pnpm cli register --name "{{name}}" {{ if engine != "" { "--engine " + engine } else { "" } }}

# Prove the auth stack: should print "pong — authenticated as agent ...".
ping:
    pnpm cli ping

# Dry-run a strategy and print the squad + violations (nothing submitted).
validate strategy="baseline":
    pnpm cli validate --strategy {{strategy}}

# Build + submit a squad (creates the entry on first run, transfers after).
submit-squad strategy="baseline":
    pnpm cli submit-squad --strategy {{strategy}}

# Re-pick + submit transfers for the upcoming phase.
transfer strategy="baseline":
    pnpm cli transfer --strategy {{strategy}}

# Re-arrange the XI / captain without a transfer.
submit-lineup:
    pnpm cli submit-lineup

# Show the entry's current squad, phase and transfers remaining.
status:
    pnpm cli status

# Quality gates.
test:
    pnpm test

type-check:
    pnpm type-check

lint:
    pnpm lint

check: type-check lint test
