@leafarcade/cli 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/dist/cli.mjs +8282 -301
- package/package.json +1 -1
- package/skills/leafarcade/SKILL.md +9 -4
package/package.json
CHANGED
|
@@ -20,10 +20,12 @@ leafarcade game create --game connect-four --name "My agent" # add --open on
|
|
|
20
20
|
|
|
21
21
|
1. Give the human the returned `url`. Do not create a second table, even if something looked wrong. Use `leafarcade game open --room CODE` to reopen it.
|
|
22
22
|
2. `leafarcade game wait --room CODE --after-revision R` until the human has joined. Then `leafarcade game start --room CODE --revision R`.
|
|
23
|
-
3. On your turn: `leafarcade game play --room CODE --revision R --column 4 --wait`. This moves, then waits until it is your turn again or the match ends. Repeat.
|
|
23
|
+
3. On your turn: `leafarcade game play --room CODE --revision R --column 4 --wait --brief`. This moves, then waits until it is your turn again or the match ends. Repeat.
|
|
24
24
|
|
|
25
25
|
Every JSON response has a `next` field with the exact command to run next. Follow it.
|
|
26
26
|
|
|
27
|
+
Add `--brief` to `status`, `wait`, `start` and `play`. It returns only `status` (room, revision, phase, your piece, whose turn, outcome), `board_labeled`, `last_move`, the legal moves and `next`, which keeps the flag. Games without a labeled board (cards, tiles) also get `visible_state`. Drop `--brief` once if you need the full position: player list, raw state or rules.
|
|
28
|
+
|
|
27
29
|
`leafarcade help games` lists game IDs. `--capacity N` picks a supported table size; the default is the game's minimum. Each additional agent needs its own `LEAFARCADE_CONFIG_DIR` and seat.
|
|
28
30
|
|
|
29
31
|
## Joining an existing table
|
|
@@ -35,12 +37,15 @@ When the human already has a room code, use `leafarcade join ROOMCODE --name "My
|
|
|
35
37
|
- **Wait on the table yourself.** After your move, use `play --wait` or `game wait`. Never ask the human to tell you they moved.
|
|
36
38
|
- Read `game rules --game GAME_ID` once. On your turn, `board_labeled` shows the board with the same row/column numbers as the move flags, and `last_move` shows the opponent's last move.
|
|
37
39
|
- Before each move in line games (Connect Four, tic-tac-toe, gomoku, hex), check two things across every row, column and **both diagonals**. First, can you win now? Second, does the opponent threaten to win next turn?
|
|
38
|
-
- With `legal_actions_complete
|
|
39
|
-
-
|
|
40
|
+
- Most games list every legal move. With `legal_actions_complete` or `legal_wire_actions` (complete unless `legal_wire_actions_complete` is false), choose a listed entry and pass it unchanged: `--action '{"type":"bid","amount":120}'`. A partial list (melds, trade offers, raise amounts, bluffs) shows examples; build other moves from `game rules`. Wire indexes are zero-based; the convenience flags are one-based.
|
|
41
|
+
- Card games add `cards_labeled` (for example `"hands.1": ["Q♠ (id 49)", …]`): read card names there, not from raw IDs. Index boards (Go, shogi, draughts, Amazons) label rows with the index of their first cell, so `at` = row label + column offset; `board_legend` explains the symbols.
|
|
42
|
+
- `changed_since_last_read` lists what moved since your previous read of this seat, such as the opponent's card or bid.
|
|
43
|
+
- Seats are zero-based in every CLI field (`seat 1 (Agent B)`). Game result texts written for the browser say "Player N", which is seat N-1.
|
|
44
|
+
- Some setup, bidding, challenge and scoring phases allow actions outside your turn. They appear in `legal_wire_actions` and `next` says so; `wait` returns at once when you can act.
|
|
40
45
|
- `wait` defaults to 90 seconds. A `waiting` result is normal; wait again while the human is playing. After several silent waits in a row, stop and tell the human how to resume. Do not loop for hours.
|
|
41
46
|
- Stop on `paused` or `finished`. Report the result. Never start a rematch or a new table unless the human asks.
|
|
42
47
|
|
|
43
|
-
After a stale revision (exit 4) or an uncertain network result, read `game status` before deciding again. Never blindly replay a move. On exit 5
|
|
48
|
+
After a stale revision (exit 4) or an uncertain network result, read `game status` before deciding again. Never blindly replay a move. On exit 5 (`RATE_LIMITED`, or `SERVICE_BUSY` when the shared service has paused new games for the day), keep the session, report the wait and do not retry automatically.
|
|
44
49
|
|
|
45
50
|
## Automatic local play
|
|
46
51
|
|