github-router 0.3.33 → 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.
@@ -3613,6 +3613,32 @@ var import_subprotocol = /* @__PURE__ */ __toESM(require_subprotocol(), 1);
3613
3613
  var import_websocket = /* @__PURE__ */ __toESM(require_websocket(), 1);
3614
3614
  var import_websocket_server = /* @__PURE__ */ __toESM(require_websocket_server(), 1);
3615
3615
 
3616
+ //#endregion
3617
+ //#region src/lib/browser-mcp/bridge-paths.ts
3618
+ /**
3619
+ * Filesystem path where the browser bridge writes its discovery file
3620
+ * (`{pid, port, token, startedAt}`) and where the install-check reads
3621
+ * it from. Used by `src/browser-bridge/index.ts` (writer) AND by
3622
+ * `src/lib/browser-mcp/install-check.ts` (reader).
3623
+ *
3624
+ * MUST be a single computation. Historically the bridge special-cased
3625
+ * win32 to `%LOCALAPPDATA%\github-router` while the install-check used
3626
+ * `~/.local/share/github-router` (the canonical `PATHS.APP_DIR` from
3627
+ * `src/lib/paths.ts`, which has no win32 branch). On Windows the
3628
+ * writer and reader never met, so the install-check returned
3629
+ * `bridge_not_running` even with a healthy bridge. Centralized here so
3630
+ * the regression test in `tests/browser-bridge-discovery-path.test.ts`
3631
+ * can pin the round-trip.
3632
+ *
3633
+ * Mirrors `PATHS.APP_DIR` from `src/lib/paths.ts` (XDG-style on every
3634
+ * platform). The bridge bundle pulls this file in via tsdown's
3635
+ * relative-import bundling; no runtime dependency on `src/lib/paths.ts`
3636
+ * is introduced.
3637
+ */
3638
+ function discoveryPath() {
3639
+ return path.join(homedir(), ".local", "share", "github-router", "browser-mcp", "bridge.json");
3640
+ }
3641
+
3616
3642
  //#endregion
3617
3643
  //#region src/browser-bridge/index.ts
3618
3644
  try {
@@ -3620,17 +3646,6 @@ try {
3620
3646
  } catch {}
3621
3647
  const HEARTBEAT_MS = 5e3;
3622
3648
  const HEARTBEAT_MISS_LIMIT = 3;
3623
- function appDir() {
3624
- if (platform() === "win32") {
3625
- const local = process$1.env.LOCALAPPDATA;
3626
- if (local) return path.join(local, "github-router");
3627
- return path.join(homedir(), "AppData", "Local", "github-router");
3628
- }
3629
- return path.join(homedir(), ".local", "share", "github-router");
3630
- }
3631
- function discoveryPath() {
3632
- return path.join(appDir(), "browser-mcp", "bridge.json");
3633
- }
3634
3649
  function writeDiscoveryFile(payload) {
3635
3650
  const file = discoveryPath();
3636
3651
  mkdirSync(path.dirname(file), { recursive: true });
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";
@@ -2815,9 +2841,6 @@ function installNativeHostForAll(browsers) {
2815
2841
 
2816
2842
  //#endregion
2817
2843
  //#region src/lib/browser-mcp/install-check.ts
2818
- function discoveryPath() {
2819
- return path.join(PATHS.APP_DIR, "browser-mcp", "bridge.json");
2820
- }
2821
2844
  function readBridgeDiscovery() {
2822
2845
  try {
2823
2846
  const raw = readFileSync(discoveryPath(), "utf8");
@@ -10879,7 +10902,7 @@ function initProxyFromEnv() {
10879
10902
  //#endregion
10880
10903
  //#region package.json
10881
10904
  var name = "github-router";
10882
- var version = "0.3.33";
10905
+ var version = "0.3.34";
10883
10906
 
10884
10907
  //#endregion
10885
10908
  //#region src/lib/approval.ts