stigmergy 1.2.8 → 1.2.10
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/README.md +40 -6
- package/STIGMERGY.md +10 -0
- package/package.json +19 -5
- package/scripts/preuninstall.js +10 -0
- package/src/adapters/claude/install_claude_integration.js +21 -21
- package/src/adapters/codebuddy/install_codebuddy_integration.js +54 -51
- package/src/adapters/codex/install_codex_integration.js +27 -28
- package/src/adapters/gemini/install_gemini_integration.js +60 -60
- package/src/adapters/iflow/install_iflow_integration.js +72 -72
- package/src/adapters/qoder/install_qoder_integration.js +64 -64
- package/src/adapters/qwen/install_qwen_integration.js +7 -7
- package/src/cli/router.js +581 -175
- package/src/commands/skill-bridge.js +39 -0
- package/src/commands/skill-handler.js +150 -0
- package/src/commands/skill.js +127 -0
- package/src/core/cli_path_detector.js +573 -0
- package/src/core/cli_tools.js +72 -1
- package/src/core/coordination/nodejs/AdapterManager.js +29 -1
- package/src/core/directory_permission_manager.js +568 -0
- package/src/core/enhanced_cli_installer.js +609 -0
- package/src/core/installer.js +232 -88
- package/src/core/multilingual/language-pattern-manager.js +78 -50
- package/src/core/persistent_shell_configurator.js +468 -0
- package/src/core/skills/StigmergySkillManager.js +357 -0
- package/src/core/skills/__tests__/SkillInstaller.test.js +275 -0
- package/src/core/skills/__tests__/SkillParser.test.js +202 -0
- package/src/core/skills/__tests__/SkillReader.test.js +189 -0
- package/src/core/skills/cli-command-test.js +201 -0
- package/src/core/skills/comprehensive-e2e-test.js +473 -0
- package/src/core/skills/e2e-test.js +267 -0
- package/src/core/skills/embedded-openskills/SkillInstaller.js +438 -0
- package/src/core/skills/embedded-openskills/SkillParser.js +123 -0
- package/src/core/skills/embedded-openskills/SkillReader.js +143 -0
- package/src/core/skills/integration-test.js +248 -0
- package/src/core/skills/package.json +6 -0
- package/src/core/skills/regression-test.js +285 -0
- package/src/core/skills/run-all-tests.js +129 -0
- package/src/core/skills/sync-test.js +210 -0
- package/src/core/skills/test-runner.js +242 -0
- package/src/utils/helpers.js +3 -20
- package/src/auth.js +0 -173
- package/src/auth_command.js +0 -208
- package/src/calculator.js +0 -313
- package/src/core/enhanced_installer.js +0 -479
- package/src/core/enhanced_uninstaller.js +0 -638
- package/src/data_encryption.js +0 -143
- package/src/data_structures.js +0 -440
- package/src/deploy.js +0 -55
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Qoder CLI Hook
|
|
5
|
-
*
|
|
4
|
+
* Qoder CLI Hook installer
|
|
5
|
+
* Used to automatically install and configure Qoder CLI notification Hook plugins
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Usage:
|
|
8
8
|
* node install_qoder_integration.js [install|uninstall|status]
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -20,128 +20,128 @@ class QoderHookInstaller {
|
|
|
20
20
|
this.logsDir = path.join(this.qoderConfigDir, 'logs');
|
|
21
21
|
this.cacheDir = path.join(this.qoderConfigDir, 'cache');
|
|
22
22
|
|
|
23
|
-
//
|
|
23
|
+
// Adapter paths
|
|
24
24
|
this.currentDir = __dirname;
|
|
25
25
|
this.hookAdapterFile = path.join(this.currentDir, 'notification_hook_adapter.js');
|
|
26
26
|
this.configFile = path.join(this.currentDir, 'config.json');
|
|
27
27
|
|
|
28
|
-
//
|
|
28
|
+
// Installation status
|
|
29
29
|
this.installationLog = [];
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Install Qoder CLI Hook plugin
|
|
34
34
|
*/
|
|
35
35
|
async installHooks() {
|
|
36
36
|
try {
|
|
37
|
-
console.log('
|
|
37
|
+
console.log('Starting Qoder CLI Hook plugin installation...');
|
|
38
38
|
|
|
39
|
-
// 1.
|
|
39
|
+
// 1. Check environment and platform
|
|
40
40
|
if (!await this._checkEnvironment()) {
|
|
41
|
-
console.error('
|
|
41
|
+
console.error('Environment check failed');
|
|
42
42
|
return false;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
// 2.
|
|
45
|
+
// 2. Create config directory
|
|
46
46
|
await this._createDirectories();
|
|
47
47
|
|
|
48
|
-
// 3.
|
|
48
|
+
// 3. Copy adapter files
|
|
49
49
|
if (!await this._installAdapterFiles()) {
|
|
50
|
-
console.error('
|
|
50
|
+
console.error('Adapter file installation failed');
|
|
51
51
|
return false;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
// 4.
|
|
54
|
+
// 4. Create Hook scripts
|
|
55
55
|
if (!await this._createHookScripts()) {
|
|
56
|
-
console.error('Hook
|
|
56
|
+
console.error('Hook script creation failed');
|
|
57
57
|
return false;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
// 5.
|
|
60
|
+
// 5. Set up environment config
|
|
61
61
|
if (!await this._setupEnvironmentConfig()) {
|
|
62
|
-
console.error('
|
|
62
|
+
console.error('Environment config setup failed');
|
|
63
63
|
return false;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
// 6.
|
|
66
|
+
// 6. Create startup scripts
|
|
67
67
|
if (!await this._createStartupScripts()) {
|
|
68
|
-
console.error('
|
|
68
|
+
console.error('Startup script creation failed');
|
|
69
69
|
return false;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
// 7.
|
|
72
|
+
// 7. Create global Cross-CLI documentation
|
|
73
73
|
await this._createGlobalCrossCliDocumentation();
|
|
74
74
|
|
|
75
|
-
// 8.
|
|
75
|
+
// 8. Verify installation
|
|
76
76
|
if (!await this._verifyInstallation()) {
|
|
77
|
-
console.error('
|
|
77
|
+
console.error('Installation verification failed');
|
|
78
78
|
return false;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
console.log('Qoder CLI Hook
|
|
82
|
-
await this._logInstallation('success', 'Hook
|
|
81
|
+
console.log('Qoder CLI Hook plugin installation successful');
|
|
82
|
+
await this._logInstallation('success', 'Hook plugin installed successfully');
|
|
83
83
|
return true;
|
|
84
84
|
|
|
85
85
|
} catch (error) {
|
|
86
|
-
console.error(
|
|
87
|
-
await this._logInstallation('error',
|
|
86
|
+
console.error(`Failed to install Qoder CLI Hook plugin: ${error.message}`);
|
|
87
|
+
await this._logInstallation('error', `Installation failed: ${error.message}`);
|
|
88
88
|
return false;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
93
|
+
* Uninstall Qoder CLI Hook plugin
|
|
94
94
|
*/
|
|
95
95
|
async uninstallHooks() {
|
|
96
96
|
try {
|
|
97
|
-
console.log('
|
|
97
|
+
console.log('Starting Qoder CLI Hook plugin uninstallation...');
|
|
98
98
|
|
|
99
|
-
// 1.
|
|
99
|
+
// 1. Backup configuration
|
|
100
100
|
await this._backupConfiguration();
|
|
101
101
|
|
|
102
|
-
// 2.
|
|
102
|
+
// 2. Clean up Hook scripts
|
|
103
103
|
await this._cleanupHookScripts();
|
|
104
104
|
|
|
105
|
-
// 3.
|
|
105
|
+
// 3. Clean up adapter files
|
|
106
106
|
await this._cleanupAdapterFiles();
|
|
107
107
|
|
|
108
|
-
// 4.
|
|
108
|
+
// 4. Clean up environment variables
|
|
109
109
|
await this._cleanupEnvironment();
|
|
110
110
|
|
|
111
|
-
// 5.
|
|
111
|
+
// 5. Clean up temporary files
|
|
112
112
|
await this._cleanupTempFiles();
|
|
113
113
|
|
|
114
|
-
console.log('Qoder CLI Hook
|
|
115
|
-
await this._logInstallation('success', 'Hook
|
|
114
|
+
console.log('Qoder CLI Hook plugin uninstallation successful');
|
|
115
|
+
await this._logInstallation('success', 'Hook plugin uninstalled successfully');
|
|
116
116
|
return true;
|
|
117
117
|
|
|
118
118
|
} catch (error) {
|
|
119
|
-
console.error(
|
|
120
|
-
await this._logInstallation('error',
|
|
119
|
+
console.error(`Failed to uninstall Qoder CLI Hook plugin: ${error.message}`);
|
|
120
|
+
await this._logInstallation('error', `Uninstall failed: ${error.message}`);
|
|
121
121
|
return false;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
/**
|
|
126
|
-
*
|
|
126
|
+
* Check installation environment
|
|
127
127
|
*/
|
|
128
128
|
async _checkEnvironment() {
|
|
129
129
|
try {
|
|
130
|
-
//
|
|
130
|
+
// Check Node.js version
|
|
131
131
|
const nodeVersion = process.version;
|
|
132
132
|
const majorVersion = parseInt(nodeVersion.slice(1).split('.')[0]);
|
|
133
133
|
if (majorVersion < 14) {
|
|
134
|
-
console.error('
|
|
134
|
+
console.error('Node.js 14 or higher required');
|
|
135
135
|
return false;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
//
|
|
138
|
+
// Check platform support
|
|
139
139
|
const currentPlatform = os.platform();
|
|
140
140
|
if (!['darwin', 'linux', 'win32'].includes(currentPlatform)) {
|
|
141
|
-
console.warn(
|
|
141
|
+
console.warn(`Platform ${currentPlatform} may not be fully supported, will use fallback mechanism`);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
//
|
|
144
|
+
// Check if required files exist
|
|
145
145
|
const requiredFiles = [
|
|
146
146
|
this.configFile
|
|
147
147
|
];
|
|
@@ -150,26 +150,26 @@ class QoderHookInstaller {
|
|
|
150
150
|
try {
|
|
151
151
|
await fs.access(file);
|
|
152
152
|
} catch (error) {
|
|
153
|
-
console.warn(
|
|
154
|
-
//
|
|
153
|
+
console.warn(`Required file does not exist: ${file}`);
|
|
154
|
+
// Adapter file is not mandatory
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
//
|
|
158
|
+
// Check system tools
|
|
159
159
|
if (currentPlatform === 'darwin') {
|
|
160
|
-
//
|
|
160
|
+
// Check if osascript is available
|
|
161
161
|
try {
|
|
162
162
|
await this._runCommand('osascript', ['-e', '1'], { timeout: 2000 });
|
|
163
163
|
} catch (error) {
|
|
164
|
-
console.warn('osascript
|
|
164
|
+
console.warn('osascript unavailable, notification function may be limited');
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
console.log(
|
|
168
|
+
console.log(`Environment check passed (${currentPlatform})`);
|
|
169
169
|
return true;
|
|
170
170
|
|
|
171
171
|
} catch (error) {
|
|
172
|
-
console.error(
|
|
172
|
+
console.error(`Environment check failed: ${error.message}`);
|
|
173
173
|
return false;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
@@ -851,20 +851,20 @@ echo "Qoder Hook监控已停止"
|
|
|
851
851
|
*/
|
|
852
852
|
async _createGlobalCrossCliDocumentation() {
|
|
853
853
|
try {
|
|
854
|
-
const docContent = `# Qoder CLI
|
|
854
|
+
const docContent = `# Qoder CLI Cross-CLI Communication Guide
|
|
855
855
|
|
|
856
856
|
## Cross-CLI Communication
|
|
857
|
-
|
|
857
|
+
When you need to call other AI tools, please use the following prompt<<<Execute the following command in shell: stigmergy <tool_name> <task_description>>>>
|
|
858
858
|
|
|
859
|
-
|
|
860
|
-
-
|
|
861
|
-
-
|
|
862
|
-
-
|
|
859
|
+
Examples:
|
|
860
|
+
- Run in shell: stigmergy claude "Write a Python function"
|
|
861
|
+
- Run in shell: stigmergy gemini "Translate this text"
|
|
862
|
+
- Run in shell: stigmergy qwen "Analyze this code"
|
|
863
863
|
|
|
864
|
-
|
|
864
|
+
Available tools: claude, gemini, qwen, iflow, qodercli, codebuddy, copilot, codex
|
|
865
865
|
|
|
866
866
|
---
|
|
867
|
-
|
|
867
|
+
*This document is automatically generated and maintained by Stigmergy CLI*
|
|
868
868
|
`;
|
|
869
869
|
|
|
870
870
|
const docPath = path.join(this.qoderConfigDir, 'CROSS_CLI_GUIDE.md');
|
|
@@ -879,17 +879,17 @@ echo "Qoder Hook监控已停止"
|
|
|
879
879
|
const crossCliContent = `
|
|
880
880
|
|
|
881
881
|
## Cross-CLI Communication
|
|
882
|
-
|
|
882
|
+
When you need to call other AI tools, please use the following prompt<<<Execute the following command in shell: stigmergy <tool_name> <task_description>>>>
|
|
883
883
|
|
|
884
|
-
|
|
885
|
-
-
|
|
886
|
-
-
|
|
887
|
-
-
|
|
884
|
+
Examples:
|
|
885
|
+
- Run in shell: stigmergy claude "Write a Python function"
|
|
886
|
+
- Run in shell: stigmergy gemini "Translate this text"
|
|
887
|
+
- Run in shell: stigmergy qwen "Analyze this code"
|
|
888
888
|
|
|
889
|
-
|
|
889
|
+
Available tools: claude, gemini, qwen, iflow, qodercli, codebuddy, copilot, codex
|
|
890
890
|
`;
|
|
891
891
|
await fs.appendFile(qoderMdPath, crossCliContent, 'utf8');
|
|
892
|
-
console.log('
|
|
892
|
+
console.log('Append Cross-CLI communication prompt to QODER.md');
|
|
893
893
|
} catch (error) {
|
|
894
894
|
// 文件可能不存在,忽略
|
|
895
895
|
}
|
|
@@ -158,7 +158,7 @@ Examples:
|
|
|
158
158
|
Available tools: claude, gemini, qwen, iflow, qodercli, codebuddy, copilot, codex
|
|
159
159
|
`;
|
|
160
160
|
await fs.appendFile(qwenMdPath, crossCliContent);
|
|
161
|
-
console.log('[OK]
|
|
161
|
+
console.log('[OK] Appended Cross-CLI communication prompt to QWEN.md');
|
|
162
162
|
} catch (e) {
|
|
163
163
|
// File doesn't exist, that's ok
|
|
164
164
|
}
|
|
@@ -171,7 +171,7 @@ Available tools: claude, gemini, qwen, iflow, qodercli, codebuddy, copilot, code
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
async verifyInstallation() {
|
|
174
|
-
console.log('\
|
|
174
|
+
console.log('\nVerifying Qwen CLI integration installation...');
|
|
175
175
|
|
|
176
176
|
// Check config directory
|
|
177
177
|
if (!await fs.access(this.configDir).then(() => true).catch(() => false)) {
|
|
@@ -236,19 +236,19 @@ Available tools: claude, gemini, qwen, iflow, qodercli, codebuddy, copilot, code
|
|
|
236
236
|
console.log('==========================================');
|
|
237
237
|
|
|
238
238
|
// Execute installation
|
|
239
|
-
console.log('Step 1.
|
|
239
|
+
console.log('Step 1. Create config directory...');
|
|
240
240
|
await this.createConfigDirectory();
|
|
241
241
|
|
|
242
|
-
console.log('\nStep 2.
|
|
242
|
+
console.log('\nStep 2. Install config...');
|
|
243
243
|
const configSuccess = await this.installConfig();
|
|
244
244
|
|
|
245
|
-
console.log('\nStep 3.
|
|
245
|
+
console.log('\nStep 3. Install hooks...');
|
|
246
246
|
const hooksSuccess = await this.installHooks();
|
|
247
247
|
|
|
248
|
-
console.log('\nStep 4.
|
|
248
|
+
console.log('\nStep 4. Copy adapter files...');
|
|
249
249
|
const adapterSuccess = await this.copyAdapterFiles();
|
|
250
250
|
|
|
251
|
-
console.log('\nStep 5.
|
|
251
|
+
console.log('\nStep 5. Verify installation...');
|
|
252
252
|
const verificationSuccess = await this.verifyInstallation();
|
|
253
253
|
|
|
254
254
|
const overallSuccess = configSuccess && hooksSuccess && adapterSuccess && verificationSuccess;
|