stigmergy 1.2.0 → 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 (125) 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 +36 -15
  14. package/scripts/build.js +74 -74
  15. package/scripts/post-deployment-config.js +296 -296
  16. package/scripts/preinstall-check.js +173 -173
  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 +417 -38
  33. package/src/core/cache_cleaner.js +767 -744
  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 -456
  47. package/src/core/enhanced_uninstaller.js +638 -618
  48. package/src/core/error_handler.js +406 -406
  49. package/src/core/installer.js +815 -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 +76 -59
  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/cache-cleaner-implemented.test.js +0 -328
  64. package/test/cache-cleaner.test.js +0 -390
  65. package/test/calculator.test.js +0 -215
  66. package/test/collision-test.js +0 -26
  67. package/test/comprehensive-enhanced-features.test.js +0 -252
  68. package/test/comprehensive-execution-test.js +0 -428
  69. package/test/conflict-prevention-test.js +0 -95
  70. package/test/cross-cli-detection-test.js +0 -33
  71. package/test/csv-processing-test.js +0 -36
  72. package/test/deploy-hooks-test.js +0 -250
  73. package/test/e2e/claude-cli-test.js +0 -128
  74. package/test/e2e/collaboration-test.js +0 -75
  75. package/test/e2e/comprehensive-test.js +0 -431
  76. package/test/e2e/error-handling-test.js +0 -90
  77. package/test/e2e/individual-tool-test.js +0 -143
  78. package/test/e2e/other-cli-test.js +0 -130
  79. package/test/e2e/qoder-cli-test.js +0 -128
  80. package/test/e2e/run-e2e-tests.js +0 -73
  81. package/test/e2e/test-data.js +0 -88
  82. package/test/e2e/test-utils.js +0 -222
  83. package/test/encryption-simple-test.js +0 -110
  84. package/test/encryption.test.js +0 -129
  85. package/test/enhanced-main-alignment.test.js +0 -298
  86. package/test/enhanced-uninstaller-implemented.test.js +0 -271
  87. package/test/enhanced-uninstaller.test.js +0 -284
  88. package/test/error-handling-test.js +0 -341
  89. package/test/fibonacci.test.js +0 -178
  90. package/test/final-deploy-test.js +0 -221
  91. package/test/final-install-test.js +0 -226
  92. package/test/hash-table-demo.js +0 -33
  93. package/test/hash-table-test.js +0 -26
  94. package/test/hash_table_test.js +0 -114
  95. package/test/hook-system-integration-test.js +0 -307
  96. package/test/iflow-integration-test.js +0 -292
  97. package/test/improved-install-test.js +0 -362
  98. package/test/install-command-test.js +0 -370
  99. package/test/json-parser-test.js +0 -161
  100. package/test/json-validation-test.js +0 -164
  101. package/test/natural-language-skills-test.js +0 -320
  102. package/test/nl-integration-test.js +0 -179
  103. package/test/parameter-parsing-test.js +0 -143
  104. package/test/plugin-deployment-test.js +0 -316
  105. package/test/postinstall-test.js +0 -269
  106. package/test/python-plugins-test.js +0 -259
  107. package/test/real-test.js +0 -435
  108. package/test/remaining-adapters-test.js +0 -256
  109. package/test/rest-client-test.js +0 -56
  110. package/test/rest_client.test.js +0 -85
  111. package/test/safe-installation-cleaner.test.js +0 -343
  112. package/test/simple-iflow-hook-test.js +0 -137
  113. package/test/stigmergy-upgrade-test.js +0 -243
  114. package/test/system-compatibility-test.js +0 -467
  115. package/test/tdd-deploy-fix-test.js +0 -324
  116. package/test/tdd-fixes-test.js +0 -211
  117. package/test/third-party-skills-test.js +0 -321
  118. package/test/tool-selection-integration-test.js +0 -158
  119. package/test/unit/calculator-full.test.js +0 -191
  120. package/test/unit/calculator-simple.test.js +0 -96
  121. package/test/unit/calculator.test.js +0 -97
  122. package/test/unit/cli-scanner.test.js +0 -291
  123. package/test/unit/cli_parameter_handler.test.js +0 -116
  124. package/test/unit/cross-cli-executor.test.js +0 -399
  125. package/test/weather-processor.test.js +0 -104
@@ -1,54 +1,54 @@
1
- /**
2
- * Example usage of the REST Client
3
- */
4
-
5
- const RestClient = require('../src/core/rest_client');
6
-
7
- async function example() {
8
- // Create a new REST client instance
9
- const client = new RestClient('https://jsonplaceholder.typicode.com');
10
-
11
- try {
12
- // Example 1: Simple GET request
13
- console.log('=== Example 1: GET Request ===');
14
- const posts = await client.get('/posts', { params: { _limit: 5 } });
15
- console.log(`Retrieved ${posts.data.length} posts`);
16
- console.log('First post title:', posts.data[0].title);
17
-
18
- // Example 2: POST request
19
- console.log('\n=== Example 2: POST Request ===');
20
- const newPost = {
21
- title: 'My New Post',
22
- body: 'This is the content of my new post',
23
- userId: 1
24
- };
25
-
26
- const createdPost = await client.post('/posts', newPost);
27
- console.log('Created post with ID:', createdPost.data.id);
28
-
29
- // Example 3: Setting authorization header
30
- console.log('\n=== Example 3: Using Authorization ===');
31
- client.setAuthorization('your-api-token-here');
32
- console.log('Authorization header set');
33
-
34
- // Example 4: Custom headers
35
- console.log('\n=== Example 4: Custom Headers ===');
36
- const clientWithHeaders = new RestClient('https://httpbin.org', {
37
- 'X-Custom-Header': 'custom-value',
38
- 'User-Agent': 'RestClient/1.0'
39
- });
40
-
41
- const headersResponse = await clientWithHeaders.get('/headers');
42
- console.log('Custom headers sent:', headersResponse.data.headers['X-Custom-Header']);
43
-
44
- } catch (error) {
45
- console.error('Error:', error.message);
46
- }
47
- }
48
-
49
- // Run the example if this file is executed directly
50
- if (require.main === module) {
51
- example();
52
- }
53
-
54
- module.exports = example;
1
+ /**
2
+ * Example usage of the REST Client
3
+ */
4
+
5
+ const RestClient = require('../src/core/rest_client');
6
+
7
+ async function example() {
8
+ // Create a new REST client instance
9
+ const client = new RestClient('https://jsonplaceholder.typicode.com');
10
+
11
+ try {
12
+ // Example 1: Simple GET request
13
+ console.log('=== Example 1: GET Request ===');
14
+ const posts = await client.get('/posts', { params: { _limit: 5 } });
15
+ console.log(`Retrieved ${posts.data.length} posts`);
16
+ console.log('First post title:', posts.data[0].title);
17
+
18
+ // Example 2: POST request
19
+ console.log('\n=== Example 2: POST Request ===');
20
+ const newPost = {
21
+ title: 'My New Post',
22
+ body: 'This is the content of my new post',
23
+ userId: 1
24
+ };
25
+
26
+ const createdPost = await client.post('/posts', newPost);
27
+ console.log('Created post with ID:', createdPost.data.id);
28
+
29
+ // Example 3: Setting authorization header
30
+ console.log('\n=== Example 3: Using Authorization ===');
31
+ client.setAuthorization('your-api-token-here');
32
+ console.log('Authorization header set');
33
+
34
+ // Example 4: Custom headers
35
+ console.log('\n=== Example 4: Custom Headers ===');
36
+ const clientWithHeaders = new RestClient('https://httpbin.org', {
37
+ 'X-Custom-Header': 'custom-value',
38
+ 'User-Agent': 'RestClient/1.0'
39
+ });
40
+
41
+ const headersResponse = await clientWithHeaders.get('/headers');
42
+ console.log('Custom headers sent:', headersResponse.data.headers['X-Custom-Header']);
43
+
44
+ } catch (error) {
45
+ console.error('Error:', error.message);
46
+ }
47
+ }
48
+
49
+ // Run the example if this file is executed directly
50
+ if (require.main === module) {
51
+ example();
52
+ }
53
+
54
+ module.exports = example;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stigmergy",
3
- "version": "1.2.0",
3
+ "version": "1.2.6",
4
4
  "description": "Stigmergy CLI - Multi-Agents Cross-AI CLI Tools Collaboration System",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -8,24 +8,38 @@
8
8
  },
9
9
  "scripts": {
10
10
  "start": "node src/index.js",
11
- "test": "jest",
11
+ "test": "node scripts/run-layered-tests.js",
12
12
  "test:unit": "jest tests/unit",
13
13
  "test:integration": "jest tests/integration",
14
14
  "test:e2e": "jest tests/e2e",
15
+ "test:core": "jest tests/unit/cli-tool-detector.test.js tests/unit/smart-router-core.test.js tests/unit/parameter-handler-core.test.js",
16
+ "test:layers": "node scripts/run-layered-tests.js",
17
+ "test:layers-skip-e2e": "node scripts/run-layered-tests.js --skip-e2e",
18
+ "test:rest-client": "node test/rest_client.test.js",
19
+ "test:nodejs-coordination": "jest tests/unit/nodejs-coordination-layer.test.js",
20
+ "test:nodejs-hooks": "jest tests/unit/nodejs-hook-deployment.test.js",
21
+ "test:nodejs-integration": "jest tests/unit/nodejs-cli-integration.test.js",
22
+ "test:availability": "node -e \"const CLIAvailabilityChecker = require('./src/test/cli-availability-checker'); const checker = new CLIAvailabilityChecker(); checker.printAvailabilityReport()\"",
23
+ "example:rest-client": "node examples/rest_client_example.js",
15
24
  "coverage": "jest --coverage",
25
+ "coverage:unit": "jest tests/unit --coverage",
26
+ "coverage:integration": "jest tests/integration --coverage",
27
+ "test:watch": "jest --watch",
16
28
  "build": "node scripts/build.js",
17
29
  "deploy": "node src/index.js deploy",
18
30
  "status": "node src/index.js status",
19
31
  "scan": "node src/index.js scan",
20
32
  "init": "node src/index.js init",
33
+ "clean": "node cleanup.js",
21
34
  "validate": "node src/index.js validate",
22
35
  "dev": "node --watch src/index.js",
23
36
  "lint": "eslint src/",
24
37
  "format": "prettier --write src/",
25
- "clean": "node src/index.js clean",
26
- "diagnostic": "node src/index.js diagnostic",
27
- "uninstall": "node -e \"const EU=require('./src/core/enhanced_uninstaller'); new EU({dryRun:true,verbose:true}).completeUninstall()\"",
28
- "uninstall-force": "node -e \"const EU=require('./src/core/enhanced_uninstaller'); new EU({force:true,verbose:true}).completeUninstall()\"",
38
+ "fix-node-conflict": "node fix-node-conflict.js",
39
+ "diagnostic": "node diagnostic.js",
40
+ "path-fixer": "node path-fixer.js",
41
+ "emergency-clean": "node emergency-cleanup.js",
42
+ "test:conflict-prevention": "node test/conflict-prevention-test.js",
29
43
  "post-deployment-config": "node scripts/post-deployment-config.js",
30
44
  "preinstall": "node scripts/preinstall-check.js",
31
45
  "postinstall": "node src/index.js auto-install"
@@ -45,6 +59,9 @@
45
59
  "real-testing",
46
60
  "python-free"
47
61
  ],
62
+ "workspaces": [
63
+ "packages/*"
64
+ ],
48
65
  "files": [
49
66
  "src/**/*.js",
50
67
  "config/**/*.json",
@@ -71,21 +88,25 @@
71
88
  "dependencies": {
72
89
  "chalk": "^4.1.2",
73
90
  "chokidar": "^3.5.3",
74
- "commander": "^9.5.0",
91
+ "commander": "^12.0.0",
75
92
  "figures": "^3.2.0",
76
- "fs-extra": "^11.2.0",
77
- "glob": "^8.1.0",
93
+ "fs-extra": "^11.1.1",
94
+ "glob": "^10.3.10",
78
95
  "inquirer": "^8.2.6",
79
96
  "js-yaml": "^4.1.0",
80
97
  "ora": "^5.4.1",
81
- "semver": "^7.6.3",
82
- "table": "^6.8.2"
98
+ "semver": "^7.5.4",
99
+ "table": "^6.8.1",
100
+ "axios": "^1.6.0",
101
+ "playwright": "^1.40.0",
102
+ "@telagod/papermcp": "^0.3.5",
103
+ "aigroup-paper-mcp": "^0.3.6"
83
104
  },
84
105
  "devDependencies": {
85
- "eslint": "^8.57.1",
86
- "jest": "^29.7.0",
87
- "nodemon": "^3.1.7",
88
- "prettier": "^3.3.3"
106
+ "eslint": "^8.50.0",
107
+ "jest": "^30.2.0",
108
+ "nodemon": "^3.0.1",
109
+ "prettier": "^3.0.3"
89
110
  },
90
111
  "config": {
91
112
  "encoding": "ansi",
package/scripts/build.js CHANGED
@@ -1,74 +1,74 @@
1
- /**
2
- * Build script for Stigmergy CLI
3
- * Creates a distributable package
4
- */
5
-
6
- const fs = require('fs');
7
- const path = require('path');
8
- const { execSync } = require('child_process');
9
-
10
- console.log('=== Building Stigmergy CLI ===\n');
11
-
12
- // Check if we're in the right directory
13
- const packageJsonPath = path.join(__dirname, '..', 'package.json');
14
- if (!fs.existsSync(packageJsonPath)) {
15
- console.error('Error: package.json not found. Make sure you are in the project root directory.');
16
- process.exit(1);
17
- }
18
-
19
- // Read package.json
20
- const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
21
- console.log(`Building version ${pkg.version} of ${pkg.name}`);
22
-
23
- // Verify required files exist
24
- const requiredFiles = [
25
- 'src/index.js',
26
- 'package.json',
27
- 'README.md',
28
- 'LICENSE'
29
- ];
30
-
31
- for (const file of requiredFiles) {
32
- if (!fs.existsSync(path.join(__dirname, '..', file))) {
33
- console.error(`Error: Required file missing: ${file}`);
34
- process.exit(1);
35
- }
36
- }
37
-
38
- console.log('All required files are present');
39
-
40
- // Check dependencies
41
- console.log('\nChecking dependencies...');
42
- try {
43
- execSync('npm list inquirer', { stdio: 'pipe' });
44
- console.log('Inquirer dependency is available');
45
- } catch (error) {
46
- console.log('⚠️ Inquirer may not be installed locally, but it should be available in production');
47
- }
48
-
49
- // Run basic syntax check
50
- console.log('\nRunning syntax checks...');
51
- try {
52
- execSync('node -c src/index.js', { stdio: 'inherit' });
53
- console.log('Main file syntax is valid');
54
- } catch (error) {
55
- console.error('Syntax error in main file:', error.message);
56
- process.exit(1);
57
- }
58
-
59
- // Show build info
60
- console.log('\n=== Build Information ===');
61
- console.log(`Name: ${pkg.name}`);
62
- console.log(`Version: ${pkg.version}`);
63
- console.log(`Description: ${pkg.description}`);
64
- console.log(`Entry point: ${pkg.main}`);
65
- console.log(`Binary: ${JSON.stringify(pkg.bin)}`);
66
- console.log(`Files to be included: ${pkg.files ? pkg.files.length : 'default'}`);
67
-
68
- // Show the commands to publish
69
- console.log('\n=== Next Steps for Publishing ===');
70
- console.log('1. To test locally: npm install -g .');
71
- console.log('2. To publish to npm: npm publish');
72
- console.log('3. To publish a new version: npm version [patch|minor|major] && npm publish');
73
-
74
- console.log('\n=== Build Complete ===');
1
+ /**
2
+ * Build script for Stigmergy CLI
3
+ * Creates a distributable package
4
+ */
5
+
6
+ const fs = require('fs');
7
+ const path = require('path');
8
+ const { execSync } = require('child_process');
9
+
10
+ console.log('=== Building Stigmergy CLI ===\n');
11
+
12
+ // Check if we're in the right directory
13
+ const packageJsonPath = path.join(__dirname, '..', 'package.json');
14
+ if (!fs.existsSync(packageJsonPath)) {
15
+ console.error('Error: package.json not found. Make sure you are in the project root directory.');
16
+ process.exit(1);
17
+ }
18
+
19
+ // Read package.json
20
+ const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
21
+ console.log(`Building version ${pkg.version} of ${pkg.name}`);
22
+
23
+ // Verify required files exist
24
+ const requiredFiles = [
25
+ 'src/index.js',
26
+ 'package.json',
27
+ 'README.md',
28
+ 'LICENSE'
29
+ ];
30
+
31
+ for (const file of requiredFiles) {
32
+ if (!fs.existsSync(path.join(__dirname, '..', file))) {
33
+ console.error(`Error: Required file missing: ${file}`);
34
+ process.exit(1);
35
+ }
36
+ }
37
+
38
+ console.log('�?All required files are present');
39
+
40
+ // Check dependencies
41
+ console.log('\nChecking dependencies...');
42
+ try {
43
+ execSync('npm list inquirer', { stdio: 'pipe' });
44
+ console.log('�?Inquirer dependency is available');
45
+ } catch (error) {
46
+ console.log('⚠️ Inquirer may not be installed locally, but it should be available in production');
47
+ }
48
+
49
+ // Run basic syntax check
50
+ console.log('\nRunning syntax checks...');
51
+ try {
52
+ execSync('node -c src/index.js', { stdio: 'inherit' });
53
+ console.log('�?Main file syntax is valid');
54
+ } catch (error) {
55
+ console.error('�?Syntax error in main file:', error.message);
56
+ process.exit(1);
57
+ }
58
+
59
+ // Show build info
60
+ console.log('\n=== Build Information ===');
61
+ console.log(`Name: ${pkg.name}`);
62
+ console.log(`Version: ${pkg.version}`);
63
+ console.log(`Description: ${pkg.description}`);
64
+ console.log(`Entry point: ${pkg.main}`);
65
+ console.log(`Binary: ${JSON.stringify(pkg.bin)}`);
66
+ console.log(`Files to be included: ${pkg.files ? pkg.files.length : 'default'}`);
67
+
68
+ // Show the commands to publish
69
+ console.log('\n=== Next Steps for Publishing ===');
70
+ console.log('1. To test locally: npm install -g .');
71
+ console.log('2. To publish to npm: npm publish');
72
+ console.log('3. To publish a new version: npm version [patch|minor|major] && npm publish');
73
+
74
+ console.log('\n=== Build Complete ===');