mobai-mcp 2.4.0 → 2.4.1
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.
- package/dist/index.js +4 -1
- package/dist/resources.js +7 -0
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/index.js
CHANGED
|
@@ -252,6 +252,8 @@ const TOOLS = [
|
|
|
252
252
|
|
|
253
253
|
Execute a batch of DSL commands on a device. This is the primary tool for all device interaction - tap, type, swipe, observe, launch apps, assertions, web automation, and more.
|
|
254
254
|
|
|
255
|
+
To find visual/UI bugs on the current screen, run a single {"action":"audit"} step: it returns deterministic findings (touch targets, clipping, alignment, spacing, safe area, accessibility) plus an annotated screenshot whose red boxes are labelled with the element ids in the findings. Findings are evidence, not verdicts - cross-check the annotated screenshot to decide which are real bugs.
|
|
256
|
+
|
|
255
257
|
Input: JSON string with "version": "0.2" and a "steps" array. Optional script-wide "params" (declared defaults, substituted as \${name}) and "on_fail" (strategy: abort|skip|retry|replan|require_user; retry also takes max_retries, retry_delay_ms, fallback_strategy). Any step may carry its own "on_fail".
|
|
256
258
|
|
|
257
259
|
Every action below appears at least once - this is the full command surface (semantics, defaults, and platform notes are in mobai://reference/device-automation):
|
|
@@ -298,7 +300,8 @@ Every action below appears at least once - this is the full command surface (sem
|
|
|
298
300
|
{"action":"execute_js","context":"web","script":"return document.title","async":false},
|
|
299
301
|
{"action":"screenshot","file_path":"/tmp/mobai","name":"final_state"},
|
|
300
302
|
{"action":"wait_for","stable":true,"timeout_ms":3000},
|
|
301
|
-
{"action":"observe","include":["ui_tree"],"only_visible":true,"filter":{"text_regex":"Settings|Wi-Fi"},"store_as":"end_state"}
|
|
303
|
+
{"action":"observe","include":["ui_tree"],"only_visible":true,"filter":{"text_regex":"Settings|Wi-Fi"},"store_as":"end_state"},
|
|
304
|
+
{"action":"audit"}
|
|
302
305
|
]}
|
|
303
306
|
|
|
304
307
|
Predicate - object passed in a step's "predicate"/"from"/"to_element". Combine fields (AND); prefer text_contains over exact text. All native fields:
|
package/dist/resources.js
CHANGED
|
@@ -92,6 +92,7 @@ const DEVICE_AUTOMATION_REF = `<device-automation-reference>
|
|
|
92
92
|
<observe-guidance>
|
|
93
93
|
Prefer UI tree and OCR over screenshots — screenshots consume far more context and are slower. Only use screenshots for visual verification (layout, colors, images).
|
|
94
94
|
only_visible: false — use ONLY for data collection from scrollable views (returns ALL elements including off-screen). NEVER when interacting — off-screen elements cannot be tapped.
|
|
95
|
+
compact: true — token-lean ui_tree (same elements as the full tree, as flat [index] Type "label" #id [state] lines; coordinates and indentation removed, ~2x fewer tokens). Use when you select by id/index/text. Keep the default full tree when you need coordinates or spatial layout (e.g. coordinate taps, near/spatial reasoning).
|
|
95
96
|
</observe-guidance>
|
|
96
97
|
|
|
97
98
|
<ocr-fallback>
|
|
@@ -304,11 +305,17 @@ const DEVICE_AUTOMATION_REF = `<device-automation-reference>
|
|
|
304
305
|
<field name="store_as" type="string">Store result in named variable</field>
|
|
305
306
|
<field name="include_keyboard" type="bool" default="false"/>
|
|
306
307
|
<field name="only_visible" type="bool" default="true">MUST be false when collecting data from scrollable lists/search results. MUST be true when interacting with elements — off-screen elements cannot be tapped.</field>
|
|
308
|
+
<field name="compact" type="bool" default="false">Token-lean ui_tree: same elements as the full tree, formatted as flat [index] Type "label" #id [state] lines with coordinates and indentation removed (~2x fewer tokens). Use when selecting by id/index/text; keep false when you need coordinates or spatial layout.</field>
|
|
307
309
|
<field name="filter">text_regex or bounds {"x","y","width","height"} to reduce output</field>
|
|
308
310
|
<note>OCR (iOS only): returns text with tap coordinates. Useful for system dialogs missing from UI tree.</note>
|
|
309
311
|
<example>{"action": "observe", "include": ["ui_tree"], "filter": {"text_regex": "Settings|Wi-Fi"}}</example>
|
|
310
312
|
</action>
|
|
311
313
|
|
|
314
|
+
<action name="audit">
|
|
315
|
+
<note>Runs deterministic UI checks on the current native screen and returns findings plus an annotated screenshot (path under observations.native.screenshot, with red boxes labelled by element id). Findings are EVIDENCE, not conclusions (e.g. margins are 18px/34px, not "misaligned") - cross-check the annotated screenshot to decide which are real bugs. Checks: touch_target, clipping, alignment, spacing, safe_area, accessibility. Dense grids of tiny repeated controls (paint canvas, keyboard) are skipped to avoid noise.</note>
|
|
316
|
+
<example>{"action": "audit"}</example>
|
|
317
|
+
</action>
|
|
318
|
+
|
|
312
319
|
<action name="wait_for">
|
|
313
320
|
<field name="predicate">Required unless stable is true</field>
|
|
314
321
|
<field name="stable" type="bool" default="false">Wait for UI to stop changing</field>
|
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/MobAI-App/mobai-mcp",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "2.4.
|
|
9
|
+
"version": "2.4.1",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "mobai-mcp",
|
|
14
|
-
"version": "2.4.
|
|
14
|
+
"version": "2.4.1",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
}
|