Skip to content

Play and automate games with the dotnet chess tool - #19

Open
danspark wants to merge 11 commits into
feat/native-clientsfrom
feat/cli-client
Open

danspark wants to merge 11 commits into
feat/native-clientsfrom
feat/cli-client

Conversation

@danspark

@danspark danspark commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Adds the dotnet chess tool with a drawn Terminal.Gui v2 checkerboard, Unicode chess pieces, and mouse drag-and-drop. The board rotates for the player's side, marks the dragged piece and legal destinations, and offers a promotion chooser. Right-click, Escape, and outside drops cancel dragging. SAN/UCI keyboard input remains available, and all controls fit an 80x24 terminal with a distinct 16-color fallback palette.

Players can create/join/resume games, use random matchmaking, perform draw/resignation actions, and wait for an opponent move. Automation commands emit JSON and can use the saved game or an explicit match ID and side code. Session writes are atomic and private on Unix. Request IDs and expected revisions survive response loss and restarts, and replayed receipts preserve the newest board already observed.

Validation: all 42 CLI tests pass locally against both Akka and Orleans, including actual CLI processes, keyboard and mouse PTY gameplay, Black's rotated board, castling, en passant, knight underpromotion, cancellation, matchmaking, resume, opponent polling, and lost-response recovery. The Release package builds, installs as a .NET tool, and runs dotnet chess help. Real terminal captures at 80x24 and 100x28 show mouse gameplay through checkmate. CI exercises Akka and Orleans.

Drag-and-drop gameplay

The drawn Unicode board plays through Scholar's Mate against a scripted opponent: 1. e4 e5 2. Bc4 Nc6 3. Qh5 Nf6 4. Qxf7#.

cli-drag-gameplay.mp4

Package a Terminal.Gui v2 board and JSON command interface over the shared chess client. Side codes resume games across clients, and automation can target a saved or explicit match and wait for an opponent move without keeping a connection open.

Persist request IDs and expected revisions before mutations so retries survive response loss and process restarts. Twenty tests pass on Akka and Orleans, including actual CLI processes, keyboard-driven PTY moves, matchmaking, resume, waits, and lost responses. CI tests both backends and installs the produced tool package.
@danspark
danspark added this pull request to stack #5 September 14, 2026 14:54
@danspark danspark changed the title feat/cli client Play and automate games with the dotnet chess tool Sep 14, 2026
@danspark
danspark marked this pull request as ready for review September 14, 2026 14:55
The CLI board was a read-only ASCII label, so users had to enter every
move as notation. Render a checkerboard with Unicode pieces and route
mouse drags through the displayed snapshot's legal UCI moves. Keep
SAN/UCI input, side rotation, promotion choice, and cancellation, and
release stale mouse captures when game state changes.

Use an explicit 16-color fallback so selection and legal targets remain
distinct in terminals without true color. Verify the full controls at
80x24 and 100x28 and record mouse gameplay through checkmate.

All 42 CLI tests pass against the live Akka server, including real PTY
mouse input, Black rotation, castling, en passant, underpromotion, and
cancellation. The Release tool package builds and installs successfully.
Carry the native client gesture adapters and verification forward while preserving the existing terminal board and drag controls.
Preserve the native drag initialization fix found by actual Windows CI without changing the terminal client.
Carry the Android test input layout wait and the verified native interaction documentation into the dependent CLI branch. The CLI implementation is unchanged; all 42 CLI tests passed against both backends.
Carry the AppHost prebuild, checked Android screenshot collection, and visible WPF startup placement into the dependent CLI PR. The Windows placement repair follows a controlled runner reproduction of taskbar interception; input delivery and artifact regressions remain enabled.
Carry the native input event-order fix and its real-input regression into the dependent CLI PR while preserving the stack base.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant