[PR #1343] [MERGED] horizon-ctl: every player action in the one table (worlds, LAN, friends, options pages...), with a generated reference #3489

Closed
opened 2026-11-03 04:09:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1343
Author: @ludovic111
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @ludovic111

Base: main ← Head: feat/agent-control-game


📝 Commits (5)

  • bcbf860 horizon-ctl: every player action in the one command table, with a generated reference
  • a6e3fca horizon-ctl: interact-entity beside hold, away from the logs arm
  • b62a866 agent_control_e2e manage: the player's position is under player
  • 684ec53 agent_control_e2e manage: close the options with close
  • 3bfb345 horizon-ctl options: the agent page (Horizon Settings > AI Agent)

📊 Changes

10 files changed (+569 additions, -20 deletions)

View changed files

📝 crates/horizon-client/src/bin/horizon-ctl/commands.rs (+213 -11)
📝 crates/horizon-client/src/bin/horizon-ctl/main.rs (+16 -0)
📝 crates/horizon-client/src/bin/horizon-ctl/mcp.rs (+7 -1)
📝 crates/horizon-client/src/game.rs (+1 -0)
📝 crates/horizon-client/src/game/control.rs (+4 -0)
➕ crates/horizon-client/src/game/saves_control.rs (+123 -0)
📝 crates/horizon-client/src/title.rs (+9 -1)
📝 crates/horizon-client/src/title/world_management.rs (+4 -4)
➕ docs/horizon-ctl-commands.md (+140 -0)
📝 tools/agent_control_e2e.py (+52 -3)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

horizon-ctl and horizon-ctl mcp reach every player action of the game (brief agent-control-2, sections 1-3), from the one command table:

  • Into the table (they existed only on the raw socket): options [PAGE] (every page, Horizon's too), connect ADDRESS (a server, or friend:CODE for an invite code), disconnect, lan open|close|status, friends host|stop|status, book, signedit, mount-menu, effect, effects, xp, enchant, potion, fill, container.
  • New commands (game side, game/saves_control.rs):
    • worlds: the saves, newest first (folder, name, mode, last played, version);
    • world-rename FOLDER NAME, world-backup FOLDER (Make Backup's zip, off the game thread), world-delete FOLDER --confirm: the Select/Edit World screens' own functions, from the title screen only; delete needs --confirm on the socket too, and confirm is a required MCP argument;
    • servers: the Multiplayer list (name, address).
  • New in horizon-ctl: interact-entity ID (face it, right-click with the held item: trade, mount, milk, shear).
  • Now MCP tools too: status (F3's overlay flags, renderer, streaming), mouse, pad, release, bench, stats; summon takes a position.
  • MCP annotations: destructiveHint on world_delete, fill, setblock; openWorldHint on connect, lan, friends, chat, command.
  • Generated reference: docs/horizon-ctl-commands.md comes from the table (horizon-ctl help --markdown); a test fails when it is out of date or a command is missing from it.

Everything a mouse and keyboard can do on any screen was already possible through ui, click ID, set ID VALUE, type, key; these give agents direct, checked commands for the rest of the audit's rows.

Tests

  • Unit: table tests (names, schemas, the required confirm, bare-word booleans), the reference test.
  • tools/agent_control_e2e.py --scenario manage (new), CLI and MCP: open a survival world, status, milk a summoned cow with interact-entity, effect/effects, xp, lan status, options horizon + ui, back to the title, worlds, world-backup (zip in backups/), world-rename, world-delete refused without confirm then done with it, servers.

Self-check

Run once on an integration commit of the agent-control PRs (No AI switch, horizon-ctl table, launcher MCP), on the Mac mini:

cargo fmt --all --check                                              ok
cargo clippy --workspace --all-targets -- -D warnings                ok
launcher: cargo clippy --features gpui/runtime_shaders --all-targets -- -D warnings   ok
cargo test -p horizon-core -p horizon-client                         ok (1013 + 101 + 18 horizon-ctl + ...)
launcher: cargo test --features gpui/runtime_shaders                 ok (97 lib + 23 bin + 1)
tools/agent_control_e2e.py (fast build, offscreen)                   18/18: survival ui options events consume pick suggestions manage no-ai, cli and mcp
tools/launcher_mcp_e2e.py                                            PASS: 134 tools (46 launcher + 88 game), No AI refused
tools/parity.py --changed origin/main                                selects all 327 (game.rs is an input of every harness); ran the 10 that cover
                                                                     the touched areas: options world_options world_reopen world menu_click
                                                                     screen_layout chat_screen container_screen pack_screen pack_selection: 10 passed

Needs Ludovic

Nothing. Independent of the No AI PR (merges in either order).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1343 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/agent-control-game` --- ### 📝 Commits (5) - [`bcbf860`](https://github.com/horizon-rust/horizon/commit/bcbf860aaae3091e48c5d331d2891cc39149b4b4) horizon-ctl: every player action in the one command table, with a generated reference - [`a6e3fca`](https://github.com/horizon-rust/horizon/commit/a6e3fca1dd61deadd5667f4673c25021f61c0fe5) horizon-ctl: interact-entity beside hold, away from the logs arm - [`b62a866`](https://github.com/horizon-rust/horizon/commit/b62a866f39f951bad3ccfb003472d7e9ea91ee07) agent_control_e2e manage: the player's position is under player - [`684ec53`](https://github.com/horizon-rust/horizon/commit/684ec5357e5ebf9475d00e27da61e9a62aee4c93) agent_control_e2e manage: close the options with close - [`3bfb345`](https://github.com/horizon-rust/horizon/commit/3bfb345714f479654840bd4004b3cd7862369f37) horizon-ctl options: the agent page (Horizon Settings > AI Agent) ### 📊 Changes **10 files changed** (+569 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/bin/horizon-ctl/commands.rs` (+213 -11) 📝 `crates/horizon-client/src/bin/horizon-ctl/main.rs` (+16 -0) 📝 `crates/horizon-client/src/bin/horizon-ctl/mcp.rs` (+7 -1) 📝 `crates/horizon-client/src/game.rs` (+1 -0) 📝 `crates/horizon-client/src/game/control.rs` (+4 -0) ➕ `crates/horizon-client/src/game/saves_control.rs` (+123 -0) 📝 `crates/horizon-client/src/title.rs` (+9 -1) 📝 `crates/horizon-client/src/title/world_management.rs` (+4 -4) ➕ `docs/horizon-ctl-commands.md` (+140 -0) 📝 `tools/agent_control_e2e.py` (+52 -3) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What `horizon-ctl` and `horizon-ctl mcp` reach every player action of the game (brief agent-control-2, sections 1-3), from the one command table: - **Into the table** (they existed only on the raw socket): `options [PAGE]` (every page, Horizon's too), `connect ADDRESS` (a server, or `friend:CODE` for an invite code), `disconnect`, `lan open|close|status`, `friends host|stop|status`, `book`, `signedit`, `mount-menu`, `effect`, `effects`, `xp`, `enchant`, `potion`, `fill`, `container`. - **New commands** (game side, `game/saves_control.rs`): - `worlds`: the saves, newest first (folder, name, mode, last played, version); - `world-rename FOLDER NAME`, `world-backup FOLDER` (Make Backup's zip, off the game thread), `world-delete FOLDER --confirm`: the Select/Edit World screens' own functions, from the title screen only; delete needs `--confirm` on the socket too, and `confirm` is a required MCP argument; - `servers`: the Multiplayer list (name, address). - **New in horizon-ctl**: `interact-entity ID` (face it, right-click with the held item: trade, mount, milk, shear). - **Now MCP tools too**: `status` (F3's overlay flags, renderer, streaming), `mouse`, `pad`, `release`, `bench`, `stats`; `summon` takes a position. - MCP annotations: `destructiveHint` on `world_delete`, `fill`, `setblock`; `openWorldHint` on `connect`, `lan`, `friends`, `chat`, `command`. - **Generated reference**: `docs/horizon-ctl-commands.md` comes from the table (`horizon-ctl help --markdown`); a test fails when it is out of date or a command is missing from it. Everything a mouse and keyboard can do on any screen was already possible through `ui`, `click ID`, `set ID VALUE`, `type`, `key`; these give agents direct, checked commands for the rest of the audit's rows. ## Tests - Unit: table tests (names, schemas, the required `confirm`, bare-word booleans), the reference test. - `tools/agent_control_e2e.py --scenario manage` (new), CLI and MCP: open a survival world, `status`, milk a summoned cow with `interact-entity`, `effect`/`effects`, `xp`, `lan status`, `options horizon` + `ui`, back to the title, `worlds`, `world-backup` (zip in backups/), `world-rename`, `world-delete` refused without confirm then done with it, `servers`. ## Self-check Run once on an integration commit of the agent-control PRs (No AI switch, horizon-ctl table, launcher MCP), on the Mac mini: ``` cargo fmt --all --check ok cargo clippy --workspace --all-targets -- -D warnings ok launcher: cargo clippy --features gpui/runtime_shaders --all-targets -- -D warnings ok cargo test -p horizon-core -p horizon-client ok (1013 + 101 + 18 horizon-ctl + ...) launcher: cargo test --features gpui/runtime_shaders ok (97 lib + 23 bin + 1) tools/agent_control_e2e.py (fast build, offscreen) 18/18: survival ui options events consume pick suggestions manage no-ai, cli and mcp tools/launcher_mcp_e2e.py PASS: 134 tools (46 launcher + 88 game), No AI refused tools/parity.py --changed origin/main selects all 327 (game.rs is an input of every harness); ran the 10 that cover the touched areas: options world_options world_reopen world menu_click screen_layout chat_screen container_screen pack_screen pack_selection: 10 passed ``` ## Needs Ludovic Nothing. Independent of the No AI PR (merges in either order). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:09:53 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3489
No description provided.