This commit is contained in:
decolua
2026-05-18 15:27:29 +07:00
parent b59fee8053
commit 90a47c3f29
4 changed files with 19 additions and 7 deletions
+12 -1
View File
@@ -1,7 +1,18 @@
// All intercepted domains + URL patterns per tool
const fs = require("fs");
const IS_DEV = process.env.NODE_ENV === "development";
// Resolve lsof absolute path — packaged apps / sudo secure_path may strip /usr/sbin from PATH
const LSOF_BIN = (() => {
if (process.platform === "win32") return null;
for (const p of ["/usr/sbin/lsof", "/usr/bin/lsof", "/sbin/lsof"]) {
try { fs.accessSync(p, fs.constants.X_OK); return p; } catch { /* try next */ }
}
return "lsof"; // last-resort fallback (depends on PATH)
})();
const TARGET_HOSTS = [
"daily-cloudcode-pa.googleapis.com",
"cloudcode-pa.googleapis.com",
@@ -53,4 +64,4 @@ function getToolForHost(host) {
return null;
}
module.exports = { IS_DEV, TARGET_HOSTS, URL_PATTERNS, MODEL_SYNONYMS, MODEL_PATTERNS, LOG_BLACKLIST_URL_PARTS, getToolForHost };
module.exports = { IS_DEV, LSOF_BIN, TARGET_HOSTS, URL_PATTERNS, MODEL_SYNONYMS, MODEL_PATTERNS, LOG_BLACKLIST_URL_PARTS, getToolForHost };