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.
Files changed (48) hide show
  1. package/README.md +40 -6
  2. package/STIGMERGY.md +10 -0
  3. package/package.json +19 -5
  4. package/scripts/preuninstall.js +10 -0
  5. package/src/adapters/claude/install_claude_integration.js +21 -21
  6. package/src/adapters/codebuddy/install_codebuddy_integration.js +54 -51
  7. package/src/adapters/codex/install_codex_integration.js +27 -28
  8. package/src/adapters/gemini/install_gemini_integration.js +60 -60
  9. package/src/adapters/iflow/install_iflow_integration.js +72 -72
  10. package/src/adapters/qoder/install_qoder_integration.js +64 -64
  11. package/src/adapters/qwen/install_qwen_integration.js +7 -7
  12. package/src/cli/router.js +581 -175
  13. package/src/commands/skill-bridge.js +39 -0
  14. package/src/commands/skill-handler.js +150 -0
  15. package/src/commands/skill.js +127 -0
  16. package/src/core/cli_path_detector.js +573 -0
  17. package/src/core/cli_tools.js +72 -1
  18. package/src/core/coordination/nodejs/AdapterManager.js +29 -1
  19. package/src/core/directory_permission_manager.js +568 -0
  20. package/src/core/enhanced_cli_installer.js +609 -0
  21. package/src/core/installer.js +232 -88
  22. package/src/core/multilingual/language-pattern-manager.js +78 -50
  23. package/src/core/persistent_shell_configurator.js +468 -0
  24. package/src/core/skills/StigmergySkillManager.js +357 -0
  25. package/src/core/skills/__tests__/SkillInstaller.test.js +275 -0
  26. package/src/core/skills/__tests__/SkillParser.test.js +202 -0
  27. package/src/core/skills/__tests__/SkillReader.test.js +189 -0
  28. package/src/core/skills/cli-command-test.js +201 -0
  29. package/src/core/skills/comprehensive-e2e-test.js +473 -0
  30. package/src/core/skills/e2e-test.js +267 -0
  31. package/src/core/skills/embedded-openskills/SkillInstaller.js +438 -0
  32. package/src/core/skills/embedded-openskills/SkillParser.js +123 -0
  33. package/src/core/skills/embedded-openskills/SkillReader.js +143 -0
  34. package/src/core/skills/integration-test.js +248 -0
  35. package/src/core/skills/package.json +6 -0
  36. package/src/core/skills/regression-test.js +285 -0
  37. package/src/core/skills/run-all-tests.js +129 -0
  38. package/src/core/skills/sync-test.js +210 -0
  39. package/src/core/skills/test-runner.js +242 -0
  40. package/src/utils/helpers.js +3 -20
  41. package/src/auth.js +0 -173
  42. package/src/auth_command.js +0 -208
  43. package/src/calculator.js +0 -313
  44. package/src/core/enhanced_installer.js +0 -479
  45. package/src/core/enhanced_uninstaller.js +0 -638
  46. package/src/data_encryption.js +0 -143
  47. package/src/data_structures.js +0 -440
  48. 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
- * 用于自动安装和配置Qoder CLI的通知Hook插件
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
- * 安装Qoder CLI Hook插件
33
+ * Install Qoder CLI Hook plugin
34
34
  */
35
35
  async installHooks() {
36
36
  try {
37
- console.log('开始安装Qoder CLI Hook插件...');
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. 创建Hook脚本
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. 创建全局Cross-CLI文档
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(`安装Qoder CLI Hook插件失败: ${error.message}`);
87
- await this._logInstallation('error', `安装失败: ${error.message}`);
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
- * 卸载Qoder CLI Hook插件
93
+ * Uninstall Qoder CLI Hook plugin
94
94
  */
95
95
  async uninstallHooks() {
96
96
  try {
97
- console.log('开始卸载Qoder CLI Hook插件...');
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. 清理Hook脚本
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(`卸载Qoder CLI Hook插件失败: ${error.message}`);
120
- await this._logInstallation('error', `卸载失败: ${error.message}`);
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
- // 检查Node.js版本
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('需要Node.js 14或更高版本');
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(`平台 ${currentPlatform} 可能不受完全支持,将使用fallback机制`);
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(`必要文件不存在: ${file}`);
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
- // 检查osascript是否可用
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(`环境检查通过 (${currentPlatform})`);
168
+ console.log(`Environment check passed (${currentPlatform})`);
169
169
  return true;
170
170
 
171
171
  } catch (error) {
172
- console.error(`环境检查失败: ${error.message}`);
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 CLI通信指南
854
+ const docContent = `# Qoder CLI Cross-CLI Communication Guide
855
855
 
856
856
  ## Cross-CLI Communication
857
- 当您需要调用其他AI工具时,请使用以下提示<<<在shell中执行以下命令:stigmergy <工具名> <任务描述>>>>
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
- - shell中运行:stigmergy claude "写一个Python函数"
861
- - shell中运行:stigmergy gemini "翻译这段文字"
862
- - shell中运行:stigmergy qwen "分析这段代码"
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
- 可用工具:claude, gemini, qwen, iflow, qodercli, codebuddy, copilot, codex
864
+ Available tools: claude, gemini, qwen, iflow, qodercli, codebuddy, copilot, codex
865
865
 
866
866
  ---
867
- *本文档由Stigmergy CLI自动生成和维护*
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
- 当您需要调用其他AI工具时,请使用以下提示<<<在shell中执行以下命令:stigmergy <工具名> <任务描述>>>>
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
- - shell中运行:stigmergy claude "写一个Python函数"
886
- - shell中运行:stigmergy gemini "翻译这段文字"
887
- - shell中运行:stigmergy qwen "分析这段代码"
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
- 可用工具:claude, gemini, qwen, iflow, qodercli, codebuddy, copilot, codex
889
+ Available tools: claude, gemini, qwen, iflow, qodercli, codebuddy, copilot, codex
890
890
  `;
891
891
  await fs.appendFile(qoderMdPath, crossCliContent, 'utf8');
892
- console.log('QODER.md末尾追加Cross-CLI通信提示');
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] QWEN.md末尾追加Cross-CLI通信提示');
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('\n验证Qwen CLI集成安装...');
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;