Move command metadata authority to server

This commit is contained in:
Jage9
2026-03-08 19:35:04 -04:00
parent 1741bcc2bc
commit f5cb5ebb78
8 changed files with 174 additions and 20 deletions

View File

@@ -33,6 +33,7 @@ This document is the authoritative keymap for the client.
- `Shift+O`: Inspect all item properties
- `D`: Pick up/drop item
- `Z`: Item management menu (delete/transfer when permitted)
- `Space` in item management menu: Read tooltip/help for the selected action
- `Enter`: Use item
- `Shift+Enter`: Secondary item action
@@ -104,6 +105,7 @@ Applies to effect select, user/item list modes, item selection, item property li
## Admin Modes
- `Shift+Z`: Open admin menu
- `Space` on admin root actions: Read tooltip/help for the selected action
- Admin menu options are permission-gated and include:
- role management
- change user role

View File

@@ -111,7 +111,9 @@ This is a behavior guide for packet semantics beyond raw schemas.
- `itemTypes[].editableProperties`: editable property keys by item type
- `itemTypes[].propertyMetadata`: property-level metadata (`valueType`, optional `label`, optional `range`, optional `tooltip`, optional `maxLength`, optional `options`, optional `visibleWhen`)
- `itemTypes[].globalProperties`: non-editable global values (`useSound`, `emitSound`, `useCooldownMs`, `emitRange`, `directional`, `emitSoundSpeed`, `emitSoundTempo`, `emitInitialDelay`, `emitLoopDelay`)
- `adminMenu.actions`: server-authored admin root menu labels/ordering for the authenticated user.
- `commandMetadata.mainModeActions`: server-authored labels/tooltips for server-backed main-mode commands used by the client command palette
- `itemManagement.actions`: server-authored labels/tooltips and permission-key metadata for item-management actions (`transfer`, `delete`)
- `adminMenu.actions`: server-authored admin root menu labels/tooltips/ordering for the authenticated user
- Client item UI requires this metadata from the server; there is no fallback item definition map.
- Client property help/type rendering is metadata-driven; it does not infer fallback types/tooltips from hardcoded key heuristics.
- `visibleWhen` supports equality checks and string negation via `!` prefix (example: `{"mediaEffect": "!off"}`).

View File

@@ -20,7 +20,7 @@
- uses `welcome.player` as authoritative starting position (restored from server-side account state when available)
- records `welcome.serverInfo` (`instanceId`, `version`) for restart detection
- if `welcome.serverInfo.version` differs from running client version, auto-reloads the page
- applies `welcome.uiDefinitions` for item menus/properties/options and admin menu labels/order
- applies `welcome.uiDefinitions` for item menus/properties/options, server-backed command metadata, item-management metadata, and admin menu labels/order
- sends initial `update_position` echo from server-assigned starting tile
- sends initial `update_nickname`
- creates peer runtimes for known users