github-router 0.3.32 → 0.3.34
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/browser-bridge/index.js +26 -11
- package/dist/browser-ext/background.js +715 -0
- package/dist/browser-ext/manifest.json +24 -0
- package/dist/main.js +47 -9
- package/dist/main.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 3,
|
|
3
|
+
"name": "github-router browser bridge",
|
|
4
|
+
"short_name": "gh-router-browser",
|
|
5
|
+
"version": "0.0.1",
|
|
6
|
+
"description": "Bridge between Claude (via github-router /mcp) and the browser. Implements tab control, navigation, clicks, form fill, downloads, screenshots, devtools eval. Blocks navigation to chrome://settings.",
|
|
7
|
+
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqJElxuBlonBS3TVW9FJN0mGTtShB3L1hoaYf6k39SOr1ogGYmF90EjRxy1i21k9wQQjPf26bcBu/9X67KrQjQV0uB38CaNukgiSeoLjfptN811u+PJHx6BP+jx3Qa6/3VenNPxHC8WEU0GXql8QSjIHEyCwKb6fMASXOK94JyB5Ywov2x8mt/+9ncqBBBMVzf6r5Sagy4PL1XnryLsuADD/vOEkPet8wXgH/Oj7v5tTsQQZ7U1JT51PoDs2BFnXc5v3TkVgZwd32k3ONh+nkDw1Hof+4zwUGOyJE6eMrlYzRlKM4Qxdf9JpavQvqfieAbTRWcyKeclnHeoIfE7cDBQIDAQAB",
|
|
8
|
+
"background": {
|
|
9
|
+
"service_worker": "background.js",
|
|
10
|
+
"type": "module"
|
|
11
|
+
},
|
|
12
|
+
"permissions": [
|
|
13
|
+
"nativeMessaging",
|
|
14
|
+
"tabs",
|
|
15
|
+
"activeTab",
|
|
16
|
+
"scripting",
|
|
17
|
+
"downloads",
|
|
18
|
+
"webNavigation",
|
|
19
|
+
"debugger",
|
|
20
|
+
"storage",
|
|
21
|
+
"alarms"
|
|
22
|
+
],
|
|
23
|
+
"host_permissions": ["<all_urls>"]
|
|
24
|
+
}
|
package/dist/main.js
CHANGED
|
@@ -2587,6 +2587,32 @@ function hasSupportedBrowserInstalled() {
|
|
|
2587
2587
|
return detectSupportedBrowsers().length > 0;
|
|
2588
2588
|
}
|
|
2589
2589
|
|
|
2590
|
+
//#endregion
|
|
2591
|
+
//#region src/lib/browser-mcp/bridge-paths.ts
|
|
2592
|
+
/**
|
|
2593
|
+
* Filesystem path where the browser bridge writes its discovery file
|
|
2594
|
+
* (`{pid, port, token, startedAt}`) and where the install-check reads
|
|
2595
|
+
* it from. Used by `src/browser-bridge/index.ts` (writer) AND by
|
|
2596
|
+
* `src/lib/browser-mcp/install-check.ts` (reader).
|
|
2597
|
+
*
|
|
2598
|
+
* MUST be a single computation. Historically the bridge special-cased
|
|
2599
|
+
* win32 to `%LOCALAPPDATA%\github-router` while the install-check used
|
|
2600
|
+
* `~/.local/share/github-router` (the canonical `PATHS.APP_DIR` from
|
|
2601
|
+
* `src/lib/paths.ts`, which has no win32 branch). On Windows the
|
|
2602
|
+
* writer and reader never met, so the install-check returned
|
|
2603
|
+
* `bridge_not_running` even with a healthy bridge. Centralized here so
|
|
2604
|
+
* the regression test in `tests/browser-bridge-discovery-path.test.ts`
|
|
2605
|
+
* can pin the round-trip.
|
|
2606
|
+
*
|
|
2607
|
+
* Mirrors `PATHS.APP_DIR` from `src/lib/paths.ts` (XDG-style on every
|
|
2608
|
+
* platform). The bridge bundle pulls this file in via tsdown's
|
|
2609
|
+
* relative-import bundling; no runtime dependency on `src/lib/paths.ts`
|
|
2610
|
+
* is introduced.
|
|
2611
|
+
*/
|
|
2612
|
+
function discoveryPath() {
|
|
2613
|
+
return path.join(homedir(), ".local", "share", "github-router", "browser-mcp", "bridge.json");
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2590
2616
|
//#endregion
|
|
2591
2617
|
//#region src/lib/browser-mcp/native-host-installer.ts
|
|
2592
2618
|
const NMH_HOST_ID = "com.githubrouter.browser";
|
|
@@ -2660,13 +2686,28 @@ function packageRoot() {
|
|
|
2660
2686
|
return process$1?.cwd?.() ?? ".";
|
|
2661
2687
|
}
|
|
2662
2688
|
/**
|
|
2663
|
-
* Absolute path to the extension's source directory.
|
|
2664
|
-
*
|
|
2665
|
-
*
|
|
2666
|
-
*
|
|
2689
|
+
* Absolute path to the extension's source directory. Layouts:
|
|
2690
|
+
*
|
|
2691
|
+
* - Installed via npm: `<package>/dist/browser-ext/` (the published
|
|
2692
|
+
* tarball ships only `dist/`, see package.json "files"). The build
|
|
2693
|
+
* step copies `src/browser-ext/` → `dist/browser-ext/` so the
|
|
2694
|
+
* unpacked extension is available to users.
|
|
2695
|
+
* - Running from this repo: dist/browser-ext/ if it exists (after
|
|
2696
|
+
* `bun run build`), else src/browser-ext/ for fresh-clone-pre-build.
|
|
2697
|
+
*
|
|
2698
|
+
* Override with `GH_ROUTER_BROWSER_EXT_DIR=<abs path>` for development
|
|
2699
|
+
* (lets you point at a working copy of the extension you're editing
|
|
2700
|
+
* without rebuilding between iterations).
|
|
2667
2701
|
*/
|
|
2668
2702
|
function extensionDir() {
|
|
2669
|
-
|
|
2703
|
+
const override = process$1.env.GH_ROUTER_BROWSER_EXT_DIR;
|
|
2704
|
+
if (override && override.length > 0) return override;
|
|
2705
|
+
const root = packageRoot();
|
|
2706
|
+
const distExt = path.join(root, "dist", "browser-ext");
|
|
2707
|
+
try {
|
|
2708
|
+
if (readFileSync(path.join(distExt, "manifest.json")).length > 0) return distExt;
|
|
2709
|
+
} catch {}
|
|
2710
|
+
return path.join(root, "src", "browser-ext");
|
|
2670
2711
|
}
|
|
2671
2712
|
/** Absolute path to the bundled bridge entrypoint. */
|
|
2672
2713
|
function bridgeBundlePath() {
|
|
@@ -2800,9 +2841,6 @@ function installNativeHostForAll(browsers) {
|
|
|
2800
2841
|
|
|
2801
2842
|
//#endregion
|
|
2802
2843
|
//#region src/lib/browser-mcp/install-check.ts
|
|
2803
|
-
function discoveryPath() {
|
|
2804
|
-
return path.join(PATHS.APP_DIR, "browser-mcp", "bridge.json");
|
|
2805
|
-
}
|
|
2806
2844
|
function readBridgeDiscovery() {
|
|
2807
2845
|
try {
|
|
2808
2846
|
const raw = readFileSync(discoveryPath(), "utf8");
|
|
@@ -10864,7 +10902,7 @@ function initProxyFromEnv() {
|
|
|
10864
10902
|
//#endregion
|
|
10865
10903
|
//#region package.json
|
|
10866
10904
|
var name = "github-router";
|
|
10867
|
-
var version = "0.3.
|
|
10905
|
+
var version = "0.3.34";
|
|
10868
10906
|
|
|
10869
10907
|
//#endregion
|
|
10870
10908
|
//#region src/lib/approval.ts
|