@maintainer-pro/ai-bridge 0.1.26 → 0.1.28
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/package.json +3 -3
- package/src/daemon.mjs +4 -24
- package/src/share-rewrite.mjs +13 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maintainer-pro/ai-bridge",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.28",
|
|
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.
|
|
32
|
-
"@maintainer-pro/ai-server": "^0.1.
|
|
31
|
+
"@maintainer-pro/ai-cli": "^0.1.15",
|
|
32
|
+
"@maintainer-pro/ai-server": "^0.1.8"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/src/daemon.mjs
CHANGED
|
@@ -2098,31 +2098,11 @@ function collectOfferedFolders() {
|
|
|
2098
2098
|
return [browseRootFromCwd()];
|
|
2099
2099
|
}
|
|
2100
2100
|
|
|
2101
|
-
/**
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
* macOS/Linux: `~/projects/app` → `~/projects`.
|
|
2105
|
-
*/
|
|
2101
|
+
/** Directory where the bridge process was started — folder picker stays here. */
|
|
2102
|
+
const LAUNCH_CWD = path.resolve(process.cwd());
|
|
2103
|
+
|
|
2106
2104
|
function browseRootFromCwd() {
|
|
2107
|
-
|
|
2108
|
-
if (process.platform === "win32") {
|
|
2109
|
-
const drive = path.parse(cwd).root;
|
|
2110
|
-
const first = cwd.slice(drive.length).split(/[\\/]/).filter(Boolean)[0];
|
|
2111
|
-
if (first) return path.resolve(path.join(drive, first));
|
|
2112
|
-
return cwd;
|
|
2113
|
-
}
|
|
2114
|
-
const home = path.resolve(os.homedir());
|
|
2115
|
-
if (pathInside(cwd, home)) {
|
|
2116
|
-
const first = cwd.slice(home.length).split("/").filter(Boolean)[0];
|
|
2117
|
-
if (first) return path.join(home, first);
|
|
2118
|
-
return home;
|
|
2119
|
-
}
|
|
2120
|
-
const bits = cwd.split("/").filter(Boolean);
|
|
2121
|
-
if (bits[0] === "Volumes" && bits[1]) {
|
|
2122
|
-
return path.join("/", bits[0], bits[1]);
|
|
2123
|
-
}
|
|
2124
|
-
if (bits[0]) return path.join("/", bits[0]);
|
|
2125
|
-
return cwd;
|
|
2105
|
+
return LAUNCH_CWD;
|
|
2126
2106
|
}
|
|
2127
2107
|
|
|
2128
2108
|
function normalizeFsPath(p) {
|
package/src/share-rewrite.mjs
CHANGED
|
@@ -1281,14 +1281,25 @@ function shareProxyShim(p, portMap, rewriteMappedLocalUrls, bypassCors) {
|
|
|
1281
1281
|
if (typeof body === "string") arguments[0] = rewriteText(body);
|
|
1282
1282
|
return xs.apply(this, arguments);
|
|
1283
1283
|
};
|
|
1284
|
+
function asNavUrl(u) {
|
|
1285
|
+
if (u == null || u === "") return u;
|
|
1286
|
+
if (typeof u === "string") return addNav(u);
|
|
1287
|
+
try {
|
|
1288
|
+
if (typeof URL !== "undefined" && u instanceof URL) return addNav(u.href);
|
|
1289
|
+
} catch (e) {}
|
|
1290
|
+
try {
|
|
1291
|
+
return addNav(String(u));
|
|
1292
|
+
} catch (e) {}
|
|
1293
|
+
return u;
|
|
1294
|
+
}
|
|
1284
1295
|
var ps = history.pushState.bind(history);
|
|
1285
1296
|
history.pushState = function (s, t, u) {
|
|
1286
|
-
if (
|
|
1297
|
+
if (u != null && u !== "") u = asNavUrl(u);
|
|
1287
1298
|
return ps(s, t, u);
|
|
1288
1299
|
};
|
|
1289
1300
|
var rs = history.replaceState.bind(history);
|
|
1290
1301
|
history.replaceState = function (s, t, u) {
|
|
1291
|
-
if (
|
|
1302
|
+
if (u != null && u !== "") u = asNavUrl(u);
|
|
1292
1303
|
return rs(s, t, u);
|
|
1293
1304
|
};
|
|
1294
1305
|
var WS = window.WebSocket;
|