@leafarcade/cli 0.3.0 → 0.4.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 CHANGED
@@ -1,8 +1,9 @@
1
+ <!-- Next release: 0.4.0; new table additions are local until deployed. -->
1
2
  # Leaf Arcade CLI
2
3
 
3
4
  Let your own agent play a private board-game room while you use the browser board. The CLI reads positions and submits moves; it does not call a model, collect model credentials or implement its own opponent.
4
5
 
5
- **Scope of 0.3.0:** all 50 multiplayer games in unclocked, unrated rooms that admit agents. Nine games expose complete convenience move lists; Euchre, Cribbage and Fanorona expose complete legal wire actions. The others expose player-visible state and game-specific JSON action formats, validated by the game service. For these new games, use this release’s CLI with the matching game-service deployment. Local automatic play is available through the watcher below. OAuth login, seat-scoped pairing and resuming a stopped desktop chat are not implemented. Approval-only private tables require the host to approve a joining player before that seat is admitted. Invite-only tables admit players holding the invitation. Spectator and agent admission follow the host’s settings.
6
+ **Scope of 0.4.0 (next release):** all 53 multiplayer games in unclocked, unrated rooms that admit agents. Nine games expose complete convenience move lists; Amazons, Lines of Action, The Last Greenhouse, Euchre, Cribbage and Fanorona expose complete legal wire actions. The others expose player-visible state and game-specific JSON action formats, validated by the game service. For these new games, use this release’s CLI with the matching game-service deployment. Local automatic play is available through the watcher below. OAuth login, seat-scoped pairing and resuming a stopped desktop chat are not implemented. Approval-only private tables require the host to approve a joining player before that seat is admitted. Invite-only tables admit players holding the invitation. Spectator and agent admission follow the host’s settings.
6
7
 
7
8
  ## Start a game from your agent
8
9
 
@@ -286,3 +287,7 @@ leafarcade game decline --room ROOMCODE --revision R --request REQUEST_ID
286
287
 
287
288
  Discovery does not automatically join, play, poll or wake an agent. These commands require a service that supports public/private admission; the
288
289
  default Leaf Arcade service provides it.
290
+
291
+ ### Next release tables
292
+
293
+ Amazons and Lines of Action accept atomic `move` actions from `legal_wire_actions`. The Last Greenhouse is a cooperative five-room adventure: `share`, `pass`, and `choose` with `at: 0..3`. Only your private journal and shared observations are visible. Wrong answers remain in legal choices. Private table approval works like other games; no hosted AI or account is required. These three additions require the matching next server release.
package/dist/cli.mjs CHANGED
@@ -3576,6 +3576,9 @@ import { randomUUID } from "node:crypto";
3576
3576
 
3577
3577
  // lib/multiplayer/ids.ts
3578
3578
  var multiplayerIds = [
3579
+ "amazons",
3580
+ "lines-of-action",
3581
+ "last-greenhouse",
3579
3582
  "euchre",
3580
3583
  "cribbage",
3581
3584
  "fanorona",
@@ -3742,6 +3745,9 @@ function owareMoves(s) {
3742
3745
 
3743
3746
  // lib/multiplayer/catalog.ts
3744
3747
  var multiplayerGames = [
3748
+ { "id": "amazons", "name": "Amazons", "symbol": "\u265B", "players": "2 players", "description": "Claim territory with queens and arrows. Every move reshapes the board.", "rules": "Four queens per player on a 10 by 10 board. Player 1 starts at A4,D1,G1,J4; Player 2 at A7,D10,G10,J7. Move a queen any unobstructed distance horizontally, vertically or diagonally, then shoot an arrow from its destination along another unobstructed queen line. The arrow permanently blocks its square; it can land on the square just vacated. Complete both steps as one turn. A player with no queen move loses. JSON move uses numeric zero-based row-major from/to and amount for the arrow, 0\u201399. Exact legal wire actions are supplied to the active player." },
3749
+ { "id": "lines-of-action", "name": "Lines of Action", "symbol": "\u25CF", "players": "2 players", "description": "Bring your scattered stones together in a tactical race for connection.", "rules": "Claude Soucie\u2019s 8 by 8 connection game. Player 1 has six stones on each horizontal edge, Player 2 six on each vertical edge, with corners empty. Move any stone in one straight line exactly as many squares as there are stones of either color on that entire line. Jump over friendly stones but never enemies. Capture an enemy at the destination; never land on a friendly stone. Connect all your remaining stones into one group using orthogonal or diagonal adjacency to win; a single stone is connected. This edition awards simultaneous connection to the mover. An immobile player passes automatically; both immobile or three repetitions with the same player to move draw. This bounded-table edition also draws after 512 moves without connection. JSON move uses numeric row-major from/to, 0\u201363. Exact legal actions are listed." },
3750
+ { "id": "last-greenhouse", "name": "The Last Greenhouse", "symbol": "\u2667", "players": "2 players \xB7 cooperative", "description": "Two private journals. Five locked rooms. Save the last seed bank together.", "rules": "An original cooperative escape-room story for two keepers. Read your private journal and compare it with your partner\u2019s observation to solve each room. Share publishes your current observation to both players; Pass hands the controls to your partner; Choose selects setting at 0\u20133 from the visible room options. Every action hands over the controls. Wrong answers are safe to retry and are included in the legal-action list. Complete the atrium, prism gallery, seed archive, pump room and dawn canopy together. Only your own private journal and shared notes are projected; spectators see no private journal. Local handoff conceals journals between turns. No competitive rating or Quick Play." },
3745
3751
  { id: "euchre", name: "Euchre", symbol: "J", players: "4 players \xB7 2 teams", description: "Call trump, trust your partner, or take all five tricks alone.", rules: "Four players in opposite-seat partnerships. A 24-card deck uses 9 through ace. Each player receives five cards and one card is turned up. Starting left of dealer, order the turned suit or pass. If ordered, the dealer picks up the upcard and discards one card face down. After four passes, call any other suit; four more passes produce a fresh deal with the next dealer. A caller may go alone: their partner sits out. Left of dealer leads, skipping a sitting partner. Follow suit when possible. The trump jack is highest, followed by the other jack of the same color (the left bower, which belongs to trump), then A,K,Q,10,9 of trump. Other suits rank A,K,Q,J,10,9. Trick winner leads. Makers score 1 for three or four tricks, 2 for all five together, or 4 for all five alone. Defenders score 2 if makers take fewer than three. First team to 10 wins. No stick-the-dealer, joker or defensive lone hands. Hands and kitty remain private. Legal actions are enumerated for the active seat." },
3746
3752
  { id: "cribbage", name: "Cribbage", symbol: "121", players: "2 players", description: "Choose your crib. Peg the count. Race to 121.", rules: "Two-player six-card cribbage with a standard deck. Aces are low. Each player discards two cards face down to the dealer's crib; the starter is revealed after both discard. A starter jack gives the dealer two points. Non-dealer leads pegging: play one card without exceeding 31, or say Go only when no card fits. Fifteen and thirty-one score two; consecutive pairs, triples and quads score two, six and twelve; the longest trailing run scores its length. The last card before a reset scores one except at 31. After a Go/reset the opponent of the last player leads if holding cards. Count non-dealer's hand, dealer's hand, then crib: fifteens, pairs, longest runs with multiplicities, four/five-card hand flushes, five-card-only crib flush, and one for a jack matching the starter's suit. Counting is automatic; no muggins. Dealer alternates. First to reach 121 at any scoring event wins immediately. Hidden cards and crib stay private until counting; spectators see only public cards. Exact legal JSON actions are supplied in visible_state.legalActions for the active player." },
3747
3753
  { id: "fanorona", name: "Fanorona", symbol: "\u2194", players: "2 players", description: "Approach or withdraw. One move can capture a whole line.", rules: "Two players on the traditional 9 by 5 connected-point board, twenty-two stones each. Player 1 starts. Move one stone along a drawn line to an adjacent empty point. Captures are compulsory when available: approach captures the consecutive enemy line beyond the destination; withdrawal captures the consecutive enemy line behind the starting point. Choose one when both apply. After a capture you may continue with the same stone or Stop. A capture sequence cannot revisit a point or repeat the immediately preceding direction. A non-capturing move is allowed only when no capture exists. Capture every opposing stone or leave the opponent without a move to win. This implementation draws at three repetitions of the same position with the same player to move, or eighty completed turns without a capture. Intersections are zero-based row-major: top-left 0, bottom-right 44. JSON move uses from/to plus amount 0 for approach or a quiet move, 1 for withdrawal; stop ends an optional continuation. Exact legal actions are supplied in visible_state.legalActions." },
@@ -4343,11 +4349,25 @@ var action_catalog_default = {
4343
4349
  "discard",
4344
4350
  "play",
4345
4351
  "next"
4352
+ ],
4353
+ amazons: [
4354
+ "move"
4355
+ ],
4356
+ "lines-of-action": [
4357
+ "move"
4358
+ ],
4359
+ "last-greenhouse": [
4360
+ "share",
4361
+ "pass",
4362
+ "choose"
4346
4363
  ]
4347
4364
  };
4348
4365
 
4349
4366
  // lib/agents/action-help.ts
4350
4367
  var help = {
4368
+ amazons: "move: numeric from/to 0\u201399 and amount for the arrow square. Select an exact legal_wire_actions entry.",
4369
+ "lines-of-action": "move: numeric from/to 0\u201363. Move the count of all stones along the full line; enemy stones block jumping.",
4370
+ "last-greenhouse": "share: publish your current private journal observation. pass: hand controls to partner. choose: at 0\u20133 selects a room setting. All choices are listed, including incorrect answers. Cooperate using both journals.",
4351
4371
  euchre: "Use visible_state.legalActions. trump: amount 0 clubs, 1 diamonds, 2 hearts, 3 spades; promotion alone optionally sits your partner out. pass declines trump. discard/play: at is a held card ID, not a hand index. IDs are suit*6+rank, ranks 0\u20135 mean 9,10,J,Q,K,A. The left bower belongs to trump for following suit. next deals after a hand. Partners are opposite seats; first team to 10 wins.",
4352
4372
  cribbage: "Use visible_state.legalActions: discard has exactly two distinct card IDs from your own hand; play has at: card ID; go is legal only when no held card fits under 31; next starts the following deal after counting. Card IDs are suit*13+rank-1, A=1 through K=13; suit order clubs, diamonds, hearts, spades. Crib and opponents' unplayed cards remain hidden.",
4353
4373
  fanorona: "Use visible_state.legalActions: move has numeric from/to intersection indices 0\u201344 (row*9+column), amount 0 for approach/quiet or 1 for withdrawal. stop ends an optional capture continuation. Complete legal wire actions are enumerated; a chain must use the same stone and obey direction/visited constraints.",
@@ -4473,7 +4493,7 @@ function agentPosition(room) {
4473
4493
  paused: room.players.some((p) => p.paused),
4474
4494
  legal_actions_complete: complete,
4475
4495
  legal_actions: yours ? legal : [],
4476
- ...match?.kind === "euchre" || match?.kind === "cribbage" || match?.kind === "fanorona" ? { legal_wire_actions_complete: true, legal_wire_actions: yours ? match.state.legalActions : [] } : {},
4496
+ ...match?.kind === "amazons" || match?.kind === "lines-of-action" || match?.kind === "last-greenhouse" || match?.kind === "euchre" || match?.kind === "cribbage" || match?.kind === "fanorona" ? { legal_wire_actions_complete: true, legal_wire_actions: yours ? match.state.legalActions : [] } : {},
4477
4497
  outcome: room.outcome ? { winner: room.outcome.winner, label: room.outcome.label } : null,
4478
4498
  instructions_for_resume: "Resume your agent chat with this room code and read status. A timeout is not resignation. To rematch, use game rematch; never start one without the human asking.",
4479
4499
  terminal_reason: room.phase === "finished" ? room.players.some((p) => p.left) ? "resignation_or_leave" : "game_result" : null,
@@ -4800,9 +4820,9 @@ async function installSkill(agent = "codex") {
4800
4820
  // packages/cli/package.json
4801
4821
  var package_default = {
4802
4822
  name: "@leafarcade/cli",
4803
- version: "0.3.0",
4823
+ version: "0.4.0",
4804
4824
  private: false,
4805
- description: "Create private browser board games and play with your AI agent. Includes 50 games and an installable Codex/Claude skill.",
4825
+ description: "Create private browser board games and play with your AI agent. Includes 53 games and an installable Codex/Claude skill.",
4806
4826
  type: "module",
4807
4827
  bin: {
4808
4828
  leafarcade: "dist/cli.mjs"
@@ -4869,6 +4889,9 @@ var commands = {
4869
4889
  forget: { usage: "forget --room ROOMCODE", description: "Delete local access only. Does not resign or revoke a credential copied elsewhere. Use game leave to leave the room." }
4870
4890
  };
4871
4891
  var examples = {
4892
+ amazons: "move: numeric from/to 0\u201399 and amount for the arrow square. Select an exact legal_wire_actions entry.",
4893
+ "lines-of-action": "move: numeric from/to 0\u201363. Move the count of all stones along the full line; enemy stones block jumping.",
4894
+ "last-greenhouse": "share: publish your current private journal observation. pass: hand controls to partner. choose: at 0\u20133 selects a room setting. All choices are listed, including incorrect answers. Cooperate using both journals.",
4872
4895
  euchre: "pass | trump --amount 0..3 [promotion alone] | discard/play --at CARD_ID | next. Use legal wire actions; card IDs use 24-card suit*6+rank encoding.",
4873
4896
  cribbage: `--action '{"type":"discard","cards":[0,1]}'`,
4874
4897
  fanorona: `--action '{"type":"move","from":13,"to":22,"amount":0}'`,
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@leafarcade/cli",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "private": false,
5
- "description": "Create private browser board games and play with your AI agent. Includes 50 games and an installable Codex/Claude skill.",
5
+ "description": "Create private browser board games and play with your AI agent. Includes 53 games and an installable Codex/Claude skill.",
6
6
  "type": "module",
7
7
  "bin": {
8
8
  "leafarcade": "dist/cli.mjs"