stigmergy 1.0.62 → 1.0.63
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 +1 -1
- package/src/main.js +1 -4
package/package.json
CHANGED
package/src/main.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Stigmergy CLI - Multi-Agents NPX 部署管理器
|
|
5
5
|
* 支持一键部署到各个AI CLI工具,实现真正的Stigmergy协作
|
|
6
6
|
*/
|
|
7
|
-
import { spawn } from 'child_process';
|
|
7
|
+
import { spawn, spawnSync } from 'child_process';
|
|
8
8
|
import fs from 'fs/promises';
|
|
9
9
|
import { join, dirname } from 'path';
|
|
10
10
|
import { fileURLToPath } from 'url';
|
|
@@ -441,19 +441,16 @@ class StigmergyCLIRouter {
|
|
|
441
441
|
|
|
442
442
|
async checkToolAvailable(cliName) {
|
|
443
443
|
try {
|
|
444
|
-
const { spawnSync } = require('child_process');
|
|
445
444
|
let result;
|
|
446
445
|
if (process.platform === 'win32') {
|
|
447
446
|
result = spawnSync('where', [cliName], { stdio: 'pipe' });
|
|
448
447
|
} else {
|
|
449
448
|
result = spawnSync('which', [cliName], { stdio: 'pipe' });
|
|
450
449
|
}
|
|
451
|
-
|
|
452
450
|
return result.status === 0;
|
|
453
451
|
} catch (e) {
|
|
454
452
|
// 如果系统命令失败,尝试npm检查
|
|
455
453
|
try {
|
|
456
|
-
const { spawnSync } = require('child_process');
|
|
457
454
|
const npmResult = spawnSync('npm', ['list', '-g', '--depth=0'], { encoding: 'utf-8' });
|
|
458
455
|
if (npmResult.status === 0 && npmResult.stdout) {
|
|
459
456
|
return npmResult.stdout.includes(cliName);
|