mobridge-mcp 0.11.0 → 0.12.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.
package/AI-USAGE.md CHANGED
@@ -106,6 +106,8 @@ After an install/update, connect waits for the companion to become ready (a few
106
106
  - A capture result lists targets [{name, role, at}]: the named controls on the image with the point that clicks each; use that at, never a point estimated from pixels. An observe element with contains [texts] is an unnamed clickable row: click it by query text.
107
107
  - NEEDS_VISION: read the current capture (it has a captureId), pick a point on the image, then act CLICK {at:{captureId,x,y}} (dynamic UI such as ads/video/countdown timers: stalePolicy VISUAL_DYNAMIC, act within 8 s); an old image gives STALE_CAPTURE. Never guess coordinates. Find by colour: capture {color:{hex}} → colorMatch. A control without a node: capture {scan:{}} → regionScan.regions[] (regionId, bounds, position, semanticNode, at): neutral facts that do not name the icon. Look at the image, choose a region, act CLICK {at}; if unsure it stays NEEDS_VISION, do not guess.
108
108
  - Do not change executor after a dispatch that may have run (timeout/dropped connection): the result is RESULT_UNKNOWN, look up the operation status, do not resend over ADB.
109
+ - adb replacements (typed, verified): file ls|stat|pull|push|rm (--recursive, --run-as), intent start|broadcast|service|stop-service, settings get|put|restore, prop, logcat, keycode, device wake|sleep|rotate|stay-awake|..., forward|reverse; shell <command> (raw adb shell) and adb -- <args> for everything else; chain/parallel/session for several steps. Only uiautomator is refused. Over MCP use mobile.run steps (logcat, file, intent, settings, prop, shell, adb).
110
+ - `key`/`gesture` with --verify DISPATCH_ONLY (MCP: verify.policy DISPATCH_ONLY) skip the screen wait: ~200 ms instead of ~400-740 ms, no verification.
109
111
  - Do not use raw adb when a typed command exists. mobridge capabilities [--family F] lists each op's executor, replay class and verification.
110
112
 
111
113
  ## Choose the tool by goal
@@ -165,15 +167,19 @@ A `wait` condition is always wrapped in nodeExists/nodeAbsent/anyOf/allOf, never
165
167
  ## Typed commands (generated from the registry)
166
168
 
167
169
  - app: app clear · app force · app list · open
168
- - device: devices · health --preflight · health · doctor · doctor --restart-adb · connect · state
170
+ - device: devices · health --preflight · health · doctor · doctor --restart-adb · connect · device · state · forward
169
171
  - diag: diag
172
+ - diagnostics: adb · logcat · logcat --clear · shell · shell run
170
173
  - fallback: fallback cancel · fallback commit · fallback prepare · fallback status
171
- - input: gesture · type · key
174
+ - file: file ls · file pull · file push · file rm · file stat
175
+ - input: gesture · type · key send · key
176
+ - intent: intent broadcast · intent service · intent start · intent stop-service
172
177
  - operation: operation status · trace
173
178
  - package: app install · app uninstall
174
179
  - permission: permission set · permission set --revoke · permission respond
175
180
  - run: batch · run · scenario
176
181
  - screen: screen act click | type | scroll · screen act at · analyze · screen burst · screen capture · diff · find · inspect · screen observe · record · screen act scroll · wait · watch
182
+ - settings: prop get · settings get · settings put · settings restore
177
183
 
178
184
  ## Examples
179
185
 
package/README.md CHANGED
@@ -136,6 +136,25 @@ Two or more steps: send a JSONL plan instead of many calls. The daemon keeps the
136
136
  5. Do not call `adb`, `uiautomator` or coordinate taps from the agent; use the typed tools.
137
137
  6. Coordinates from a capture are valid only for that capture (`STALE_CAPTURE` otherwise).
138
138
 
139
+ ## Use MoBridge instead of adb
140
+
141
+ Logs, files, intents, settings, keys, power, ports and raw shell all have MoBridge commands, so an agent never needs bare `adb`:
142
+
143
+ | adb habit | MoBridge |
144
+ |---|---|
145
+ | `adb logcat -d` | `mobridge logcat --tag Tag:D --max-lines 200 [--since cursor] [--follow ms]` |
146
+ | `adb push` / `pull` | `mobridge file push\|pull <path> [--recursive] [--run-as pkg]` (SHA-256 verified) |
147
+ | `am start` / `broadcast` / `startservice` | `mobridge intent start\|broadcast\|service\|stop-service` |
148
+ | `settings get` / `put` | `mobridge settings get\|put\|restore [--restore-on-exit]` |
149
+ | `input keyevent`, `svc`, rotation, reboot | `mobridge keycode`, `mobridge device wake\|sleep\|rotate\|stay-awake\|reboot\|tcpip\|usb` |
150
+ | `adb forward` / `reverse` | `mobridge forward\|reverse list\|add\|remove` |
151
+ | `adb shell <anything>` / `adb <anything>` | `mobridge shell <command>` / `mobridge adb -- <args>` |
152
+ | several commands | `mobridge chain`, `parallel`, `session --jsonl`, or `mobile.run` steps over MCP |
153
+
154
+ `shell` and `adb` have no allowlist and ask for no approval, the same trust level as `adb`; only `uiautomator` is refused because it
155
+ breaks the accessibility session. Typed commands read back or hash-check their result; `shell`, `adb` and `key` only dispatch.
156
+ The skill `mobridge-adb` (installed with the skill pack) teaches an agent this map; the full reference is in its `references/commands.md`.
157
+
139
158
  ## Troubleshooting
140
159
 
141
160
  `mobile.device.connect` does the whole setup: installs the companion APK if missing, updates it when it differs from the host version, enables Accessibility over ADB, creates the port forward and waits for the companion to answer. You never run `adb` yourself. If it fails, read `error.code`, then `details.diagnostics` and `recovery[0]`: