@agent-chat/mention-watcher 0.1.2 → 0.1.5
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 +5 -26
- package/package.json +1 -1
package/dist/watch.js
CHANGED
|
@@ -86,25 +86,6 @@ function resolveShellPath() {
|
|
|
86
86
|
}
|
|
87
87
|
return [...parts].join(":");
|
|
88
88
|
}
|
|
89
|
-
function findExecutable(cmd, searchPath) {
|
|
90
|
-
if (path.isAbsolute(cmd)) {
|
|
91
|
-
try {
|
|
92
|
-
fs.accessSync(cmd, fs.constants.X_OK);
|
|
93
|
-
return cmd;
|
|
94
|
-
} catch {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
for (const dir of searchPath.split(":").filter(Boolean)) {
|
|
99
|
-
const full = path.join(dir, cmd);
|
|
100
|
-
try {
|
|
101
|
-
fs.accessSync(full, fs.constants.X_OK);
|
|
102
|
-
return full;
|
|
103
|
-
} catch {
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
89
|
var _WORKSPACE = process.env.WORKSPACE_DIR ?? process.cwd();
|
|
109
90
|
{
|
|
110
91
|
const dirsToCheck = [.../* @__PURE__ */ new Set([process.cwd(), _WORKSPACE])];
|
|
@@ -248,14 +229,14 @@ async function main() {
|
|
|
248
229
|
`);
|
|
249
230
|
const shellPath = resolveShellPath();
|
|
250
231
|
const spawnEnv = { ...process.env, PATH: shellPath };
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
|
|
232
|
+
const userShell = process.env.SHELL || "/bin/zsh";
|
|
233
|
+
const quotedArgs = [COMMAND, ...CMD_ARGS].map((a) => `'${a.replace(/'/g, "'\\''")}'`).join(" ");
|
|
234
|
+
const shellCmd = `exec ${quotedArgs}`;
|
|
235
|
+
process.stderr.write(`[mention-watcher] Shell: ${userShell} -c "${shellCmd}"
|
|
254
236
|
`);
|
|
255
|
-
}
|
|
256
237
|
let proc;
|
|
257
238
|
try {
|
|
258
|
-
proc = pty.spawn(
|
|
239
|
+
proc = pty.spawn(userShell, ["-c", shellCmd], {
|
|
259
240
|
name: "xterm-256color",
|
|
260
241
|
cols,
|
|
261
242
|
rows,
|
|
@@ -266,8 +247,6 @@ async function main() {
|
|
|
266
247
|
process.stderr.write(`[mention-watcher] Failed to spawn "${COMMAND}": ${err.message}
|
|
267
248
|
`);
|
|
268
249
|
process.stderr.write(` Run "which ${COMMAND}" in your terminal to confirm it is installed.
|
|
269
|
-
`);
|
|
270
|
-
process.stderr.write(` Searched PATH: ${shellPath}
|
|
271
250
|
`);
|
|
272
251
|
process.exit(1);
|
|
273
252
|
}
|