@agent-chat/mention-watcher 0.0.9 → 0.1.1
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/watch.js +18 -31
- package/package.json +1 -1
package/dist/watch.js
CHANGED
|
@@ -58,42 +58,29 @@ function syncMcpToken(workspaceDir, mcpServerName) {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
// Cursor
|
|
69
|
-
".git"
|
|
70
|
-
// git repo root
|
|
61
|
+
function resolveShellPath() {
|
|
62
|
+
const shell = process.env.SHELL || "/bin/zsh";
|
|
63
|
+
const attempts = [
|
|
64
|
+
`${shell} -i -c 'echo $PATH'`,
|
|
65
|
+
// interactive (sources .zshrc, nvm)
|
|
66
|
+
`${shell} -l -c 'echo $PATH'`
|
|
67
|
+
// login (sources .zprofile)
|
|
71
68
|
];
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
for (const cmd of attempts) {
|
|
70
|
+
try {
|
|
71
|
+
const raw = execSync(cmd, {
|
|
72
|
+
encoding: "utf8",
|
|
73
|
+
timeout: 4e3,
|
|
74
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
75
|
+
});
|
|
76
|
+
const pathLine = raw.split("\n").map((l) => l.trim()).find((l) => l.startsWith("/") && l.includes(":"));
|
|
77
|
+
if (pathLine) return pathLine;
|
|
78
|
+
} catch {
|
|
77
79
|
}
|
|
78
|
-
const parent = path.dirname(dir);
|
|
79
|
-
if (parent === dir || dir === home) break;
|
|
80
|
-
dir = parent;
|
|
81
|
-
}
|
|
82
|
-
return process.cwd();
|
|
83
|
-
}
|
|
84
|
-
function resolveShellPath() {
|
|
85
|
-
try {
|
|
86
|
-
const shell = process.env.SHELL || "/bin/zsh";
|
|
87
|
-
const result = execSync(`${shell} -l -c 'echo $PATH'`, {
|
|
88
|
-
encoding: "utf8",
|
|
89
|
-
timeout: 3e3
|
|
90
|
-
}).trim();
|
|
91
|
-
if (result) return result;
|
|
92
|
-
} catch {
|
|
93
80
|
}
|
|
94
81
|
return process.env.PATH || "";
|
|
95
82
|
}
|
|
96
|
-
var _WORKSPACE = process.env.WORKSPACE_DIR ??
|
|
83
|
+
var _WORKSPACE = process.env.WORKSPACE_DIR ?? process.cwd();
|
|
97
84
|
{
|
|
98
85
|
const dirsToCheck = [.../* @__PURE__ */ new Set([process.cwd(), _WORKSPACE])];
|
|
99
86
|
for (const dir of dirsToCheck) {
|