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
@@ -1,81 +1,81 @@
1
- # 项目结构说明
2
-
3
- ## 📁 整理后的目录结构
4
-
5
- ```
6
- smart-cli-router/
7
- ├── 📄 README.md # 项目主要说明文档
8
- ├── 📄 claude.md # Claude Code 项目指导文档
9
- ├── 📄 INSTALL.md # 安装说明
10
- ├── 📄 INTEGRATION_GUIDE.md # 集成指南
11
- ├── 📄 PROJECT_SPEC.json # 项目规范(空文件,待填充)
12
- ├── 📄 setup.py # Python 包配置
13
- ├── 📄 package.json # Node.js 配置
14
- ├── 📄 pytest.ini # pytest 配置
15
- ├── 📁 src/ # 核心源代码
16
- │ ├── 📁 adapters/ # CLI适配器实现
17
- │ ├── 📁 core/ # 核心框架组件
18
- │ └── 📁 utils/ # 工具函数
19
- ├── 📁 tests/ # 测试文件
20
- │ ├── 📁 unit/ # 单元测试
21
- │ └── 📁 integration/ # 集成测试
22
- ├── 📁 docs/ # 技术文档
23
- │ ├── 📄 PROJECT_CONSTITUTION.md # 项目宪法
24
- │ ├── 📄 PROJECT_REQUIREMENTS.md # 需求规范
25
- │ ├── 📄 UNIFIED_TECHNICAL_ARCHITECTURE.md # 技术架构
26
- │ ├── 📄 NATIVE_INTEGRATION_GUIDE.md # 原生集成指南
27
- │ └── 📄 PROJECT_STRUCTURE.md # 项目结构说明
28
- ├── 📁 scripts/ # 构建和部署脚本
29
- ├── 📁 templates/ # 模板文件
30
- ├── 📁 deployment/ # 部署相关文件
31
- ├── 📁 test-deployment/ # 部署测试
32
- ├── 📁 archive/ # 🗂️ 存档目录(冗余文件)
33
- │ ├── 📄 README.md # 存档说明
34
- │ ├── 📁 obsolete_docs/ # 废弃文档
35
- │ ├── 📁 obsolete_scripts/ # 废弃脚本
36
- │ ├── 📁 obsolete_configs/ # 废弃配置
37
- │ ├── 📁 demo_scripts/ # 演示脚本
38
- │ ├── 📁 reports/ # 报告文件
39
- │ └── 📁 obsolete_files/ # 历史文件
40
- └── 📁 node_modules/ # Node.js依赖
41
- ```
42
-
43
- ## 🧹 项目整理说明
44
-
45
- ### 已移动到存档的文件类型
46
-
47
- 1. **重复文档** - 多个版本的README、安装指南、部署文档
48
- 2. **过时脚本** - 旧版本的安装脚本、部署脚本
49
- 3. **测试报告** - TDD报告、验证报告、部署报告
50
- 4. **演示代码** - 功能演示脚本、示例代码
51
- 5. **临时文件** - 开发过程中的临时配置和脚本
52
-
53
- ### 保留的核心文件
54
-
55
- - **项目文档**: README.md, claude.md, INSTALL.md, INTEGRATION_GUIDE.md
56
- - **技术文档**: 移动到 `docs/` 目录统一管理
57
- - **核心代码**: `src/` 目录下的所有源代码
58
- - **测试代码**: `tests/` 目录下的所有测试文件
59
- - **配置文件**: package.json, setup.py, pytest.ini
60
- - **脚本模板**: `scripts/`, `templates/` 目录
61
-
62
- ## 📋 文件组织原则
63
-
64
- 1. **根目录简洁** - 只保留必要的项目配置和说明文档
65
- 2. **功能分类** - 按功能将文件组织到不同目录
66
- 3. **历史保留** - 废弃文件移至存档而非删除
67
- 4. **文档统一** - 技术文档集中在 `docs/` 目录
68
- 5. **依赖分离** - 第三方依赖使用标准目录结构
69
-
70
- ## 🔍 快速导航
71
-
72
- - **新用户** → 阅读 `README.md` 开始使用
73
- - **开发者** → 查看 `claude.md` 了解开发指南
74
- - **安装部署** → 参考 `INSTALL.md` 和 `deployment/` 目录
75
- - **技术架构** → 查看 `docs/` 目录下的技术文档
76
- - **源代码** → 浏览 `src/` 目录
77
- - **测试** → 运行 `tests/` 目录下的测试
78
- - **历史文件** → 查看 `archive/` 目录
79
-
80
- ---
1
+ # 项目结构说明
2
+
3
+ ## 📁 整理后的目录结构
4
+
5
+ ```
6
+ smart-cli-router/
7
+ ├── 📄 README.md # 项目主要说明文档
8
+ ├── 📄 claude.md # Claude Code 项目指导文档
9
+ ├── 📄 INSTALL.md # 安装说明
10
+ ├── 📄 INTEGRATION_GUIDE.md # 集成指南
11
+ ├── 📄 PROJECT_SPEC.json # 项目规范(空文件,待填充)
12
+ ├── 📄 setup.py # Python 包配置
13
+ ├── 📄 package.json # Node.js 配置
14
+ ├── 📄 pytest.ini # pytest 配置
15
+ ├── 📁 src/ # 核心源代码
16
+ │ ├── 📁 adapters/ # CLI适配器实现
17
+ │ ├── 📁 core/ # 核心框架组件
18
+ │ └── 📁 utils/ # 工具函数
19
+ ├── 📁 tests/ # 测试文件
20
+ │ ├── 📁 unit/ # 单元测试
21
+ │ └── 📁 integration/ # 集成测试
22
+ ├── 📁 docs/ # 技术文档
23
+ │ ├── 📄 PROJECT_CONSTITUTION.md # 项目宪法
24
+ │ ├── 📄 PROJECT_REQUIREMENTS.md # 需求规范
25
+ │ ├── 📄 UNIFIED_TECHNICAL_ARCHITECTURE.md # 技术架构
26
+ │ ├── 📄 NATIVE_INTEGRATION_GUIDE.md # 原生集成指南
27
+ │ └── 📄 PROJECT_STRUCTURE.md # 项目结构说明
28
+ ├── 📁 scripts/ # 构建和部署脚本
29
+ ├── 📁 templates/ # 模板文件
30
+ ├── 📁 deployment/ # 部署相关文件
31
+ ├── 📁 test-deployment/ # 部署测试
32
+ ├── 📁 archive/ # 🗂️ 存档目录(冗余文件)
33
+ │ ├── 📄 README.md # 存档说明
34
+ │ ├── 📁 obsolete_docs/ # 废弃文档
35
+ │ ├── 📁 obsolete_scripts/ # 废弃脚本
36
+ │ ├── 📁 obsolete_configs/ # 废弃配置
37
+ │ ├── 📁 demo_scripts/ # 演示脚本
38
+ │ ├── 📁 reports/ # 报告文件
39
+ │ └── 📁 obsolete_files/ # 历史文件
40
+ └── 📁 node_modules/ # Node.js依赖
41
+ ```
42
+
43
+ ## 🧹 项目整理说明
44
+
45
+ ### 已移动到存档的文件类型
46
+
47
+ 1. **重复文档** - 多个版本的README、安装指南、部署文档
48
+ 2. **过时脚本** - 旧版本的安装脚本、部署脚本
49
+ 3. **测试报告** - TDD报告、验证报告、部署报告
50
+ 4. **演示代码** - 功能演示脚本、示例代码
51
+ 5. **临时文件** - 开发过程中的临时配置和脚本
52
+
53
+ ### 保留的核心文件
54
+
55
+ - **项目文档**: README.md, claude.md, INSTALL.md, INTEGRATION_GUIDE.md
56
+ - **技术文档**: 移动到 `docs/` 目录统一管理
57
+ - **核心代码**: `src/` 目录下的所有源代码
58
+ - **测试代码**: `tests/` 目录下的所有测试文件
59
+ - **配置文件**: package.json, setup.py, pytest.ini
60
+ - **脚本模板**: `scripts/`, `templates/` 目录
61
+
62
+ ## 📋 文件组织原则
63
+
64
+ 1. **根目录简洁** - 只保留必要的项目配置和说明文档
65
+ 2. **功能分类** - 按功能将文件组织到不同目录
66
+ 3. **历史保留** - 废弃文件移至存档而非删除
67
+ 4. **文档统一** - 技术文档集中在 `docs/` 目录
68
+ 5. **依赖分离** - 第三方依赖使用标准目录结构
69
+
70
+ ## 🔍 快速导航
71
+
72
+ - **新用户** → 阅读 `README.md` 开始使用
73
+ - **开发者** → 查看 `claude.md` 了解开发指南
74
+ - **安装部署** → 参考 `INSTALL.md` 和 `deployment/` 目录
75
+ - **技术架构** → 查看 `docs/` 目录下的技术文档
76
+ - **源代码** → 浏览 `src/` 目录
77
+ - **测试** → 运行 `tests/` 目录下的测试
78
+ - **历史文件** → 查看 `archive/` 目录
79
+
80
+ ---
81
81
  *项目结构整理于 2025-11-26*
@@ -1,72 +1,72 @@
1
- /**
2
- * Example usage of the Calculator class
3
- */
4
-
5
- const Calculator = require('../src/calculator');
6
-
7
- // Create a new calculator instance
8
- const calc = new Calculator();
9
-
10
- // Basic operations
11
- console.log('=== Basic Operations ===');
12
- console.log(`Addition: 5 + 3 = ${calc.add(5, 3)}`);
13
- console.log(`Subtraction: 10 - 4 = ${calc.subtract(10, 4)}`);
14
- console.log(`Multiplication: 6 * 7 = ${calc.multiply(6, 7)}`);
15
- console.log(`Division: 15 / 3 = ${calc.divide(15, 3)}`);
16
- console.log(`Power: 2^8 = ${calc.power(2, 8)}`);
17
- console.log(`Square Root: √64 = ${calc.sqrt(64)}`);
18
- console.log(`Factorial: 5! = ${calc.factorial(5)}`);
19
- console.log(`Percentage: 25 is what percent of 200 = ${calc.percentage(25, 200)}%`);
20
-
21
- // Chained calculations
22
- console.log('\n=== Chained Calculations ===');
23
- const result1 = calc.chain(10)
24
- .add(5)
25
- .multiply(2)
26
- .subtract(10)
27
- .divide(4)
28
- .equals();
29
-
30
- console.log(`((10 + 5) * 2 - 10) / 4 = ${result1}`);
31
-
32
- // More complex chained calculation
33
- const result2 = calc.chain(2)
34
- .power(3)
35
- .add(1)
36
- .multiply(2)
37
- .sqrt()
38
- .equals();
39
-
40
- console.log(`√(((2^3) + 1) * 2) = ${result2}`);
41
-
42
- // Getting intermediate values
43
- console.log('\n=== Intermediate Values ===');
44
- const chain = calc.chain(100)
45
- .subtract(20) // 80
46
- .divide(4) // 20
47
- .add(5); // 25
48
-
49
- console.log(`Intermediate result: ${chain.value()}`);
50
-
51
- const finalResult = chain.multiply(2).equals(); // 50
52
- console.log(`Final result: ${finalResult}`);
53
-
54
- // Error handling examples
55
- console.log('\n=== Error Handling ===');
56
- try {
57
- calc.divide(10, 0);
58
- } catch (error) {
59
- console.log(`Error caught: ${error.message}`);
60
- }
61
-
62
- try {
63
- calc.sqrt(-1);
64
- } catch (error) {
65
- console.log(`Error caught: ${error.message}`);
66
- }
67
-
68
- try {
69
- calc.chain(10).divide(0);
70
- } catch (error) {
71
- console.log(`Error caught: ${error.message}`);
72
- }
1
+ /**
2
+ * Example usage of the Calculator class
3
+ */
4
+
5
+ const Calculator = require('../src/calculator');
6
+
7
+ // Create a new calculator instance
8
+ const calc = new Calculator();
9
+
10
+ // Basic operations
11
+ console.log('=== Basic Operations ===');
12
+ console.log(`Addition: 5 + 3 = ${calc.add(5, 3)}`);
13
+ console.log(`Subtraction: 10 - 4 = ${calc.subtract(10, 4)}`);
14
+ console.log(`Multiplication: 6 * 7 = ${calc.multiply(6, 7)}`);
15
+ console.log(`Division: 15 / 3 = ${calc.divide(15, 3)}`);
16
+ console.log(`Power: 2^8 = ${calc.power(2, 8)}`);
17
+ console.log(`Square Root: �?4 = ${calc.sqrt(64)}`);
18
+ console.log(`Factorial: 5! = ${calc.factorial(5)}`);
19
+ console.log(`Percentage: 25 is what percent of 200 = ${calc.percentage(25, 200)}%`);
20
+
21
+ // Chained calculations
22
+ console.log('\n=== Chained Calculations ===');
23
+ const result1 = calc.chain(10)
24
+ .add(5)
25
+ .multiply(2)
26
+ .subtract(10)
27
+ .divide(4)
28
+ .equals();
29
+
30
+ console.log(`((10 + 5) * 2 - 10) / 4 = ${result1}`);
31
+
32
+ // More complex chained calculation
33
+ const result2 = calc.chain(2)
34
+ .power(3)
35
+ .add(1)
36
+ .multiply(2)
37
+ .sqrt()
38
+ .equals();
39
+
40
+ console.log(`�?((2^3) + 1) * 2) = ${result2}`);
41
+
42
+ // Getting intermediate values
43
+ console.log('\n=== Intermediate Values ===');
44
+ const chain = calc.chain(100)
45
+ .subtract(20) // 80
46
+ .divide(4) // 20
47
+ .add(5); // 25
48
+
49
+ console.log(`Intermediate result: ${chain.value()}`);
50
+
51
+ const finalResult = chain.multiply(2).equals(); // 50
52
+ console.log(`Final result: ${finalResult}`);
53
+
54
+ // Error handling examples
55
+ console.log('\n=== Error Handling ===');
56
+ try {
57
+ calc.divide(10, 0);
58
+ } catch (error) {
59
+ console.log(`Error caught: ${error.message}`);
60
+ }
61
+
62
+ try {
63
+ calc.sqrt(-1);
64
+ } catch (error) {
65
+ console.log(`Error caught: ${error.message}`);
66
+ }
67
+
68
+ try {
69
+ calc.chain(10).divide(0);
70
+ } catch (error) {
71
+ console.log(`Error caught: ${error.message}`);
72
+ }