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,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.1.6",
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,16 +8,22 @@
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",
15
18
  "test:rest-client": "node test/rest_client.test.js",
16
19
  "test:nodejs-coordination": "jest tests/unit/nodejs-coordination-layer.test.js",
17
20
  "test:nodejs-hooks": "jest tests/unit/nodejs-hook-deployment.test.js",
18
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()\"",
19
23
  "example:rest-client": "node examples/rest_client_example.js",
20
24
  "coverage": "jest --coverage",
25
+ "coverage:unit": "jest tests/unit --coverage",
26
+ "coverage:integration": "jest tests/integration --coverage",
21
27
  "test:watch": "jest --watch",
22
28
  "build": "node scripts/build.js",
23
29
  "deploy": "node src/index.js deploy",
@@ -53,6 +59,9 @@
53
59
  "real-testing",
54
60
  "python-free"
55
61
  ],
62
+ "workspaces": [
63
+ "packages/*"
64
+ ],
56
65
  "files": [
57
66
  "src/**/*.js",
58
67
  "config/**/*.json",
@@ -78,21 +87,20 @@
78
87
  },
79
88
  "dependencies": {
80
89
  "chalk": "^4.1.2",
81
- "child_process": "^1.0.2",
82
90
  "chokidar": "^3.5.3",
83
91
  "commander": "^12.0.0",
84
- "events": "^3.3.0",
85
92
  "figures": "^3.2.0",
86
93
  "fs-extra": "^11.1.1",
87
94
  "glob": "^10.3.10",
88
95
  "inquirer": "^8.2.6",
89
96
  "js-yaml": "^4.1.0",
90
97
  "ora": "^5.4.1",
91
- "os": "^0.1.2",
92
- "path": "^0.12.7",
93
98
  "semver": "^7.5.4",
94
99
  "table": "^6.8.1",
95
- "util": "^0.12.5"
100
+ "axios": "^1.6.0",
101
+ "playwright": "^1.40.0",
102
+ "@telagod/papermcp": "^0.3.5",
103
+ "aigroup-paper-mcp": "^0.3.6"
96
104
  },
97
105
  "devDependencies": {
98
106
  "eslint": "^8.50.0",
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 ===');