mobridge-mcp 0.12.2 → 0.12.4

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/integrity.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "buildId": "b704084-20261111144850",
3
- "bundleSha256": "18462deb2ccc5e554561c36e95c56306e321fb113d2fce01e61e897b260a4665"
2
+ "buildId": "ec1ab2c-20261112032752",
3
+ "bundleSha256": "205f5846c6e89a5a03b6e5cd73b062a0ec11ee0f44d0a4341edb59013b724bf0"
4
4
  }
package/loader.cjs CHANGED
@@ -14,7 +14,7 @@ const os = require("node:os");
14
14
  const path = require("node:path");
15
15
  const crypto = require("node:crypto");
16
16
 
17
- const BUILD_ID = "b704084-20261111144850"; // pack-npx stamps the real build id
17
+ const BUILD_ID = "ec1ab2c-20261112032752"; // pack-npx stamps the real build id
18
18
  const ROOT = __dirname; // package root (loader.cjs sits here)
19
19
  const DIST = path.join(ROOT, "dist");
20
20
  const BUNDLE = path.join(DIST, "main.obf.cjs");
@@ -62,6 +62,18 @@ function cachedJscPath() {
62
62
  return { dir, file: path.join(dir, "main.jsc") };
63
63
  }
64
64
 
65
+ // Each release compiles an ~8 MB .jsc into its own directory; nothing removed the older ones. Runs only right after a fresh compile.
66
+ function pruneStaleBytecode(keepDir) {
67
+ try {
68
+ const parent = path.dirname(keepDir);
69
+ for (const name of fs.readdirSync(parent)) {
70
+ const dir = path.join(parent, name);
71
+ // A day of grace: another installed version used in parallel keeps its cache instead of the two deleting each other's.
72
+ if (dir !== keepDir && Date.now() - fs.statSync(dir).mtimeMs > 86_400_000) fs.rmSync(dir, { recursive: true, force: true });
73
+ }
74
+ } catch { /* best effort: a stale cache is only wasted disk */ }
75
+ }
76
+
65
77
  function loadViaBytecode() {
66
78
  let bytenode;
67
79
  try { bytenode = require("bytenode"); } catch { return false; } // no bytenode -> fallback JS
@@ -70,6 +82,7 @@ function loadViaBytecode() {
70
82
  if (!fs.existsSync(file)) {
71
83
  fs.mkdirSync(dir, { recursive: true });
72
84
  bytenode.compileFile({ filename: BUNDLE, output: file }); // compiled against the user's own Node
85
+ pruneStaleBytecode(dir);
73
86
  }
74
87
  injectNodePath();
75
88
  require(file);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobridge-mcp",
3
- "version": "0.12.2",
3
+ "version": "0.12.4",
4
4
  "description": "MoBridge MCP — a stdio MCP server exposing on-device Android UIs as fast semantic read / observe / find / act / verify tools plus screenshots. Ships an installer that wires it into Claude Code, Claude Desktop, Cursor and Codex.",
5
5
  "keywords": [
6
6
  "mcp",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "mobridge-adb": {
3
- "version": "1.0.1",
4
- "digest": "17d400b50d0f7f7f"
3
+ "version": "1.0.3",
4
+ "digest": "d0bc1031340fbf67"
5
5
  },
6
6
  "mobridge-app-control": {
7
7
  "version": "1.1.0",
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: mobridge-adb
3
3
  description: Use when you would reach for adb - logs, files, intents, settings, keys, power, ports, shell - use MoBridge instead
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  ---
6
6
 
7
7
  # MoBridge instead of adb
@@ -34,9 +34,10 @@ screen with `observe` instead.
34
34
  | You would run | Run this instead | Notes |
35
35
  |---|---|---|
36
36
  | `adb logcat -d` | `mobridge logcat --tag SuperAdsSDK:D --max-lines 200` | structured lines; `--grep`, `--level`, `--package`, `--since <cursor>` |
37
- | `adb logcat` (live) | `mobridge logcat --follow 20000` | keeps reading for 20 s; longer: `mobridge adb -- logcat` |
37
+ | `adb logcat` (live) | `mobridge logcat --follow 20000` | keeps reading for 20 s; longer: `mobridge adb -- logcat`; output over 2 MB stops with `OUTPUT_TOO_LARGE`, so filter or use `--max-lines` |
38
38
  | `adb logcat -c` | `mobridge logcat --clear` | |
39
39
  | `adb push / pull` | `mobridge file push ./a.txt /sdcard/Download/a.txt` / `mobridge file pull /sdcard/Download/a.txt --out ./a.txt` | single files verified by SHA-256 |
40
+ | `adb push` big file, flaky cable | `mobridge file push ./big.bin /sdcard/Download/big.bin --resume --progress` | up to 4 GB; if interrupted, run the same command again: the kept part is verified by hash and only the rest is sent |
40
41
  | `adb push -r dir` | `mobridge file push ./dir /sdcard/Download/dir --recursive` | verified by names and sizes |
41
42
  | `adb shell ls / stat / rm` | `mobridge file ls /sdcard/Download`, `file stat <p>`, `file rm <p> [--recursive]` | |
42
43
  | `adb shell run-as pkg cat` | `mobridge file pull <p> --run-as <pkg>` | debuggable apps only |
@@ -50,7 +51,8 @@ screen with `observe` instead.
50
51
  | wake, sleep, rotate, stay awake, reboot | `mobridge device wake`, `device rotate 1`, `device stay-awake true`, `device reboot` | rotate and stay-awake persist |
51
52
  | `adb tcpip`, `adb usb`, `wait-for-device` | `mobridge device tcpip --port 5555`, `device usb`, `device wait` | |
52
53
  | `adb forward / reverse` | `mobridge forward add tcp:9000 tcp:8080`, `forward list`, `forward remove tcp:9000` | remove only touches mappings made here |
53
- | `adb shell <anything>` | `mobridge shell <command>` | raw; exit code, stdout and stderr come back |
54
+ | `adb shell <anything>` | `mobridge shell <command>` | raw; exit code, stdout and stderr come back; `--raw` prints only the command's own stdout/stderr and exits with its code |
55
+ | poll until text shows / is gone | `mobridge wait --text "Done" [--gone] --timeout 8000`, `wait --window-class Launcher` | `--match CONTAINS`; no sleep loops |
54
56
  | `adb <anything>` | `mobridge adb -- <args>` | flags after `--` go to adb untouched |
55
57
  | foreground activity (`dumpsys activity`) | `mobridge observe` or `capture`: the result has the app and activity | no adb call needed |
56
58
 
@@ -72,6 +74,9 @@ Reference with every flag and result field: `references/commands.md`.
72
74
  - `rotate` and `stay-awake` also persist: undo them (`device rotate auto`, `device stay-awake false`).
73
75
  - Tapping an ad or a WebView has no node to click: use `mobridge gesture '{"kind":"TAP","x":540,"y":1200}'` with coordinates from a fresh `capture` (old coordinates go stale quickly). Never tap the ad itself; follow `mobridge-surfaces`.
74
76
  - When a step only needs "sent" (a second BACK, a tap whose effect you read later), say so: `mobridge key BACK --verify DISPATCH_ONLY` returns in ~200 ms instead of ~740 ms; in a plan add `"verify":"DISPATCH_ONLY"`.
77
+ - `adb push` inside `mobridge shell` fails like real adb (it is a client command): use `mobridge file push` (verified, no size limit worry) or `mobridge adb -- push`. A big push does not block `observe`/`capture`.
78
+ - A bare serial works for `-d` (`-d R58M...`); with several devices `disconnect` needs `-d <id>` or `--all`.
79
+ - Ad windows: `observe` may return `closeTarget {x,y,label}` when the SDK exposes one labelled Close/Skip node; act on it with `screen act at --capture <id> --x --y`. No `closeTarget` means look at a `capture`.
75
80
  - Quote the whole command when it holds `|`, `;` or `>`: `mobridge shell -d <id> -- "ls /sdcard | head"`. Put `-d`, `--json` and `--timeout` before `--`: everything after it goes to the phone untouched.
76
81
 
77
82
  ## Over MCP