Skip to content

Show the MOO's menus as a list in place of the input - #208

Merged
ctoth merged 2 commits into
masterfrom
feat/mcp-menu
Oct 26, 2026
Merged

ctoth merged 2 commits into
masterfrom
feat/mcp-menu

Conversation

@ctoth

@ctoth ctoth commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

When the MOO asks you to pick from a menu ($command_utils:menu, $menu_utils:menu), the client now shows the choices as a list where the input line was, instead of a numbered list you answer by typing.

  • New MCP package world.mongoose.menu (Mongoose's own, beside world.mongoose.location): prompt, plus parallel multiline options* and responses*. An empty response is a text line (a heading), not a choice. The MOO sends it only to clients that negotiated the package; everyone else still gets the numbered text menu.
  • The choice goes back as an ordinary input line, the same thing a player would type, so the MOO's read() is unchanged. It is sent with sendCommand(line, { answer: true }) so autosay never turns "2" into "say 2".
  • Keys: arrows, Home/End, PageUp/PageDown, typeahead on labels, Enter or click to choose, a choice's number chooses it (waits 700 ms when a longer number also exists). Escape or Cancel sends @abort, which cancels the waiting command. App's Escape sound pause skips .menu-prompt, so sounds keep playing.
  • The input is hidden, not unmounted, while a menu shows, and gets focus back afterwards.

Tests: src/mcp/packages/menu.test.ts, src/components/MenuPrompt.test.tsx.

@ctoth
ctoth merged commit 57bec10 into master Oct 26, 2026
2 checks passed
@ctoth
ctoth deleted the feat/mcp-menu branch October 26, 2026 01:37
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