@maintainer-pro/ai-bridge 0.1.9 → 0.1.11

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/daemon.mjs +17 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maintainer-pro/ai-bridge",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Local bridge daemon that pairs a machine to Maintainer Pro and configures multiple client sandboxes.",
5
5
  "keywords": [
6
6
  "maintainer-pro",
@@ -28,7 +28,7 @@
28
28
  "node": ">=22"
29
29
  },
30
30
  "dependencies": {
31
- "@maintainer-pro/ai-cli": "^0.1.6",
32
- "@maintainer-pro/ai-server": "^0.1.5"
31
+ "@maintainer-pro/ai-cli": "^0.1.7",
32
+ "@maintainer-pro/ai-server": "^0.1.6"
33
33
  }
34
34
  }
package/src/daemon.mjs CHANGED
@@ -2125,14 +2125,30 @@ function collectOfferedFolders() {
2125
2125
  return [browseRootFromCwd()];
2126
2126
  }
2127
2127
 
2128
- /** Windows: `D:\Projects\…` → `D:\Projects`. Never the drive root. */
2128
+ /**
2129
+ * Folder picker root — not `/` or a drive letter.
2130
+ * Windows: `D:\Projects\app` → `D:\Projects`.
2131
+ * macOS/Linux: `~/projects/app` → `~/projects`.
2132
+ */
2129
2133
  function browseRootFromCwd() {
2130
2134
  const cwd = path.resolve(process.cwd());
2131
2135
  if (process.platform === "win32") {
2132
2136
  const drive = path.parse(cwd).root;
2133
2137
  const first = cwd.slice(drive.length).split(/[\\/]/).filter(Boolean)[0];
2134
2138
  if (first) return path.resolve(path.join(drive, first));
2139
+ return cwd;
2140
+ }
2141
+ const home = path.resolve(os.homedir());
2142
+ if (pathInside(cwd, home)) {
2143
+ const first = cwd.slice(home.length).split("/").filter(Boolean)[0];
2144
+ if (first) return path.join(home, first);
2145
+ return home;
2146
+ }
2147
+ const bits = cwd.split("/").filter(Boolean);
2148
+ if (bits[0] === "Volumes" && bits[1]) {
2149
+ return path.join("/", bits[0], bits[1]);
2135
2150
  }
2151
+ if (bits[0]) return path.join("/", bits[0]);
2136
2152
  return cwd;
2137
2153
  }
2138
2154