claude-chrome-android 1.4.1 → 1.5.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/README.md CHANGED
@@ -26,7 +26,8 @@ npx claude-chrome-android
26
26
  claude-chrome-android # start the bridge server
27
27
  claude-chrome-android --mcp # MCP server mode (spawned by Claude Code)
28
28
  claude-chrome-android --stop # stop a running bridge
29
- claude-chrome-android --setup # register MCP + install CRX extension
29
+ claude-chrome-android --setup # full setup: MCP + url-opener + Edge/extension
30
+ claude-chrome-android --setup-edge # browser-side only: install Edge, patch, sideload extension
30
31
  claude-chrome-android --version # show version
31
32
  claude-chrome-android --help # show help
32
33
  ```
@@ -52,6 +53,30 @@ Claude Code session N ─→ cli.js --mcp ─┘
52
53
  2. **Creates `~/bin/termux-url-opener`** — handles `cfcbridge://start` URLs to auto-start the bridge
53
54
  3. **Installs CRX extension** — serves the bundled CRX over HTTP and opens Edge for installation (requires ADB)
54
55
 
56
+ ## First-run setup
57
+
58
+ The bridge is only useful once a privacy-patched Edge with the CFC extension is
59
+ running. The **first time you run `claude-chrome-android` in a terminal**, if
60
+ the browser side isn't wired up it walks you through setup before starting the
61
+ bridge — so a bare `bunx claude-chrome-android` is enough to get going. You can
62
+ re-run just the browser-side setup any time with `--setup-edge`.
63
+
64
+ Setup checks each piece over ADB and offers to fix what's missing:
65
+
66
+ - **ADB device connected** — required for everything below
67
+ - **Edge installed** — detects Canary/Dev/Beta/stable; if absent it opens the
68
+ Play Store listing for Edge Canary via deeplink so it's one tap to install
69
+ (Play has no silent-install API), then waits and re-checks
70
+ - **Edge privacy-patched** — heuristic: the `AD_ID` tracking permission is stripped;
71
+ if not, offers to build + install a patched Edge from your installed copy via
72
+ `edge-fix/build-from-device.sh` (no data wipe on re-sign)
73
+ - **CFC extension sideloaded** — files in `/data/local/tmp/cfc-ext` + `--load-extension` flag set
74
+ - **Extension connected to bridge** — live WebSocket client count from `/health`
75
+
76
+ It never silently installs base Edge (no Play/APKMirror API — you tap Install)
77
+ and never touches the signing keystore. Non-interactive launches (e.g. spawned
78
+ by `termux-url-opener`) skip the prompts and just print a one-line hint.
79
+
55
80
  ## Important
56
81
 
57
82
  The bridge **must be running before** starting a Claude Code session. MCP tools are registered at session startup — if the bridge is down, the tools won't appear.
@@ -72,6 +97,13 @@ The bridge serves the CRX at `http://127.0.0.1:18963/ext/crx` — open this URL
72
97
 
73
98
  ## Changelog
74
99
 
100
+ ### 1.5.0
101
+
102
+ - First-run setup: `claude-chrome-android` in a terminal now walks through Edge/extension setup before starting the bridge when the browser side isn't wired up
103
+ - Add `--setup-edge` (alias `--doctor`): probes ADB, Edge install, privacy-patch status (AD_ID stripped), extension sideload, and live bridge connection, and offers to fix each
104
+ - Install Edge Canary via Play Store deeplink when missing; offer the `build-from-device.sh` privacy-patch build (no data wipe on re-sign)
105
+ - Stop publishing the CRX signing key (`dist/edge-claude-ext.pem`) and stale versioned CRX builds to npm via `files` allowlist negation
106
+
75
107
  ### 1.2.2
76
108
 
77
109
  - Fix CDP pending commands hanging on WebSocket close (reject immediately)
Binary file
package/dist/cli.js CHANGED
@@ -6170,6 +6170,69 @@ async function isBridgeAlive() {
6170
6170
  return false;
6171
6171
  }
6172
6172
  }
6173
+ async function bridgeClientCount() {
6174
+ try {
6175
+ const res = await fetchWithTimeout(HEALTH_URL, { timeout: 2e3 });
6176
+ if (!res.ok) return null;
6177
+ const d = await res.json();
6178
+ return typeof d.clients === "number" ? d.clients : 0;
6179
+ } catch {
6180
+ return null;
6181
+ }
6182
+ }
6183
+ var EDGE_PACKAGES = [
6184
+ "com.microsoft.emmx.canary",
6185
+ "com.microsoft.emmx.dev",
6186
+ "com.microsoft.emmx.beta",
6187
+ "com.microsoft.emmx"
6188
+ ];
6189
+ var EXT_DEST = "/data/local/tmp/cfc-ext";
6190
+ var FLAGS_FILE = "/data/local/tmp/chrome-command-line";
6191
+ function selfDir() {
6192
+ return typeof __dirname !== "undefined" ? __dirname : (0, import_path2.dirname)(new URL(import_meta_url).pathname);
6193
+ }
6194
+ function findExtDir() {
6195
+ const dir = selfDir();
6196
+ const candidates = [
6197
+ (0, import_path2.resolve)(dir, "../../edge-claude-ext"),
6198
+ // running from source repo
6199
+ (0, import_path2.resolve)(dir, "edge-claude-ext")
6200
+ // npm package dist/edge-claude-ext/
6201
+ ];
6202
+ return candidates.find((d) => (0, import_fs.existsSync)((0, import_path2.resolve)(d, "manifest.json")));
6203
+ }
6204
+ function findBuildScript() {
6205
+ const home = process.env.HOME ?? "/data/data/com.termux/files/home";
6206
+ const candidates = [
6207
+ (0, import_path2.resolve)(selfDir(), "../../../edge-fix/build-from-device.sh"),
6208
+ (0, import_path2.resolve)(home, "git/termux-tools/edge-fix/build-from-device.sh")
6209
+ ];
6210
+ return candidates.find((p) => (0, import_fs.existsSync)(p));
6211
+ }
6212
+ function adbOnline(sp) {
6213
+ const r = sp("adb", ["devices"], { stdio: "pipe", encoding: "utf-8" });
6214
+ return r.status === 0 && /\tdevice\b/.test(r.stdout ?? "");
6215
+ }
6216
+ function detectEdgePkg(sp) {
6217
+ for (const pkg of EDGE_PACKAGES) {
6218
+ const r = sp("adb", ["shell", "pm", "list", "packages", pkg], { stdio: "pipe", encoding: "utf-8" });
6219
+ if (r.stdout?.includes(`package:${pkg}`)) return pkg;
6220
+ }
6221
+ return "";
6222
+ }
6223
+ function extPushed(sp) {
6224
+ const r = sp("adb", ["shell", "ls", `${EXT_DEST}/manifest.json`], { stdio: "pipe", encoding: "utf-8" });
6225
+ return r.status === 0 && (r.stdout ?? "").includes("manifest.json");
6226
+ }
6227
+ function flagsLoadExt(sp) {
6228
+ const r = sp("adb", ["shell", "cat", FLAGS_FILE], { stdio: "pipe", encoding: "utf-8" });
6229
+ return (r.stdout ?? "").includes(EXT_DEST);
6230
+ }
6231
+ function edgeIsPatched(sp, pkg) {
6232
+ const r = sp("adb", ["shell", "dumpsys", "package", pkg], { stdio: "pipe", encoding: "utf-8" });
6233
+ if (r.status !== 0 || !r.stdout) return null;
6234
+ return !r.stdout.includes("com.google.android.gms.permission.AD_ID");
6235
+ }
6173
6236
  function cmdVersion() {
6174
6237
  console.log(`claude-chrome-android v${PKG_VERSION}`);
6175
6238
  }
@@ -6182,7 +6245,8 @@ Usage:
6182
6245
  claude-chrome-android Start the bridge server
6183
6246
  claude-chrome-android --mcp MCP server mode (spawned by Claude Code)
6184
6247
  claude-chrome-android --stop Stop a running bridge
6185
- claude-chrome-android --setup Register MCP server in Claude Code + create url-opener
6248
+ claude-chrome-android --setup Full setup: register MCP + create url-opener + Edge/extension
6249
+ claude-chrome-android --setup-edge Browser-side setup only: install Edge, patch, sideload extension
6186
6250
  claude-chrome-android --version Print version
6187
6251
  claude-chrome-android --help Show this help
6188
6252
 
@@ -6336,17 +6400,40 @@ esac
6336
6400
  (0, import_fs.writeFileSync)(urlOpenerPath, urlOpenerScript);
6337
6401
  (0, import_fs.chmodSync)(urlOpenerPath, 493);
6338
6402
  console.log(`${urlOpenerExists ? "Updated" : "Created"} ${urlOpenerPath}`);
6339
- const dir = typeof __dirname !== "undefined" ? __dirname : (0, import_path2.dirname)(new URL(import_meta_url).pathname);
6340
- const EXT_DEST = "/data/local/tmp/cfc-ext";
6341
- const FLAGS_FILE = "/data/local/tmp/chrome-command-line";
6342
- const LOAD_EXT_FLAG = `--load-extension=${EXT_DEST}`;
6343
- const extDirCandidates = [
6344
- (0, import_path2.resolve)(dir, "../../edge-claude-ext"),
6345
- // source repo
6346
- (0, import_path2.resolve)(dir, "edge-claude-ext")
6347
- // npm package (dist/edge-claude-ext/)
6348
- ];
6349
- const extDir = extDirCandidates.find((d) => (0, import_fs.existsSync)((0, import_path2.resolve)(d, "manifest.json")));
6403
+ await runEdgeSetup(spawnSync2, Boolean(process.stdin.isTTY));
6404
+ console.log(`
6405
+ Setup complete!
6406
+
6407
+ Next steps:
6408
+ 1. Start the bridge: npx claude-chrome-android
6409
+ 2. Open Edge \u2014 the extension loads automatically via --load-extension
6410
+ 3. Open a new Claude Code session \u2014 browser tools (mcp__cfc-bridge__*) will be available
6411
+ 4. Use ToolSearch to find and load cfc-bridge tools
6412
+
6413
+ To re-run just the browser-side setup later:
6414
+ npx claude-chrome-android --setup-edge (Edge + patch + extension)
6415
+ `);
6416
+ }
6417
+ async function installExtension(sp) {
6418
+ const extDir = findExtDir();
6419
+ const hasAdb = adbOnline(sp);
6420
+ if (!extDir) {
6421
+ console.log("\nExtension source not found. Skipping extension install.");
6422
+ console.log("To install manually, clone the repo and run push-extension.sh.");
6423
+ return false;
6424
+ }
6425
+ if (!hasAdb) {
6426
+ console.log("\nADB not available. Extension install requires ADB connection.");
6427
+ console.log("Connect via: adb tcpip 5555 && adb connect <device-ip>");
6428
+ return false;
6429
+ }
6430
+ const extVersion = (() => {
6431
+ try {
6432
+ return JSON.parse((0, import_fs.readFileSync)((0, import_path2.resolve)(extDir, "manifest.json"), "utf-8")).version;
6433
+ } catch {
6434
+ return PKG_VERSION;
6435
+ }
6436
+ })();
6350
6437
  const EXT_FILES = [
6351
6438
  "manifest.json",
6352
6439
  "background.js",
@@ -6359,102 +6446,163 @@ esac
6359
6446
  "icon48.png",
6360
6447
  "icon128.png"
6361
6448
  ];
6362
- const adbCheck = spawnSync2("adb", ["devices"], { stdio: "pipe", encoding: "utf-8" });
6363
- const hasAdb = adbCheck.status === 0 && adbCheck.stdout.includes(" device");
6364
- if (!extDir) {
6365
- console.log("\nExtension source not found. Skipping extension install.");
6366
- console.log("To install manually, clone the repo and run push-extension.sh.");
6367
- } else if (!hasAdb) {
6368
- console.log("\nADB not available. Extension install requires ADB connection.");
6369
- console.log("Connect via: adb tcpip 5555 && adb connect <device-ip>");
6370
- } else {
6371
- const extVersion = (() => {
6372
- try {
6373
- return JSON.parse((0, import_fs.readFileSync)((0, import_path2.resolve)(extDir, "manifest.json"), "utf-8")).version;
6374
- } catch {
6375
- return PKG_VERSION;
6376
- }
6377
- })();
6378
- console.log(`
6449
+ const LOAD_EXT_FLAG = `--load-extension=${EXT_DEST}`;
6450
+ console.log(`
6379
6451
  Installing CFC extension v${extVersion} via --load-extension...`);
6380
- spawnSync2("adb", ["shell", "mkdir", "-p", EXT_DEST], { stdio: "pipe" });
6381
- let pushed = 0;
6382
- for (const f of EXT_FILES) {
6383
- const src = (0, import_path2.resolve)(extDir, f);
6384
- if ((0, import_fs.existsSync)(src)) {
6385
- const result = spawnSync2("adb", ["push", src, `${EXT_DEST}/${f}`], {
6386
- stdio: "pipe",
6387
- encoding: "utf-8"
6388
- });
6389
- if (result.status === 0) pushed++;
6390
- }
6452
+ sp("adb", ["shell", "mkdir", "-p", EXT_DEST], { stdio: "pipe" });
6453
+ let pushed = 0;
6454
+ for (const f of EXT_FILES) {
6455
+ const src = (0, import_path2.resolve)(extDir, f);
6456
+ if ((0, import_fs.existsSync)(src)) {
6457
+ const r = sp("adb", ["push", src, `${EXT_DEST}/${f}`], { stdio: "pipe", encoding: "utf-8" });
6458
+ if (r.status === 0) pushed++;
6391
6459
  }
6392
- console.log(` Pushed ${pushed}/${EXT_FILES.length} files to ${EXT_DEST}`);
6393
- const flagsResult = spawnSync2("adb", ["shell", "cat", FLAGS_FILE], {
6394
- stdio: "pipe",
6395
- encoding: "utf-8"
6460
+ }
6461
+ console.log(` Pushed ${pushed}/${EXT_FILES.length} files to ${EXT_DEST}`);
6462
+ const flagsResult = sp("adb", ["shell", "cat", FLAGS_FILE], { stdio: "pipe", encoding: "utf-8" });
6463
+ let currentFlags = flagsResult.stdout?.trim() || "";
6464
+ if (!currentFlags.includes("--load-extension=")) {
6465
+ currentFlags = currentFlags ? `${currentFlags} ${LOAD_EXT_FLAG}` : `_ ${LOAD_EXT_FLAG}`;
6466
+ sp("adb", ["shell", `echo '${currentFlags}' > ${FLAGS_FILE}`], { stdio: "pipe" });
6467
+ console.log(" Added --load-extension flag to chrome-command-line");
6468
+ } else if (!currentFlags.includes(EXT_DEST)) {
6469
+ currentFlags = currentFlags.replace(/--load-extension=\S+/, LOAD_EXT_FLAG);
6470
+ sp("adb", ["shell", `echo '${currentFlags}' > ${FLAGS_FILE}`], { stdio: "pipe" });
6471
+ console.log(" Updated --load-extension path in chrome-command-line");
6472
+ } else {
6473
+ console.log(" --load-extension flag already set");
6474
+ }
6475
+ const edgePkg = detectEdgePkg(sp);
6476
+ if (edgePkg) {
6477
+ sp("adb", ["shell", "settings", "put", "global", "debug_app", edgePkg], { stdio: "pipe" });
6478
+ console.log(` Set debug_app=${edgePkg} for flag reading`);
6479
+ sp("adb", ["shell", "am", "force-stop", edgePkg], { stdio: "pipe" });
6480
+ console.log(` Restarted ${edgePkg} to apply changes`);
6481
+ } else {
6482
+ console.log(" WARNING: No Edge browser found. Install Edge Canary from the Play Store.");
6483
+ }
6484
+ console.log(" Extension will load automatically when Edge starts.");
6485
+ return true;
6486
+ }
6487
+ var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
6488
+ function ask(question) {
6489
+ return new Promise((res) => {
6490
+ const rl = require("readline").createInterface({ input: process.stdin, output: process.stdout });
6491
+ rl.question(question, (answer) => {
6492
+ rl.close();
6493
+ res(answer.trim().toLowerCase());
6396
6494
  });
6397
- let currentFlags = flagsResult.stdout?.trim() || "";
6398
- if (!currentFlags.includes("--load-extension=")) {
6399
- if (!currentFlags) {
6400
- currentFlags = `_ ${LOAD_EXT_FLAG}`;
6401
- } else {
6402
- currentFlags = `${currentFlags} ${LOAD_EXT_FLAG}`;
6403
- }
6404
- spawnSync2("adb", ["shell", `echo '${currentFlags}' > ${FLAGS_FILE}`], {
6405
- stdio: "pipe"
6406
- });
6407
- console.log(" Added --load-extension flag to chrome-command-line");
6408
- } else if (!currentFlags.includes(EXT_DEST)) {
6409
- currentFlags = currentFlags.replace(/--load-extension=\S+/, LOAD_EXT_FLAG);
6410
- spawnSync2("adb", ["shell", `echo '${currentFlags}' > ${FLAGS_FILE}`], {
6411
- stdio: "pipe"
6412
- });
6413
- console.log(" Updated --load-extension path in chrome-command-line");
6414
- } else {
6415
- console.log(" --load-extension flag already set");
6416
- }
6417
- const edgePackages = [
6418
- "com.microsoft.emmx.canary",
6419
- "com.microsoft.emmx.dev",
6420
- "com.microsoft.emmx.beta",
6421
- "com.microsoft.emmx"
6422
- ];
6423
- let edgePkg = "";
6424
- for (const pkg of edgePackages) {
6425
- const check = spawnSync2("adb", ["shell", "pm", "list", "packages", pkg], {
6426
- stdio: "pipe",
6427
- encoding: "utf-8"
6428
- });
6429
- if (check.stdout?.includes(pkg)) {
6430
- edgePkg = pkg;
6431
- break;
6432
- }
6433
- }
6434
- if (edgePkg) {
6435
- spawnSync2("adb", ["shell", "settings", "put", "global", "debug_app", edgePkg], {
6436
- stdio: "pipe"
6437
- });
6438
- console.log(` Set debug_app=${edgePkg} for flag reading`);
6439
- spawnSync2("adb", ["shell", "am", "force-stop", edgePkg], { stdio: "pipe" });
6440
- console.log(` Restarted ${edgePkg} to apply changes`);
6495
+ });
6496
+ }
6497
+ var isYes = (a) => a === "" || a === "y" || a === "yes";
6498
+ var EDGE_CANARY = "com.microsoft.emmx.canary";
6499
+ async function ensureEdgeInstalled(sp, interactive) {
6500
+ let pkg = detectEdgePkg(sp);
6501
+ if (pkg) return pkg;
6502
+ const listing = `https://play.google.com/store/apps/details?id=${EDGE_CANARY}`;
6503
+ if (!interactive) {
6504
+ console.log(`
6505
+ Edge not installed. Install Edge Canary, then re-run:
6506
+ ${listing}`);
6507
+ return "";
6508
+ }
6509
+ const a = await ask("\nEdge isn't installed. Open the Play Store to install Edge Canary now? [Y/n] ");
6510
+ if (!isYes(a)) {
6511
+ console.log("Skipped Edge install.");
6512
+ return "";
6513
+ }
6514
+ sp("adb", ["shell", `am start -a android.intent.action.VIEW -d 'market://details?id=${EDGE_CANARY}'`], { stdio: "pipe" });
6515
+ console.log("Opened the Play Store on your device. Tap Install, wait for it to finish, then return here.");
6516
+ await ask("Press Enter once Edge Canary has finished installing... ");
6517
+ for (let i = 0; i < 5 && !pkg; i++) {
6518
+ pkg = detectEdgePkg(sp);
6519
+ if (!pkg) await sleep(2e3);
6520
+ }
6521
+ if (pkg) console.log(`Detected ${pkg}.`);
6522
+ else console.log("Still don't see Edge installed \u2014 skipping the rest of setup.");
6523
+ return pkg;
6524
+ }
6525
+ async function probeEdge(sp) {
6526
+ const hasAdb = adbOnline(sp);
6527
+ const edgePkg = hasAdb ? detectEdgePkg(sp) : "";
6528
+ return {
6529
+ hasAdb,
6530
+ edgePkg,
6531
+ patched: hasAdb && edgePkg ? edgeIsPatched(sp, edgePkg) : null,
6532
+ extPushed: hasAdb ? extPushed(sp) : false,
6533
+ flagsLoadExt: hasAdb ? flagsLoadExt(sp) : false,
6534
+ clients: await bridgeClientCount()
6535
+ };
6536
+ }
6537
+ function printEdgeStatus(s) {
6538
+ const mark = (ok) => ok === null ? "?" : ok ? "OK" : "MISSING";
6539
+ console.log("CFC environment check:");
6540
+ console.log(` [${mark(s.hasAdb)}] ADB device connected`);
6541
+ console.log(` [${s.edgePkg ? "OK" : "MISSING"}] Edge installed${s.edgePkg ? ` (${s.edgePkg})` : ""}`);
6542
+ console.log(` [${mark(s.patched)}] Edge privacy-patched (AD_ID stripped)`);
6543
+ console.log(` [${mark(s.extPushed && s.flagsLoadExt)}] CFC extension sideloaded + flag set`);
6544
+ console.log(` [${s.clients === null ? "\u2014" : s.clients > 0 ? "OK" : "MISSING"}] Extension connected to bridge${s.clients !== null ? ` (${s.clients} client${s.clients === 1 ? "" : "s"})` : " (bridge not running)"}`);
6545
+ }
6546
+ async function offerPatchBuild(sp, edgePkg, interactive) {
6547
+ const script = findBuildScript();
6548
+ if (!script) {
6549
+ console.log("\nTo build a privacy-patched Edge from your installed copy:");
6550
+ console.log(" git clone https://github.com/tribixbite/termux-tools");
6551
+ console.log(" cd termux-tools/edge-fix && ./build-from-device.sh --install");
6552
+ console.log("(needs apktool, zipalign/apksigner, java, python3 + the tool jars in tools/)");
6553
+ return;
6554
+ }
6555
+ if (!interactive) {
6556
+ console.log(`
6557
+ Run the self-build to patch Edge (no data wipe on re-sign):`);
6558
+ console.log(` ${script} --install`);
6559
+ return;
6560
+ }
6561
+ const a = await ask(`
6562
+ Build + install a privacy-patched ${edgePkg} now via build-from-device.sh? [Y/n] `);
6563
+ if (!isYes(a)) {
6564
+ console.log("Skipped patch build.");
6565
+ return;
6566
+ }
6567
+ console.log("\nRunning build-from-device.sh --install (this takes a few minutes)...\n");
6568
+ const r = sp("bash", [script, "--install"], { stdio: "inherit" });
6569
+ if (r.status === 0) console.log("\nPatched Edge installed.");
6570
+ else console.log(`
6571
+ build-from-device.sh exited ${r.status}. See output above.`);
6572
+ }
6573
+ async function runEdgeSetup(sp, interactive) {
6574
+ const s = await probeEdge(sp);
6575
+ printEdgeStatus(s);
6576
+ if (!s.hasAdb) {
6577
+ console.log("\nNo ADB device. Connect with: adb tcpip 5555 && adb connect <device-ip>");
6578
+ return false;
6579
+ }
6580
+ const edgePkg = s.edgePkg || await ensureEdgeInstalled(sp, interactive);
6581
+ if (!edgePkg) return false;
6582
+ const patched = s.edgePkg ? s.patched : edgeIsPatched(sp, edgePkg);
6583
+ if (patched !== true) {
6584
+ if (patched === false) console.log("\nYour Edge still ships tracking permissions.");
6585
+ await offerPatchBuild(sp, edgePkg, interactive);
6586
+ }
6587
+ const reProbe = await probeEdge(sp);
6588
+ if (!reProbe.extPushed || !reProbe.flagsLoadExt || reProbe.clients === 0) {
6589
+ if (interactive) {
6590
+ const a = await ask("\nSideload the CFC extension into Edge now? [Y/n] ");
6591
+ if (isYes(a)) await installExtension(sp);
6592
+ else console.log("Skipped extension install.");
6441
6593
  } else {
6442
- console.log(" WARNING: No Edge browser found. Install Edge Canary from the Play Store.");
6594
+ console.log("\nInstall the CFC extension with: claude-chrome-android --setup");
6443
6595
  }
6444
- console.log(" Extension will load automatically when Edge starts.");
6445
6596
  }
6446
- console.log(`
6447
- Setup complete!
6448
-
6449
- Next steps:
6450
- 1. Start the bridge: npx claude-chrome-android
6451
- 2. Open Edge \u2014 the extension loads automatically via --load-extension
6452
- 3. Open a new Claude Code session \u2014 browser tools (mcp__cfc-bridge__*) will be available
6453
- 4. Use ToolSearch to find and load cfc-bridge tools
6454
-
6455
- To update the extension later:
6456
- npx claude-chrome-android --setup (re-pushes latest files)
6597
+ const final = await probeEdge(sp);
6598
+ return Boolean(final.edgePkg && final.patched === true && final.extPushed && final.flagsLoadExt);
6599
+ }
6600
+ async function cmdSetupEdge() {
6601
+ console.log(`claude-chrome-android v${PKG_VERSION} \u2014 Edge setup
6457
6602
  `);
6603
+ const { spawnSync: spawnSync2 } = await import("child_process");
6604
+ await runEdgeSetup(spawnSync2, Boolean(process.stdin.isTTY));
6605
+ console.log("\nDone. Start the bridge with: claude-chrome-android");
6458
6606
  }
6459
6607
  async function cmdStart() {
6460
6608
  if (await isBridgeAlive()) {
@@ -6462,6 +6610,25 @@ async function cmdStart() {
6462
6610
  console.log("Use --stop to stop it first, or --help for more options.");
6463
6611
  process.exit(0);
6464
6612
  }
6613
+ const interactive = Boolean(process.stdin.isTTY);
6614
+ try {
6615
+ const { spawnSync: spawnSync2 } = await import("child_process");
6616
+ if (adbOnline(spawnSync2)) {
6617
+ const edgePkg = detectEdgePkg(spawnSync2);
6618
+ const ready = edgePkg && extPushed(spawnSync2) && flagsLoadExt(spawnSync2);
6619
+ if (!ready) {
6620
+ if (interactive) {
6621
+ console.log("First-time setup: let's get Edge + the CFC extension ready.\n");
6622
+ await runEdgeSetup(spawnSync2, true);
6623
+ console.log("");
6624
+ } else {
6625
+ console.log("\nHeads up: Edge + CFC extension don't look fully set up.");
6626
+ console.log("Run `claude-chrome-android --setup-edge` to finish setup.\n");
6627
+ }
6628
+ }
6629
+ }
6630
+ } catch {
6631
+ }
6465
6632
  console.log(`Starting CFC Bridge v${PKG_VERSION} on ws://${WS_HOST2}:${WS_PORT2}...`);
6466
6633
  try {
6467
6634
  await Promise.resolve().then(() => (init_claude_chrome_bridge(), claude_chrome_bridge_exports));
@@ -6836,6 +7003,10 @@ switch (command) {
6836
7003
  case "--setup":
6837
7004
  cmdSetup();
6838
7005
  break;
7006
+ case "--setup-edge":
7007
+ case "--doctor":
7008
+ cmdSetupEdge();
7009
+ break;
6839
7010
  case "--mcp":
6840
7011
  cmdMcp();
6841
7012
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-chrome-android",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
4
  "description": "Claude Code Browser Bridge for Android — connects Claude Code CLI to Chrome/Edge via WebSocket",
5
5
  "author": "willstone",
6
6
  "license": "MIT",
@@ -13,6 +13,8 @@
13
13
  },
14
14
  "files": [
15
15
  "dist/",
16
+ "!dist/*.pem",
17
+ "!dist/claude-code-bridge-v*.crx",
16
18
  "README.md"
17
19
  ],
18
20
  "scripts": {