ai-helper-agent 1.3.1 → 1.3.2
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/bin/agent.js +4 -2
- package/package.json +1 -1
- package/src/executor.js +2 -1
- package/src/search.js +4 -4
package/bin/agent.js
CHANGED
|
@@ -210,7 +210,8 @@ if (command === 'start') {
|
|
|
210
210
|
detached: true,
|
|
211
211
|
stdio: 'ignore',
|
|
212
212
|
cwd: process.cwd(),
|
|
213
|
-
env: { ...process.env }
|
|
213
|
+
env: { ...process.env },
|
|
214
|
+
windowsHide: true
|
|
214
215
|
});
|
|
215
216
|
|
|
216
217
|
// 监听 spawn 错误
|
|
@@ -344,7 +345,8 @@ if (command === 'start') {
|
|
|
344
345
|
detached: true,
|
|
345
346
|
stdio: 'ignore',
|
|
346
347
|
cwd: process.cwd(),
|
|
347
|
-
env: { ...process.env }
|
|
348
|
+
env: { ...process.env },
|
|
349
|
+
windowsHide: true
|
|
348
350
|
});
|
|
349
351
|
|
|
350
352
|
let spawnFailed = false;
|
package/package.json
CHANGED
package/src/executor.js
CHANGED
|
@@ -65,7 +65,8 @@ function executeCommand(command, cwd, wsClient, onComplete, collectOutput = fals
|
|
|
65
65
|
const proc = spawn('sh', ['-c', command], {
|
|
66
66
|
cwd: workdir,
|
|
67
67
|
env: buildSafeEnv(),
|
|
68
|
-
stdio: ['
|
|
68
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
69
|
+
windowsHide: true
|
|
69
70
|
});
|
|
70
71
|
|
|
71
72
|
const wsClients = new Set();
|
package/src/search.js
CHANGED
|
@@ -13,7 +13,7 @@ let rgAvailable = null;
|
|
|
13
13
|
*/
|
|
14
14
|
function checkFdAvailable() {
|
|
15
15
|
return new Promise((resolve) => {
|
|
16
|
-
const proc = spawn('fd', ['--version'], { stdio: 'ignore' });
|
|
16
|
+
const proc = spawn('fd', ['--version'], { stdio: 'ignore', windowsHide: true });
|
|
17
17
|
const timeout = setTimeout(() => { proc.kill(); resolve(false); }, 5000);
|
|
18
18
|
proc.on('close', (code) => { clearTimeout(timeout); resolve(code === 0); });
|
|
19
19
|
proc.on('error', () => { clearTimeout(timeout); resolve(false); });
|
|
@@ -25,7 +25,7 @@ function checkFdAvailable() {
|
|
|
25
25
|
*/
|
|
26
26
|
function checkRgAvailable() {
|
|
27
27
|
return new Promise((resolve) => {
|
|
28
|
-
const proc = spawn('rg', ['--version'], { stdio: 'ignore' });
|
|
28
|
+
const proc = spawn('rg', ['--version'], { stdio: 'ignore', windowsHide: true });
|
|
29
29
|
const timeout = setTimeout(() => { proc.kill(); resolve(false); }, 5000);
|
|
30
30
|
proc.on('close', (code) => { clearTimeout(timeout); resolve(code === 0); });
|
|
31
31
|
proc.on('error', () => { clearTimeout(timeout); resolve(false); });
|
|
@@ -89,7 +89,7 @@ function searchWithFd(rootPath, filePattern, recursive, maxResults) {
|
|
|
89
89
|
if (!recursive) args.push('--max-depth', '1');
|
|
90
90
|
args.push(rootPath);
|
|
91
91
|
|
|
92
|
-
const proc = spawn('fd', args, { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
92
|
+
const proc = spawn('fd', args, { stdio: ['ignore', 'pipe', 'pipe'], windowsHide: true });
|
|
93
93
|
const stdout = [];
|
|
94
94
|
const stderr = [];
|
|
95
95
|
let timedOut = false;
|
|
@@ -218,7 +218,7 @@ function searchContentWithRg(rootPath, pattern, filePattern, maxResults, context
|
|
|
218
218
|
}
|
|
219
219
|
args.push(pattern, rootPath);
|
|
220
220
|
|
|
221
|
-
const proc = spawn('rg', args, { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
221
|
+
const proc = spawn('rg', args, { stdio: ['ignore', 'pipe', 'pipe'], windowsHide: true });
|
|
222
222
|
const stdout = [];
|
|
223
223
|
let timedOut = false;
|
|
224
224
|
|