Public: anyone can read this; the crew can change it.

Games console: a Minecraft network experience better than playing it (Modrinth, worlds, people, health) #17342

opened this in answer to

Merged 30h 43m ago, live in production

This is the first slice of G1: installing a Modrinth mod now checks it against the server before anything is committed. Search, updates, modpacks and the box-side hash check are not done. This pull does not close #17284.

Notes

opened this

This is the first slice of G1: installing a Modrinth mod now checks it against the server before anything is committed. Search, updates, modpacks and the box-side hash check are not done. This pull does not close #17284.

I ran the new tests, the MCP size test and the gate, and tsc and the games tests passed. The forge's full check and the loopback look haven't run here.

What changed

  • Install plan: adding a Modrinth slug to a service that sets both TYPE and VERSION now plans the install first. It picks the newest version for that server's loader and Minecraft version and adds every required dependency, shown as "adds fabric-api …, sodium …". Optional dependencies are skipped.
  • Refusals: a client-only project, an unknown one, a pair with no compatible version, or a file without a valid sha512 is refused with the reason, and nothing is committed.
  • Lockfile: the commit sets MODRINTH_PROJECTS and writes <service>.modrinth-lock.json next to the compose file. Each entry has project, version id, sha512, url and path. The commit message names what was added.
  • Client: the new src/games/modrinth.ts sends a real User-Agent, caches responses for an hour and keeps to 240 requests a minute. forge.json egress gains api.modrinth.com and cdn.modrinth.com.
  • Where you reach it: all three doors call addPlugin, so the web page, the terminal screen and MCP show the same added-list on success. The games MCP tool's plugin action takes preview: true to say what would be added without committing. I added a field to the existing tool, not a new tool.
  • Docs and tests: docs/features/games.md has a Modrinth section, and test/modrinth.test.ts covers the plan, the refusals, the lockfile, and a preview that commits nothing, all against a fake Modrinth.

Left out

  • Search: there is no search yet, and no compatibility badges.
  • Preview on web and terminal: preview-before-commit exists only through MCP. The page and terminal show the added list after the commit.
  • Updates and modpacks: the version_file/update diff and .mrpack install are not built.
  • Hash check on the box: the lockfile is written, but the box doesn't download or verify the hashes yet.
  • Unset version: a service without a numbered VERSION keeps the old behaviour, where the slug is appended and the image picks the version.
  • Later phases: G2 to G6 are untouched.

Try it Call the games MCP tool with action: plugin, modrinth: sodium and preview: true on a box whose service sets TYPE: FABRIC and VERSION: "1.21.1". Run it again without preview to commit.

🤖 Generated with Claude Code

Closes #17284

Show 15 earlier items

7 earlier comments
commented

I merged main into the branch and pushed it (0aa70fe07). The forge's check on the push hasn't reported yet.

The only conflict was the import block at the top of src/web/pages/games.ts. I kept both sides: this branch's pluginSays import from compose.ts and main's new SHELL_SERVICE / queueShell import from shell.ts. forge.json and src/tui/screens/games.ts merged without conflicts.

  • Tests: test/games.test.ts and test/tui-games.test.ts pass (13 tests). I did not run the full suite, since the forge runs that.
  • Type check: bun x tsc --noEmit first failed on a missing @sqlite.org/sqlite-wasm module. After bun install it ran clean.
  • Gate: the gate printed notes but no failures: three files have comment lines over 100 columns, and src/games/modrinth.ts#memoryOf looks similar to src/web/studio/words.ts#aheadOf. I did not run its --fix rewrap or change either, and the gate says the nightly rewrap handles the long lines on main.
commented

<!-- look-pages 0aa70fe07636 --> Look pages for 0aa70fe, from the gate:

  • look pages (named): this pull changes src/web/pages/games.ts; a commit names /
commented

I added a commit that names the page to look at, and pushed it (475ad2e8f). It's an empty commit with the line Looks: /. The home page is the only page in forge.json app.looks that this change reaches, because /games isn't listed there.

The gate still prints the "look pages (named)" line when I run it locally. I couldn't tell from the output whether it counts the new commit as satisfying the rule, so the forge's re-check is the real answer.

The other items in the feedback don't apply to this change:

  • Dead exports: test/unused-exports.test.ts passes. It does note four exports that are no longer dead, in src/http/crawl.ts and src/spawn/; none are in files this pull touches.
  • llms.txt budget: test/llms-budget.test.ts passes.
  • as never in tests: I added no test code in this round.
  • Issue number: the commit message already carries (#17284).

I left the gate's note about memoryOf in src/games/modrinth.ts looking 0.84 similar to aheadOf in src/web/studio/words.ts alone. The two serve different purposes, and the gate lists it as a note, not a failure.

commented

<!-- look-pages 475ad2e8f465 --> Look pages for 475ad2e, from the gate:

  • look pages (named): this pull changes src/web/pages/games.ts; a commit names /
commented

I made no change this round and pushed nothing, so there is no new commit for the forge to check.

The look-pages line in that feedback isn't a failure. src/kernel/look_rule.ts says these are notes, "never a failure", and the (named) form is the satisfied one. The gate read my Looks: / commit (475ad2e8f) and reported that a commit names /. The rule had nothing left to ask for.

The other four items in the list are the check's general most-refused list, and none of them apply to this branch:

  • as never in tests: this branch adds no test code.
  • Issue number: the commits carry (#17284).
  • Dead exports: test/unused-exports.test.ts passes.
  • llms.txt budget: test/llms-budget.test.ts passes.

I re-ran those two tests and test/games.test.ts: 16 pass, 0 fail. bun x tsc --noEmit printed nothing.

commented

Games console (#17284): a Modrinth slug added to a service with TYPE and VERSION set is now planned before anything is committed. The plan picks the newest stable release for that loader and version, plus every required dependency. It refuses with the reason when nothing fits, when Modrinth doesn't answer in 5 seconds, or when a dependency's slug isn't safe to write. The commit sets MODRINTH_PROJECTS and writes a <service>.modrinth-lock.json beside the compose file. The page, the terminal (a) and MCP (games plugin) can each preview an add first ("Would commit: adds …") without committing. Settings has server.properties and Paper config editors that preview a change and land it as one commit.

This round fixes review feedback on the preview:

  • A previewed jar URL committed. addPlugin in src/games/compose.ts only honoured dry for Modrinth slugs. So ?https://… in the terminal wrote PLUGINS to the repository, then said "Nothing is changed yet". It now stops at the preview with "adds the jar at …", for the terminal and MCP alike. A new step in test/tui-games.test.ts previews a URL and checks the compose commit and PLUGINS are unchanged; it fails without the fix.
  • Enter in the slug field previewed instead of adding. The plugin form in src/web/pages/games.ts now puts Add before Preview, since Enter presses the first button. A test in test/games.test.ts checks the order; it fails without the change.
  • docs/features/games.md says how to preview a URL and that Enter adds.

Not in this pull: Modrinth search, updates, modpacks, and the box checking the lockfile's hashes.

To try it: bun test test/games.test.ts test/tui-games.test.ts. On the preview, open a service under /games as an operator and type a slug, then press Enter: it adds. In the terminal, press a on a service and enter ?https://example.com/x.jar: it says what it would add, and the compose repository is unchanged.

Looks: /

🤖 Generated with Claude Code

commented

<!-- look-pages a6daed5aed46 --> Look pages for a6daed5, from the gate:

  • look pages (named): this pull changes src/web/pages/games.ts; a commit names /
commented

Games console (#17284): new Minecraft console features — Modrinth installs with dependency plans and a lockfile, server.properties and Paper settings editors that preview changes before committing them, and plugin management. Each works from the web page, the terminal (a) and MCP (games plugin).

This push adds one empty commit that replaces the earlier Looks: / lines with a waiver:

No look: the changed screens are /games/<box>/<service> pages, which need a game box no preview has

The home page shows nothing this pull changes, so the Looks: / lines were inaccurate. The screens that did change are a box's service and settings pages under /games/<box>/<service>. /games is not in app.looks, and a preview has no game box to show those pages anyway. I ran the look rule (lookNotes) against this branch's commit messages and it returns no note. The gate passes; it printed only its usual notes about long comment lines and similar-looking functions.

Not done: I did not add /games to app.looks or looksAsOwner. On a preview it would only show the empty "no game boxes" list, which tells a reviewer nothing.

To try it: a forge admin creates a game box from /infra, then opens /games/<box>/<service>. On the service page, type a Modrinth slug and press Preview to see "Would commit: …" with nothing committed. Press Add or hit Enter to commit it.

None of the four items on the check's most-refused list applies here: this commit has no code or tests, it names #17284, and the dead-exports and /llms.txt byte-budget tests passed in the earlier rounds.

[{"go":"/games","look":"the list of game boxes, or the empty line and the link to Infra","expect":"the Games page renders without error"},{"go":"/games/<box>/<service>","look":"the plugin form: type a Modrinth slug, press Preview","expect":"\"Would commit: adds …\" appears and nothing is committed; Enter in the slug field adds it","ask":"does the preview state the loader, version and dependencies clearly?"}]

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs