@leafarcade/cli 0.9.0 → 0.10.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 +1 -1
- package/dist/cli.mjs +1443 -580
- package/package.json +2 -2
- package/skills/leafarcade/SKILL.md +5 -3
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafarcade/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "Create private browser board games and play with your AI agent. Includes
|
|
5
|
+
"description": "Create private browser board games and play with your AI agent. Includes 56 games and an installable Codex/Claude skill.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
8
|
"leafarcade": "dist/cli.mjs"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: leafarcade
|
|
3
|
-
description: Play Leaf Arcade board and card games (Connect Four, chess, checkers and
|
|
3
|
+
description: Play Leaf Arcade board and card games (Connect Four, chess, checkers and 53 more) with a human through the Leaf Arcade CLI. Use when the human asks to play a game with you, sends a leafarcade.com link or room code, or asks you to set up a table. Create a private table from the terminal, give the human the browser link, and play through seat-specific state and legal actions.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
Use `leafarcade` when installed, otherwise `npx @leafarcade/cli@latest` (Node.js 24+). No model API key or account is needed. Games are unranked and have no clock.
|
|
@@ -24,7 +24,7 @@ leafarcade game create --game connect-four --name "My agent" # add --open on
|
|
|
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.
|
|
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`. Long move lists (more than 80, such as Gomoku or Amazons) are grouped in `--brief`: `{"type":"place","row":3,"column_choices":[1,2,5]}` means row 3 with any of those columns; send one value (`--row 3 --column 2`). Drop `--brief` once if you need the full position: player list, raw state or rules.
|
|
28
28
|
|
|
29
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.
|
|
30
30
|
|
|
@@ -35,12 +35,14 @@ When the human already has a room code, use `leafarcade join ROOMCODE --name "My
|
|
|
35
35
|
## The play loop
|
|
36
36
|
|
|
37
37
|
- **Wait on the table yourself.** After your move, use `play --wait` or `game wait`. Never ask the human to tell you they moved.
|
|
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
|
|
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 latest move in board games with `by_seat` and any `captured` squares (null in most card games; read `changed_since_last_read` there). In `legal_actions`, rows, columns, pits and edges count from 1, as the move flags do; the zero-based `at` in the help is the wire form the CLI converts to. Some games add hints: `rule_notes` (rules in force now, such as Thousand's 800 rule, three-check counts or the Dice upper bonus), `gin_deadwood` and `sixty_six_unseen` (cards you have not seen this deal).
|
|
39
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?
|
|
40
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
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
42
|
- `changed_since_last_read` lists what moved since your previous read of this seat, such as the opponent's card or bid.
|
|
43
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
|
+
- Colour games (chess family, draughts, reversi, Go, shogi, xiangqi, gomoku, hex, Amazons, Lines of Action, Fanorona, mills) keep `visible_state` and `board_legend` in side order: side 0 moves first. `you.side` and `you.colour` say which you play. A rematch swaps colours, so the seat that was White plays Black next.
|
|
45
|
+
- Mahjong: after each discard, only a seat that can claim the tile is asked: its `legal_wire_actions` list the claims (win, kong, pung, chow) and `pass`, while other seats see no turn until the claims settle. Binairo Race has no turns: both seats work at once and send the whole grid as `{"type":"submit","text":"…64 characters of 0 and 1…"}`; a wrong grid locks you out for 10 s times your wrong checks (`visible_state.lockedUntil`).
|
|
44
46
|
- 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.
|
|
45
47
|
- `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.
|
|
46
48
|
- Stop on `paused` or `finished`. Report the result. Never start a rematch or a new table unless the human asks.
|