stigmergy 1.1.6 → 1.2.6

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 (118) hide show
  1. package/LICENSE +18 -18
  2. package/README.md +28 -223
  3. package/STIGMERGY.md +61 -61
  4. package/docs/PROJECT_CONSTITUTION.md +433 -433
  5. package/docs/PROJECT_STRUCTURE_CURRENT.md +80 -80
  6. package/examples/calculator-example.js +72 -72
  7. package/examples/cline_usage_examples.md +364 -364
  8. package/examples/encryption-example.js +67 -67
  9. package/examples/json-parser-example.js +120 -120
  10. package/examples/json-validation-example.js +64 -64
  11. package/examples/rest-client-example.js +52 -52
  12. package/examples/rest_client_example.js +54 -54
  13. package/package.json +15 -7
  14. package/scripts/build.js +74 -74
  15. package/scripts/post-deployment-config.js +296 -296
  16. package/scripts/preinstall-check.js +173 -111
  17. package/scripts/publish.js +58 -268
  18. package/scripts/run-layered-tests.js +247 -0
  19. package/scripts/safe-install.js +139 -139
  20. package/scripts/simple-publish.js +57 -59
  21. package/src/adapters/claude/install_claude_integration.js +292 -0
  22. package/src/adapters/codebuddy/install_codebuddy_integration.js +349 -0
  23. package/src/adapters/codex/install_codex_integration.js +395 -0
  24. package/src/adapters/copilot/install_copilot_integration.js +716 -0
  25. package/src/adapters/gemini/install_gemini_integration.js +304 -0
  26. package/src/adapters/iflow/install_iflow_integration.js +304 -0
  27. package/src/adapters/qoder/install_qoder_integration.js +1090 -0
  28. package/src/adapters/qwen/install_qwen_integration.js +285 -0
  29. package/src/auth.js +173 -173
  30. package/src/auth_command.js +208 -208
  31. package/src/calculator.js +313 -313
  32. package/src/cli/router.js +792 -67
  33. package/src/core/cache_cleaner.js +767 -0
  34. package/src/core/cli_help_analyzer.js +680 -674
  35. package/src/core/cli_parameter_handler.js +132 -127
  36. package/src/core/cli_tools.js +89 -89
  37. package/src/core/coordination/index.js +16 -16
  38. package/src/core/coordination/nodejs/AdapterManager.js +102 -89
  39. package/src/core/coordination/nodejs/CLCommunication.js +132 -124
  40. package/src/core/coordination/nodejs/CLIIntegrationManager.js +272 -236
  41. package/src/core/coordination/nodejs/HealthChecker.js +76 -77
  42. package/src/core/coordination/nodejs/HookDeploymentManager.js +263 -190
  43. package/src/core/coordination/nodejs/StatisticsCollector.js +71 -71
  44. package/src/core/coordination/nodejs/index.js +90 -72
  45. package/src/core/coordination/nodejs/utils/Logger.js +29 -29
  46. package/src/core/enhanced_installer.js +479 -0
  47. package/src/core/enhanced_uninstaller.js +638 -0
  48. package/src/core/error_handler.js +406 -406
  49. package/src/core/installer.js +816 -294
  50. package/src/core/memory_manager.js +83 -83
  51. package/src/core/rest_client.js +160 -160
  52. package/src/core/smart_router.js +249 -146
  53. package/src/core/upgrade_manager.js +420 -0
  54. package/src/data_encryption.js +143 -143
  55. package/src/data_structures.js +440 -440
  56. package/src/deploy.js +55 -55
  57. package/src/index.js +30 -30
  58. package/src/test/cli-availability-checker.js +194 -0
  59. package/src/test/test-environment.js +289 -0
  60. package/src/utils/helpers.js +35 -35
  61. package/src/utils.js +921 -915
  62. package/src/weatherProcessor.js +228 -228
  63. package/test/calculator.test.js +0 -215
  64. package/test/collision-test.js +0 -26
  65. package/test/comprehensive-execution-test.js +0 -428
  66. package/test/conflict-prevention-test.js +0 -95
  67. package/test/cross-cli-detection-test.js +0 -33
  68. package/test/csv-processing-test.js +0 -36
  69. package/test/deploy-hooks-test.js +0 -250
  70. package/test/e2e/claude-cli-test.js +0 -128
  71. package/test/e2e/collaboration-test.js +0 -75
  72. package/test/e2e/comprehensive-test.js +0 -431
  73. package/test/e2e/error-handling-test.js +0 -90
  74. package/test/e2e/individual-tool-test.js +0 -143
  75. package/test/e2e/other-cli-test.js +0 -130
  76. package/test/e2e/qoder-cli-test.js +0 -128
  77. package/test/e2e/run-e2e-tests.js +0 -73
  78. package/test/e2e/test-data.js +0 -88
  79. package/test/e2e/test-utils.js +0 -222
  80. package/test/encryption-simple-test.js +0 -110
  81. package/test/encryption.test.js +0 -129
  82. package/test/enhanced-main-alignment.test.js +0 -298
  83. package/test/error-handling-test.js +0 -341
  84. package/test/fibonacci.test.js +0 -178
  85. package/test/final-deploy-test.js +0 -221
  86. package/test/final-install-test.js +0 -226
  87. package/test/hash-table-demo.js +0 -33
  88. package/test/hash-table-test.js +0 -26
  89. package/test/hash_table_test.js +0 -114
  90. package/test/hook-system-integration-test.js +0 -307
  91. package/test/iflow-integration-test.js +0 -292
  92. package/test/improved-install-test.js +0 -362
  93. package/test/install-command-test.js +0 -370
  94. package/test/json-parser-test.js +0 -161
  95. package/test/json-validation-test.js +0 -164
  96. package/test/natural-language-skills-test.js +0 -320
  97. package/test/nl-integration-test.js +0 -179
  98. package/test/parameter-parsing-test.js +0 -143
  99. package/test/plugin-deployment-test.js +0 -316
  100. package/test/postinstall-test.js +0 -269
  101. package/test/python-plugins-test.js +0 -259
  102. package/test/real-test.js +0 -435
  103. package/test/remaining-adapters-test.js +0 -256
  104. package/test/rest-client-test.js +0 -56
  105. package/test/rest_client.test.js +0 -85
  106. package/test/simple-iflow-hook-test.js +0 -137
  107. package/test/system-compatibility-test.js +0 -467
  108. package/test/tdd-deploy-fix-test.js +0 -324
  109. package/test/tdd-fixes-test.js +0 -211
  110. package/test/third-party-skills-test.js +0 -321
  111. package/test/tool-selection-integration-test.js +0 -158
  112. package/test/unit/calculator-full.test.js +0 -191
  113. package/test/unit/calculator-simple.test.js +0 -96
  114. package/test/unit/calculator.test.js +0 -97
  115. package/test/unit/cli-scanner.test.js +0 -291
  116. package/test/unit/cli_parameter_handler.test.js +0 -116
  117. package/test/unit/cross-cli-executor.test.js +0 -399
  118. package/test/weather-processor.test.js +0 -104
package/LICENSE CHANGED
@@ -1,19 +1,19 @@
1
- MIT 许可证
2
-
3
- 版权所有 (c) 2025 Zhang
4
-
5
- 特此授权,任何人免费获得此软件及相关文档文件("软件")的副本,
6
- 有权使用、复制、修改、合并、发布、分发、再许可和/或出售软件的副本,
7
- 并有权授予软件使用许可,但须遵守以下条件:
8
-
9
- 软件中包含以上的版权声明和本许可声明。
10
-
11
- 本软件按"现状"提供,不提供任何形式的明示或暗示担保,
12
- 包括但不限于适销性、特定用途的适用性和非侵权性。
13
- 在任何情况下,作者或版权持有人均不对任何索赔、损害或其他
14
- 责任承担责任,无论是合同诉讼、侵权诉讼还是其它诉讼行为,
15
- 与本软件或本软件的使用有关或与其产生的其他交易有关。
16
-
17
- 联系方式:
18
- - 项目官网: http://www.socienceAI.com
1
+ MIT 许可证
2
+
3
+ 版权所有 (c) 2025 Zhang
4
+
5
+ 特此授权,任何人免费获得此软件及相关文档文件("软件")的副本,
6
+ 有权使用、复制、修改、合并、发布、分发、再许可和/或出售软件的副本,
7
+ 并有权授予软件使用许可,但须遵守以下条件:
8
+
9
+ 软件中包含以上的版权声明和本许可声明。
10
+
11
+ 本软件按"现状"提供,不提供任何形式的明示或暗示担保,
12
+ 包括但不限于适销性、特定用途的适用性和非侵权性。
13
+ 在任何情况下,作者或版权持有人均不对任何索赔、损害或其他
14
+ 责任承担责任,无论是合同诉讼、侵权诉讼还是其它诉讼行为,
15
+ 与本软件或本软件的使用有关或与其产生的其他交易有关。
16
+
17
+ 联系方式:
18
+ - 项目官网: http://www.socienceAI.com
19
19
  - 技术支持: 3061176@qq.com
package/README.md CHANGED
@@ -1,240 +1,45 @@
1
- # Stigmergy CLI - Multi-Agents Cross-AI CLI Tool Collaboration System
1
+ # Stigmergy CLI Multi-Agents System
2
2
 
3
- > **Important: This is not a standalone CLI tool, but an enhancement system!**
4
- >
5
- > Stigmergy CLI enables existing AI CLI tools to collaborate with each other through a plugin system, rather than replacing them.
3
+ A comprehensive system for collaboration between multiple AI CLI tools. This monorepo contains several related packages:
6
4
 
7
- [![Node.js](https://img.shields.io/badge/node-16+-green.svg)](https://nodejs.org)
8
- [![NPM](https://img.shields.io/badge/npm-stigmergy-blue.svg)](https://www.npmjs.com/package/stigmergy)
9
- [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
10
- [![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey.svg)]()
5
+ ## Packages
11
6
 
12
- ## Quick Start
13
-
14
- ### One-Click Deployment (Recommended)
15
-
16
- ```bash
17
- # Install Stigmergy CLI globally
18
- npm install -g stigmergy
7
+ - `stigmergy` (Core): Main coordination system for multi-agent AI CLI tools
8
+ - `@stigmergy/skills`: Natural language skills for AI CLI tools
9
+ - `@stigmergy/resume`: Cross-CLI memory sharing and session recovery
10
+ - `@stigmergy/sessions`: Cross-CLI session management and recovery
19
11
 
20
- # Run interactive setup
21
- stigmergy
22
- ```
12
+ ## Features
23
13
 
24
- This command will:
25
- - Scan your system for available AI CLI tools
26
- - Install missing tools with your permission
27
- - Configure automatic cross-tool collaboration
28
- - Set up hook integrations for seamless communication
14
+ - 🤖 Multi-agent AI CLI tools collaboration (Claude, Gemini, Qwen, etc.)
15
+ - 🎯 Natural language skills processing
16
+ - 🧠 Cross-CLI memory sharing and session recovery
17
+ - 🔗 Hook integration for seamless AI tool usage
18
+ - 🌍 International encoding support (ANSI-based for global compatibility)
19
+ - ⚡ Intelligent command routing and execution
29
20
 
30
- ### Manual Installation
21
+ ## Quick Start
31
22
 
32
23
  ```bash
24
+ # Install the core system
33
25
  npm install -g stigmergy
34
- stigmergy --help
35
- ```
36
-
37
- ## Supported AI CLI Tools
38
-
39
- Stigmergy CLI enhances the following AI CLI tools:
40
-
41
- - **Claude CLI** - Anthropic's Claude assistant
42
- - **Gemini CLI** - Google's Gemini AI
43
- - **Qwen CLI** - Alibaba's Qwen model
44
- - **iFlow CLI** - Intelligent workflow automation
45
- - **Qoder CLI** - AI-powered code generation
46
- - **CodeBuddy CLI** - Programming assistant
47
- - **GitHub Copilot CLI** - Microsoft's Copilot
48
- - **OpenAI Codex CLI** - OpenAI's code completion
49
-
50
- ## Dual Implementation Architecture
51
-
52
- Stigmergy CLI features a unique dual implementation architecture:
53
-
54
- ### Node.js First Approach
55
- - **Primary Implementation**: Native Node.js coordination layer
56
- - **No System Python Required**: Works without Python installation
57
- - **Graceful Degradation**: Falls back to Python when needed
58
- - **Enhanced Performance**: Optimized for modern Node.js environments
59
-
60
- ### Python Fallback
61
- - **Secondary Implementation**: Python-based coordination layer
62
- - **Legacy Support**: Maintains compatibility with existing installations
63
- - **Automatic Detection**: Seamlessly switches based on system capabilities
64
-
65
- This architecture ensures maximum compatibility and reliability across different environments.
66
-
67
- ## Usage
68
-
69
- ### Basic Commands
70
-
71
- ```bash
72
- # Show help
73
- stigmergy --help
74
-
75
- # Check version
76
- stigmergy --version
77
-
78
- # Scan for available AI CLI tools
79
- stigmergy scan
80
-
81
- # Check system status
82
- stigmergy status
83
-
84
- # Interactive installation mode
85
- stigmergy install
86
-
87
- # Deploy hooks to all tools
88
- stigmergy deploy
89
-
90
- # Remove all Stigmergy hooks from tools
91
- stigmergy remove
92
-
93
- # Complete setup (scan + install + deploy)
94
- stigmergy setup
95
- ```
96
-
97
- ### Cross-CLI Collaboration
98
-
99
- Once installed, you can use AI CLI tools to collaborate with each other:
100
-
101
- ```bash
102
- # Use Claude to analyze code
103
- stigmergy call claude "analyze this function"
104
-
105
- # Use Gemini for documentation
106
- stigmergy call gemini "generate docs for this file"
107
-
108
- # Use Qwen for translation
109
- stigmergy call qwen "translate to English"
110
-
111
- # Use Copilot for code suggestions
112
- stigmergy call copilot "suggest improvements"
113
- ```
114
26
 
115
- ### User Authentication
27
+ # Install packages
28
+ npm install -g @stigmergy/skills @stigmergy/resume @stigmergy/sessions
116
29
 
117
- Stigmergy CLI now supports user authentication to protect your AI tools and configurations:
118
-
119
- ```bash
120
- # Register a new account
121
- stigmergy register <username> <password>
122
-
123
- # Log in to your account
124
- stigmergy login <username> <password>
125
-
126
- # Check authentication status
127
- stigmergy auth-status
128
-
129
- # Log out of your account
130
- stigmergy logout
30
+ # Use unified commands
31
+ sg-skills "translate this to English"
32
+ sg-resume status
33
+ sg-sessions stats
131
34
  ```
132
35
 
133
- Protected commands (like `call`, `setup`, `deploy`, `install`) require authentication before use.
134
-
135
- ### Installation Workflow
136
-
137
- 1. **Scan**: `stigmergy scan` - Detects installed AI CLI tools
138
- 2. **Install**: `stigmergy install` - Interactive tool installation
139
- 3. **Deploy**: `stigmergy deploy` - Sets up cross-tool communication
140
- 4. **Use**: `stigmergy call <tool> <prompt>` - Start collaborating
141
-
142
- ## Safety and Conflict Prevention
143
-
144
- Stigmergy includes a comprehensive conflict prevention system to ensure it doesn't interfere with other CLI tools:
145
-
146
- - **Pre-installation checks** to prevent conflicts
147
- - **Runtime monitoring** for system integrity
148
- - **Automatic conflict resolution** tools
149
- - **Emergency recovery** procedures
36
+ ## Documentation
150
37
 
151
- If you experience issues with other CLI tools:
152
- ```bash
153
- npm run fix-node-conflict
154
- ```
155
-
156
- For more information, see [Conflict Prevention System](docs/CONFLICT_PREVENTION.md).
157
-
158
- ```json
159
- {
160
- "version": "1.0.76",
161
- "installed": "2025-12-07T00:00:00.000Z",
162
- "projectPath": "/path/to/project",
163
- "availableTools": ["claude", "gemini", "qwen"],
164
- "collaboration": {
165
- "enabled": true,
166
- "protocols": [
167
- "Use {cli} to {task}",
168
- "Call {cli} to {task}",
169
- "Ask {cli} for {task}"
170
- ]
171
- }
172
- }
173
- ```
174
-
175
- ### Project Configuration
176
-
177
- Each project gets a `STIGMERGY.md` file with tool-specific usage instructions.
178
-
179
- ## Features
180
-
181
- - **Automated Detection**: Scans for installed AI CLI tools
182
- - **Interactive Installation**: One-click installation of missing tools
183
- - **Cross-Tool Communication**: Enables AI CLI tools to work together
184
- - **Hook Integration**: Deploys integration hooks to each tool
185
- - **International Support**: Pure ANSI character output for global compatibility
186
- - **Auto-Setup**: Configures everything automatically on npm install
187
-
188
- ## Development
189
-
190
- ### Project Structure
191
-
192
- ```
193
- stigmergy-CLI-Multi-Agents/
194
- ├── src/
195
- │ ├── main.js # Main CLI logic
196
- │ └── index.js # Entry point
197
- ├── package.json # NPM configuration
198
- └── README.md # This file
199
- ```
200
-
201
- ### Building from Source
202
-
203
- ```bash
204
- # Clone the repository
205
- git clone https://github.com/ptreezh/stigmergy-CLI-Multi-Agents.git
206
- cd stigmergy-CLI-Multi-Agents
207
-
208
- # Install dependencies
209
- npm install
210
-
211
- # Install globally for testing
212
- npm install -g .
213
- ```
38
+ - [Main System](./README.md)
39
+ - [Skills Package](./packages/skills/README.md)
40
+ - [Resume Session](./packages/resume/README.md)
41
+ - [Session Management](./packages/sessions/README.md)
214
42
 
215
43
  ## Contributing
216
44
 
217
- 1. Fork the repository
218
- 2. Create a feature branch
219
- 3. Make your changes
220
- 4. Test thoroughly
221
- 5. Submit a pull request
222
-
223
- ## License
224
-
225
- MIT License - see [LICENSE](LICENSE) file for details.
226
-
227
- ## Support
228
-
229
- - **Documentation**: https://github.com/ptreezh/stigmergy-CLI-Multi-Agents
230
- - **Issues**: https://github.com/ptreezh/stigmergy-CLI-Multi-Agents/issues
231
- - **NPM**: https://www.npmjs.com/package/stigmergy
232
-
233
- ## Changelog
234
-
235
- ### Version 1.0.76
236
- - Unified international version with pure ANSI characters
237
- - Single source of truth for all CLI logic
238
- - Automated installation and deployment system
239
- - Enhanced error handling and validation
240
- - Removed all redundant scripts and configurations
45
+ This project follows the MIT License. Contributions are welcome!
package/STIGMERGY.md CHANGED
@@ -1,62 +1,62 @@
1
- # Stigmergy Multi-AI CLI Collaboration
2
-
3
- This project is configured for Stigmergy-based multi-AI CLI collaboration.
4
-
5
- ## Available AI CLI Tools
6
-
7
- Cross-CLI communication is enabled between all supported AI tools:
8
- - Claude (Anthropic)
9
- - Qwen (Alibaba)
10
- - Gemini (Google)
11
- - iFlow (Intelligent Workflow)
12
- - Qoder CLI
13
- - CodeBuddy
14
- - GitHub Copilot
15
- - OpenAI Codex
16
-
17
- ## Cross-CLI Collaboration
18
-
19
- Instead of using a central command, cross-CLI communication happens directly between tools through hooks:
20
-
21
- ### How It Works
22
- 1. Each CLI tool has hooks deployed by Stigmergy
23
- 2. When one tool detects a request to use another tool, it triggers cross-CLI communication
24
- 3. The target tool executes the requested task and returns results
25
-
26
- ### Usage Pattern
27
- From any supported CLI tool, use natural language patterns:
28
- ```bash
29
- # Natural language patterns recognized by hooks
30
- "use qwen to translate this code to Python"
31
- "ask claude to review this algorithm"
32
- "call gemini to explain this concept"
33
- ```
34
-
35
- ## Project Memory and Documentation
36
-
37
- This project automatically generates documentation for each CLI tool:
38
- - claude.md
39
- - qwen.md
40
- - gemini.md
41
- - iflow.md
42
- - qodercli.md
43
- - codebuddy.md
44
- - copilot.md
45
- - codex.md
46
-
47
- Each documentation file contains:
48
- - Tool configuration information
49
- - Usage patterns
50
- - Cross-CLI communication instructions
51
-
52
- ## Configuration
53
-
54
- Global configuration: `~/.stigmergy/config.json`
55
-
56
- ## Getting Started
57
-
58
- 1. Run `stigmergy status` to verify setup
59
- 2. Check individual CLI documentation files for specific usage instructions
60
- 3. Use natural language requests within any CLI tool to trigger cross-CLI communication
61
-
1
+ # Stigmergy Multi-AI CLI Collaboration
2
+
3
+ This project is configured for Stigmergy-based multi-AI CLI collaboration.
4
+
5
+ ## Available AI CLI Tools
6
+
7
+ Cross-CLI communication is enabled between all supported AI tools:
8
+ - Claude (Anthropic)
9
+ - Qwen (Alibaba)
10
+ - Gemini (Google)
11
+ - iFlow (Intelligent Workflow)
12
+ - Qoder CLI
13
+ - CodeBuddy
14
+ - GitHub Copilot
15
+ - OpenAI Codex
16
+
17
+ ## Cross-CLI Collaboration
18
+
19
+ Instead of using a central command, cross-CLI communication happens directly between tools through hooks:
20
+
21
+ ### How It Works
22
+ 1. Each CLI tool has hooks deployed by Stigmergy
23
+ 2. When one tool detects a request to use another tool, it triggers cross-CLI communication
24
+ 3. The target tool executes the requested task and returns results
25
+
26
+ ### Usage Pattern
27
+ From any supported CLI tool, use natural language patterns:
28
+ ```bash
29
+ # Natural language patterns recognized by hooks
30
+ "use qwen to translate this code to Python"
31
+ "ask claude to review this algorithm"
32
+ "call gemini to explain this concept"
33
+ ```
34
+
35
+ ## Project Memory and Documentation
36
+
37
+ This project automatically generates documentation for each CLI tool:
38
+ - claude.md
39
+ - qwen.md
40
+ - gemini.md
41
+ - iflow.md
42
+ - qodercli.md
43
+ - codebuddy.md
44
+ - copilot.md
45
+ - codex.md
46
+
47
+ Each documentation file contains:
48
+ - Tool configuration information
49
+ - Usage patterns
50
+ - Cross-CLI communication instructions
51
+
52
+ ## Configuration
53
+
54
+ Global configuration: `~/.stigmergy/config.json`
55
+
56
+ ## Getting Started
57
+
58
+ 1. Run `stigmergy status` to verify setup
59
+ 2. Check individual CLI documentation files for specific usage instructions
60
+ 3. Use natural language requests within any CLI tool to trigger cross-CLI communication
61
+
62
62
  For more information: https://github.com/ptreezh/stigmergy-CLI-Multi-Agents