stigmergy 1.3.17-beta.0 → 1.3.19-beta.0
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/cli/commands/install.js +21 -10
- package/src/cli/commands/project.js +10 -5
- package/src/core/cli_tools.js +12 -0
- package/src/core/enhanced_cli_installer.js +1208 -1208
- package/src/core/installer.js +70 -41
package/package.json
CHANGED
|
@@ -30,8 +30,14 @@ async function handleInstallCommand(options = {}) {
|
|
|
30
30
|
// Scan for available and missing tools
|
|
31
31
|
const { missing: missingTools, available: availableTools } = await installer.scanCLI();
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
// Filter to only install tools with autoInstall: true
|
|
34
|
+
const toolsToInstall = Object.entries(missingTools)
|
|
35
|
+
.filter(([toolName]) => installer.router.tools[toolName]?.autoInstall === true);
|
|
36
|
+
|
|
37
|
+
const filteredMissingTools = Object.fromEntries(toolsToInstall);
|
|
38
|
+
|
|
39
|
+
if (Object.keys(filteredMissingTools).length === 0) {
|
|
40
|
+
console.log(chalk.green('✅ All auto-install CLI tools are already installed!'));
|
|
35
41
|
return {
|
|
36
42
|
success: true,
|
|
37
43
|
installed: [],
|
|
@@ -40,10 +46,10 @@ async function handleInstallCommand(options = {}) {
|
|
|
40
46
|
}
|
|
41
47
|
|
|
42
48
|
// Install all missing tools in auto mode
|
|
43
|
-
const selectedTools = Object.keys(
|
|
49
|
+
const selectedTools = Object.keys(filteredMissingTools);
|
|
44
50
|
console.log(chalk.blue(`[AUTO-INSTALL] Installing ${selectedTools.length} tools: ${selectedTools.join(', ')}`));
|
|
45
51
|
|
|
46
|
-
const installResult = await installer.installTools(selectedTools,
|
|
52
|
+
const installResult = await installer.installTools(selectedTools, filteredMissingTools);
|
|
47
53
|
|
|
48
54
|
if (installResult.success) {
|
|
49
55
|
console.log(chalk.green('✅ Auto-install completed successfully!'));
|
|
@@ -68,8 +74,13 @@ async function handleInstallCommand(options = {}) {
|
|
|
68
74
|
// Interactive install mode
|
|
69
75
|
const { missing: missingTools, available: availableTools } = await installer.scanCLI();
|
|
70
76
|
|
|
71
|
-
|
|
72
|
-
|
|
77
|
+
// Filter to only show tools with autoInstall: true
|
|
78
|
+
const toolsToInstall = Object.entries(missingTools)
|
|
79
|
+
.filter(([toolName]) => installer.router.tools[toolName]?.autoInstall === true);
|
|
80
|
+
const filteredMissingTools = Object.fromEntries(toolsToInstall);
|
|
81
|
+
|
|
82
|
+
if (Object.keys(filteredMissingTools).length === 0) {
|
|
83
|
+
console.log(chalk.green('✅ All auto-install CLI tools are already installed!'));
|
|
73
84
|
|
|
74
85
|
if (Object.keys(availableTools).length > 0) {
|
|
75
86
|
console.log(chalk.cyan('\n📦 Available tools:'));
|
|
@@ -85,14 +96,14 @@ async function handleInstallCommand(options = {}) {
|
|
|
85
96
|
};
|
|
86
97
|
}
|
|
87
98
|
|
|
88
|
-
console.log(chalk.yellow(`\n⚠️ Found ${Object.keys(
|
|
89
|
-
Object.entries(
|
|
99
|
+
console.log(chalk.yellow(`\n⚠️ Found ${Object.keys(filteredMissingTools).length} missing tools:`));
|
|
100
|
+
Object.entries(filteredMissingTools).forEach(([toolName, toolInfo]) => {
|
|
90
101
|
console.log(` - ${toolInfo.name}: ${toolInfo.install}`);
|
|
91
102
|
});
|
|
92
103
|
|
|
93
104
|
// For now, install all missing tools
|
|
94
|
-
const selectedTools = Object.keys(
|
|
95
|
-
const installResult = await installer.installTools(selectedTools,
|
|
105
|
+
const selectedTools = Object.keys(filteredMissingTools);
|
|
106
|
+
const installResult = await installer.installTools(selectedTools, filteredMissingTools);
|
|
96
107
|
|
|
97
108
|
if (installResult.success) {
|
|
98
109
|
console.log(chalk.green('✅ Installation completed successfully!'));
|
|
@@ -104,18 +104,23 @@ async function handleDeployCommand(options = {}) {
|
|
|
104
104
|
const installer = new StigmergyInstaller({ verbose: options.verbose });
|
|
105
105
|
const { available: deployedTools } = await installer.scanCLI();
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
// Filter to only deploy tools with autoInstall: true
|
|
108
|
+
const toolsToDeploy = Object.entries(deployedTools)
|
|
109
|
+
.filter(([toolName]) => installer.router.tools[toolName]?.autoInstall === true);
|
|
110
|
+
const filteredDeployedTools = Object.fromEntries(toolsToDeploy);
|
|
111
|
+
|
|
112
|
+
if (Object.keys(filteredDeployedTools).length === 0) {
|
|
113
|
+
console.log(chalk.yellow('[INFO] No auto-install CLI tools found for deployment'));
|
|
109
114
|
console.log(chalk.blue('💡 Run: stigmergy install to install CLI tools first'));
|
|
110
115
|
return { success: true, deployed: 0 };
|
|
111
116
|
}
|
|
112
117
|
|
|
113
|
-
console.log(chalk.blue(`[INFO] Deploying hooks for ${Object.keys(
|
|
118
|
+
console.log(chalk.blue(`[INFO] Deploying hooks for ${Object.keys(filteredDeployedTools).length} tools...`));
|
|
114
119
|
|
|
115
|
-
await installer.deployHooks(
|
|
120
|
+
await installer.deployHooks(filteredDeployedTools);
|
|
116
121
|
|
|
117
122
|
console.log(chalk.green('\n✅ Hook deployment completed successfully!'));
|
|
118
|
-
return { success: true, deployed: Object.keys(
|
|
123
|
+
return { success: true, deployed: Object.keys(filteredDeployedTools).length };
|
|
119
124
|
|
|
120
125
|
} catch (error) {
|
|
121
126
|
console.error(chalk.red('[ERROR] Deployment failed:'), error.message);
|
package/src/core/cli_tools.js
CHANGED
|
@@ -12,6 +12,7 @@ const CLI_TOOLS = {
|
|
|
12
12
|
install: 'npm install -g @anthropic-ai/claude-code',
|
|
13
13
|
hooksDir: path.join(os.homedir(), '.claude', 'hooks'),
|
|
14
14
|
config: path.join(os.homedir(), '.claude', 'config.json'),
|
|
15
|
+
autoInstall: false, // 默认不安装
|
|
15
16
|
},
|
|
16
17
|
gemini: {
|
|
17
18
|
name: 'Gemini CLI',
|
|
@@ -19,6 +20,7 @@ const CLI_TOOLS = {
|
|
|
19
20
|
install: 'npm install -g @google/gemini-cli',
|
|
20
21
|
hooksDir: path.join(os.homedir(), '.gemini', 'extensions'),
|
|
21
22
|
config: path.join(os.homedir(), '.gemini', 'config.json'),
|
|
23
|
+
autoInstall: false, // 默认不安装
|
|
22
24
|
},
|
|
23
25
|
qwen: {
|
|
24
26
|
name: 'Qwen CLI',
|
|
@@ -26,6 +28,7 @@ const CLI_TOOLS = {
|
|
|
26
28
|
install: 'npm install -g @qwen-code/qwen-code',
|
|
27
29
|
hooksDir: path.join(os.homedir(), '.qwen', 'hooks'),
|
|
28
30
|
config: path.join(os.homedir(), '.qwen', 'config.json'),
|
|
31
|
+
autoInstall: true, // 默认安装
|
|
29
32
|
},
|
|
30
33
|
iflow: {
|
|
31
34
|
name: 'iFlow CLI',
|
|
@@ -33,6 +36,7 @@ const CLI_TOOLS = {
|
|
|
33
36
|
install: 'npm install -g @iflow-ai/iflow-cli',
|
|
34
37
|
hooksDir: path.join(os.homedir(), '.iflow', 'hooks'),
|
|
35
38
|
config: path.join(os.homedir(), '.iflow', 'config.json'),
|
|
39
|
+
autoInstall: true, // 默认安装
|
|
36
40
|
},
|
|
37
41
|
qodercli: {
|
|
38
42
|
name: 'Qoder CLI',
|
|
@@ -40,6 +44,7 @@ const CLI_TOOLS = {
|
|
|
40
44
|
install: 'npm install -g @qoder-ai/qodercli',
|
|
41
45
|
hooksDir: path.join(os.homedir(), '.qoder', 'hooks'),
|
|
42
46
|
config: path.join(os.homedir(), '.qoder', 'config.json'),
|
|
47
|
+
autoInstall: true, // 默认安装
|
|
43
48
|
},
|
|
44
49
|
codebuddy: {
|
|
45
50
|
name: 'CodeBuddy CLI',
|
|
@@ -47,6 +52,7 @@ const CLI_TOOLS = {
|
|
|
47
52
|
install: 'npm install -g @tencent-ai/codebuddy-code',
|
|
48
53
|
hooksDir: path.join(os.homedir(), '.codebuddy', 'hooks'),
|
|
49
54
|
config: path.join(os.homedir(), '.codebuddy', 'config.json'),
|
|
55
|
+
autoInstall: true, // 默认安装
|
|
50
56
|
},
|
|
51
57
|
copilot: {
|
|
52
58
|
name: 'GitHub Copilot CLI',
|
|
@@ -54,6 +60,7 @@ const CLI_TOOLS = {
|
|
|
54
60
|
install: 'npm install -g @github/copilot',
|
|
55
61
|
hooksDir: path.join(os.homedir(), '.copilot', 'mcp'),
|
|
56
62
|
config: path.join(os.homedir(), '.copilot', 'config.json'),
|
|
63
|
+
autoInstall: false, // 默认不安装
|
|
57
64
|
},
|
|
58
65
|
codex: {
|
|
59
66
|
name: 'OpenAI Codex CLI',
|
|
@@ -61,6 +68,7 @@ const CLI_TOOLS = {
|
|
|
61
68
|
install: 'npm install -g @openai/codex',
|
|
62
69
|
hooksDir: path.join(os.homedir(), '.config', 'codex', 'slash_commands'),
|
|
63
70
|
config: path.join(os.homedir(), '.codex', 'config.json'),
|
|
71
|
+
autoInstall: false, // 默认不安装
|
|
64
72
|
},
|
|
65
73
|
kode: {
|
|
66
74
|
name: 'Kode CLI',
|
|
@@ -68,6 +76,7 @@ const CLI_TOOLS = {
|
|
|
68
76
|
install: 'npm install -g @shareai-lab/kode',
|
|
69
77
|
hooksDir: path.join(os.homedir(), '.kode', 'agents'),
|
|
70
78
|
config: path.join(os.homedir(), '.kode', 'config.json'),
|
|
79
|
+
autoInstall: false, // 默认不安装
|
|
71
80
|
},
|
|
72
81
|
resumesession: {
|
|
73
82
|
name: 'ResumeSession CLI',
|
|
@@ -75,6 +84,7 @@ const CLI_TOOLS = {
|
|
|
75
84
|
install: 'npm install -g @stigmergy/resume',
|
|
76
85
|
hooksDir: path.join(os.homedir(), '.resumesession', 'hooks'),
|
|
77
86
|
config: path.join(os.homedir(), '.resumesession', 'config.json'),
|
|
87
|
+
autoInstall: false, // 内部功能,不单独安装
|
|
78
88
|
},
|
|
79
89
|
opencode: {
|
|
80
90
|
name: 'OpenCode AI CLI',
|
|
@@ -82,6 +92,7 @@ const CLI_TOOLS = {
|
|
|
82
92
|
install: 'npm install -g opencode-ai',
|
|
83
93
|
hooksDir: path.join(os.homedir(), '.opencode', 'hooks'),
|
|
84
94
|
config: path.join(os.homedir(), '.opencode', 'config.json'),
|
|
95
|
+
autoInstall: false, // 默认不安装
|
|
85
96
|
},
|
|
86
97
|
'oh-my-opencode': {
|
|
87
98
|
name: 'Oh-My-OpenCode Plugin Manager',
|
|
@@ -91,6 +102,7 @@ const CLI_TOOLS = {
|
|
|
91
102
|
config: path.join(os.homedir(), '.opencode', 'config.json'),
|
|
92
103
|
skipVersionCheck: true, // Version check may not work properly for bunx packages
|
|
93
104
|
requiresBun: true, // Requires bun runtime
|
|
105
|
+
autoInstall: false, // 默认不安装
|
|
94
106
|
},
|
|
95
107
|
};
|
|
96
108
|
|