@csmodding/gameface-devtools-mcp 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +21 -16
  2. package/dist/server.mjs +923 -340
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -125,22 +125,27 @@ Or in `.vscode/mcp.json` (note the `servers` key, not `mcpServers`):
125
125
 
126
126
  ## Tools
127
127
 
128
- | Tool | What it does | Under the hood |
129
- | ----------------- | ------------------------------------------------------------------------------- | ----------------------------------- |
130
- | `game_status` | Reachability + page target + engine info. Run first when things fail. | `/json/list` + `/json/version` |
131
- | `game_eval` | Evaluate a JS expression in the Gameface UI, returns the value as JSON. | `Runtime.evaluate` (returnByValue) |
132
- | `game_screenshot` | Screenshot the viewport (or a selector's box) as an inline image. | `Page.captureScreenshot` (+ `clip`) |
133
- | `game_dom` | DOM details (tag, classes, attributes, rect, outerHTML) for a CSS selector. | `Runtime.evaluate` |
134
- | `game_wait` | Wait until a selector matches (optionally visible) or a JS predicate is truthy. | polled `Runtime.evaluate` |
135
- | `game_click` | Click an element by dispatching real bubbling DOM events. | `Runtime.evaluate` (see note) |
136
- | `game_fill` | Set an input/textarea/contenteditable value. | `Runtime.evaluate` (see note) |
137
- | `game_type` | Type text key by key (real KeyboardEvents + value sync). | `Runtime.evaluate` (see note) |
138
- | `game_hover` | Hover an element (over/enter/move sequence) to trigger tooltips/hover state. | `Runtime.evaluate` (see note) |
139
- | `game_console` | Recent `console.*`, log entries, and uncaught exceptions from the Gameface UI. | `Log` + `Runtime.consoleAPICalled` |
140
-
128
+ | Tool | What it does | Under the hood |
129
+ | ----------------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
130
+ | `game_status` | Reachability + page target + engine info + view-reload tracking (count, last reload, context id). Run first when things fail. | `/json/list` + `/json/version` + `Runtime.executionContextCreated` |
131
+ | `game_eval` | Evaluate a JS expression in the Gameface UI, returns the value as JSON. | `Runtime.evaluate` (returnByValue) |
132
+ | `game_screenshot` | Screenshot the viewport (or a selector's box) as an inline image. | `Page.captureScreenshot` (+ `clip`) |
133
+ | `game_dom` | DOM details (tag, classes, attributes, rect, outerHTML) for a CSS selector. | `Runtime.evaluate` |
134
+ | `game_find` | Find elements by text (equals/contains/regex); returns rect + optional handles. | `Runtime.evaluate` |
135
+ | `game_wait` | Wait for a view reload and/or until a selector matches (optionally visible) or a JS predicate is truthy. | polled `Runtime.evaluate` + `Runtime.executionContextCreated` |
136
+ | `game_click` | Click an element by dispatching real bubbling DOM events. | `Runtime.evaluate` (see note) |
137
+ | `game_fill` | Set an input/textarea/contenteditable value. | `Runtime.evaluate` (see note) |
138
+ | `game_type` | Type text key by key (real KeyboardEvents + value sync). | `Runtime.evaluate` (see note) |
139
+ | `game_key` | Press a named key (Escape/Enter/arrows/…) as bubbling keydown+keyup, with modifiers/repeats. | `Runtime.evaluate` (see note) |
140
+ | `game_hover` | Hover an element (over/enter/move sequence) to trigger tooltips/hover state. | `Runtime.evaluate` (see note) |
141
+ | `game_console` | Recent `console.*`, log entries, and uncaught exceptions from the Gameface UI. | `Log` + `Runtime.consoleAPICalled` |
142
+
143
+ > [!IMPORTANT]
141
144
  > **Input is done via DOM events, not CDP `Input`.** Gameface accepts `Input.dispatchMouseEvent` /
142
145
  > `dispatchKeyEvent` but never delivers them to the UI. So `game_click`, `game_fill`, `game_type`,
143
- > and `game_hover` dispatch real DOM events in the page.
146
+ > `game_key`, and `game_hover` dispatch real DOM events in the page. These reach the UI's own JS
147
+ > handlers, but not any input the game routes at the native/engine level (e.g. Escape-to-close is
148
+ > often handled natively and will not respond to a dispatched key).
144
149
 
145
150
  ### JS debugger tools
146
151
 
@@ -187,5 +192,5 @@ All are optional, read by the server from the environment:
187
192
  The server is developed in the
188
193
  [agents-plugins](https://github.com/CitiesSkylinesModding/agents-plugins)
189
194
  repository, where this package lives as the `plugins/coherent-gameface/mcp/` workspace. See the
190
- repository README for the development setup, and its `AGENTS.md` for the verified Gameface CDP
191
- behavior matrix.
195
+ repository README for the development setup, and the plugin's `AGENTS.md`
196
+ (`plugins/coherent-gameface/AGENTS.md`) for the verified Gameface CDP behavior matrix.