stigmergy 1.0.98 → 1.0.99
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.
- package/package.json +1 -1
- package/src/core/cli_help_analyzer.js +3 -3
- package/src/core/smart_router.js +3 -3
- package/src/data_structures.js +3 -3
- package/src/deploy.js +1 -2
- package/src/main.js +3 -3
- package/src/main_english.js +3 -86
- package/src/utils.js +1 -2
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ const fs = require('fs/promises');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const os = require('os');
|
|
6
6
|
const { CLI_TOOLS } = require('./cli_tools');
|
|
7
|
-
const { errorHandler
|
|
7
|
+
const { errorHandler } = require('./error_handler');
|
|
8
8
|
|
|
9
9
|
class CLIHelpAnalyzer {
|
|
10
10
|
constructor() {
|
|
@@ -89,7 +89,7 @@ class CLIHelpAnalyzer {
|
|
|
89
89
|
async analyzeAllCLI() {
|
|
90
90
|
const results = {};
|
|
91
91
|
|
|
92
|
-
for (const [cliName,
|
|
92
|
+
for (const [cliName, _] of Object.entries(this.cliTools)) {
|
|
93
93
|
try {
|
|
94
94
|
if (process.env.DEBUG === 'true') {
|
|
95
95
|
console.log(`Analyzing ${cliName}...`);
|
|
@@ -671,4 +671,4 @@ class CLIHelpAnalyzer {
|
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
673
|
|
|
674
|
-
module.exports = CLIHelpAnalyzer;
|
|
674
|
+
module.exports = CLIHelpAnalyzer;
|
package/src/core/smart_router.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const CLIHelpAnalyzer = require('./cli_help_analyzer');
|
|
2
2
|
const { CLI_TOOLS, validateCLITool } = require('./cli_tools');
|
|
3
|
-
const { errorHandler
|
|
3
|
+
const { errorHandler } = require('./error_handler');
|
|
4
4
|
|
|
5
5
|
class SmartRouter {
|
|
6
6
|
constructor() {
|
|
@@ -50,7 +50,7 @@ class SmartRouter {
|
|
|
50
50
|
const input = userInput.trim();
|
|
51
51
|
|
|
52
52
|
// First try to detect tool-specific keywords
|
|
53
|
-
for (const [toolName,
|
|
53
|
+
for (const [toolName, _] of Object.entries(this.tools)) {
|
|
54
54
|
try {
|
|
55
55
|
// Validate tool configuration
|
|
56
56
|
validateCLITool(toolName);
|
|
@@ -143,4 +143,4 @@ class SmartRouter {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
module.exports = SmartRouter;
|
|
146
|
+
module.exports = SmartRouter;
|
package/src/data_structures.js
CHANGED
|
@@ -326,7 +326,7 @@ class HashTable {
|
|
|
326
326
|
for (let i = 0; i < this.size; i++) {
|
|
327
327
|
const bucket = this.buckets[i];
|
|
328
328
|
if (bucket) {
|
|
329
|
-
for (const [key,
|
|
329
|
+
for (const [key, __] of bucket) {
|
|
330
330
|
keysArr.push(key);
|
|
331
331
|
}
|
|
332
332
|
}
|
|
@@ -353,7 +353,7 @@ class HashTable {
|
|
|
353
353
|
for (let i = 0; i < this.size; i++) {
|
|
354
354
|
const bucket = this.buckets[i];
|
|
355
355
|
if (bucket) {
|
|
356
|
-
for (const [
|
|
356
|
+
for (const [__, value] of bucket) {
|
|
357
357
|
valuesArr.push(value);
|
|
358
358
|
}
|
|
359
359
|
}
|
|
@@ -437,4 +437,4 @@ class HashTable {
|
|
|
437
437
|
|
|
438
438
|
module.exports = {
|
|
439
439
|
HashTable,
|
|
440
|
-
};
|
|
440
|
+
};
|
package/src/deploy.js
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
const fs = require('fs').promises;
|
|
9
9
|
const path = require('path');
|
|
10
|
-
const os = require('os');
|
|
11
10
|
|
|
12
11
|
// Import the main Stigmergy installer
|
|
13
12
|
const { StigmergyInstaller } = require('./main_english.js');
|
|
@@ -53,4 +52,4 @@ if (require.main === module) {
|
|
|
53
52
|
});
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
module.exports = { deploy };
|
|
55
|
+
module.exports = { deploy };
|
package/src/main.js
CHANGED
|
@@ -106,7 +106,7 @@ class SmartRouter {
|
|
|
106
106
|
const input = userInput.trim();
|
|
107
107
|
|
|
108
108
|
// Detect tool-specific keywords
|
|
109
|
-
for (const [toolName,
|
|
109
|
+
for (const [toolName, _] of Object.entries(this.tools)) {
|
|
110
110
|
for (const keyword of this.extractKeywords(toolName)) {
|
|
111
111
|
if (input.toLowerCase().includes(keyword.toLowerCase())) {
|
|
112
112
|
// Extract clean parameters
|
|
@@ -803,7 +803,7 @@ async function main() {
|
|
|
803
803
|
console.log('Multi-AI CLI Tools Collaboration System v1.0.77');
|
|
804
804
|
console.log('='.repeat(60));
|
|
805
805
|
|
|
806
|
-
const
|
|
806
|
+
const _ = installer.promptForInstallation;
|
|
807
807
|
installer.promptForInstallation = async () => {
|
|
808
808
|
console.log(
|
|
809
809
|
'[AUTO-INSTALL] Skipping interactive CLI installation in postinstall mode',
|
|
@@ -1098,4 +1098,4 @@ module.exports = {
|
|
|
1098
1098
|
CLI_TOOLS,
|
|
1099
1099
|
SmartRouter,
|
|
1100
1100
|
MemoryManager,
|
|
1101
|
-
};
|
|
1101
|
+
};
|
package/src/main_english.js
CHANGED
|
@@ -25,12 +25,7 @@ const CLIHelpAnalyzer = require('./core/cli_help_analyzer');
|
|
|
25
25
|
const { CLI_TOOLS } = require('./core/cli_tools');
|
|
26
26
|
const { errorHandler } = require('./core/error_handler');
|
|
27
27
|
const { executeCommand, executeJSFile } = require('./utils');
|
|
28
|
-
|
|
29
|
-
handleRegister,
|
|
30
|
-
handleLogin,
|
|
31
|
-
handleLogout,
|
|
32
|
-
handleStatus,
|
|
33
|
-
} = require('./auth_command');
|
|
28
|
+
|
|
34
29
|
const { UserAuthenticator } = require('./auth');
|
|
35
30
|
const fsSync = require('fs');
|
|
36
31
|
|
|
@@ -163,7 +158,7 @@ class MemoryManager {
|
|
|
163
158
|
return content;
|
|
164
159
|
}
|
|
165
160
|
|
|
166
|
-
parseProjectMemory(
|
|
161
|
+
parseProjectMemory(_) {
|
|
167
162
|
// Simple parser for project memory
|
|
168
163
|
return {
|
|
169
164
|
projectName: 'Project',
|
|
@@ -772,24 +767,6 @@ async function main() {
|
|
|
772
767
|
);
|
|
773
768
|
console.log(' call "<prompt>" Execute prompt with auto-routed AI CLI');
|
|
774
769
|
console.log(' errors Display error report and statistics');
|
|
775
|
-
console.log(
|
|
776
|
-
' register <username> <password> Register a new user account',
|
|
777
|
-
);
|
|
778
|
-
console.log(' login <username> <password> Log in to your account');
|
|
779
|
-
console.log(' logout Log out of your account');
|
|
780
|
-
console.log(
|
|
781
|
-
' auth-status Check authentication status',
|
|
782
|
-
);
|
|
783
|
-
console.log('');
|
|
784
|
-
console.log('Authentication Commands:');
|
|
785
|
-
console.log(
|
|
786
|
-
' Register a new account: stigmergy register <username> <password>',
|
|
787
|
-
);
|
|
788
|
-
console.log(
|
|
789
|
-
' Log in to your account: stigmergy login <username> <password>',
|
|
790
|
-
);
|
|
791
|
-
console.log(' Check auth status: stigmergy auth-status');
|
|
792
|
-
console.log(' Log out of your account: stigmergy logout');
|
|
793
770
|
console.log('');
|
|
794
771
|
console.log('[WORKFLOW] Automated Workflow:');
|
|
795
772
|
console.log(' 1. npm install -g stigmergy # Install Stigmergy');
|
|
@@ -836,24 +813,6 @@ async function main() {
|
|
|
836
813
|
);
|
|
837
814
|
console.log(' call "<prompt>" Execute prompt with auto-routed AI CLI');
|
|
838
815
|
console.log(' errors Display error report and statistics');
|
|
839
|
-
console.log(
|
|
840
|
-
' register <username> <password> Register a new user account',
|
|
841
|
-
);
|
|
842
|
-
console.log(' login <username> <password> Log in to your account');
|
|
843
|
-
console.log(' logout Log out of your account');
|
|
844
|
-
console.log(
|
|
845
|
-
' auth-status Check authentication status',
|
|
846
|
-
);
|
|
847
|
-
console.log('');
|
|
848
|
-
console.log('Authentication Commands:');
|
|
849
|
-
console.log(
|
|
850
|
-
' Register a new account: stigmergy register <username> <password>',
|
|
851
|
-
);
|
|
852
|
-
console.log(
|
|
853
|
-
' Log in to your account: stigmergy login <username> <password>',
|
|
854
|
-
);
|
|
855
|
-
console.log(' Check auth status: stigmergy auth-status');
|
|
856
|
-
console.log(' Log out of your account: stigmergy logout');
|
|
857
816
|
console.log('');
|
|
858
817
|
console.log('[WORKFLOW] Automated Workflow:');
|
|
859
818
|
console.log(' 1. npm install -g stigmergy # Install Stigmergy');
|
|
@@ -871,24 +830,6 @@ async function main() {
|
|
|
871
830
|
|
|
872
831
|
const command = args[0];
|
|
873
832
|
|
|
874
|
-
// Define protected commands that require authentication
|
|
875
|
-
const protectedCommands = ['call', 'setup', 'deploy', 'install'];
|
|
876
|
-
|
|
877
|
-
// Check if command requires authentication
|
|
878
|
-
if (
|
|
879
|
-
protectedCommands.includes(command) &&
|
|
880
|
-
command !== 'version' &&
|
|
881
|
-
command !== '--version'
|
|
882
|
-
) {
|
|
883
|
-
if (!isAuthenticated()) {
|
|
884
|
-
console.log('[ERROR] Authentication required. Please log in first.');
|
|
885
|
-
console.log(
|
|
886
|
-
'[INFO] Run "stigmergy login <username> <password>" to log in.',
|
|
887
|
-
);
|
|
888
|
-
process.exit(1);
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
|
|
892
833
|
switch (command) {
|
|
893
834
|
case 'version':
|
|
894
835
|
case '--version': {
|
|
@@ -1052,31 +993,7 @@ async function main() {
|
|
|
1052
993
|
}
|
|
1053
994
|
break;
|
|
1054
995
|
|
|
1055
|
-
|
|
1056
|
-
if (args.length < 3) {
|
|
1057
|
-
console.log(
|
|
1058
|
-
'[ERROR] Usage: stigmergy register <username> <password>',
|
|
1059
|
-
);
|
|
1060
|
-
process.exit(1);
|
|
1061
|
-
}
|
|
1062
|
-
handleRegister(args[1], args[2]);
|
|
1063
|
-
break;
|
|
1064
|
-
|
|
1065
|
-
case 'login':
|
|
1066
|
-
if (args.length < 3) {
|
|
1067
|
-
console.log('[ERROR] Usage: stigmergy login <username> <password>');
|
|
1068
|
-
process.exit(1);
|
|
1069
|
-
}
|
|
1070
|
-
handleLogin(args[1], args[2]);
|
|
1071
|
-
break;
|
|
1072
|
-
|
|
1073
|
-
case 'logout':
|
|
1074
|
-
handleLogout();
|
|
1075
|
-
break;
|
|
1076
|
-
|
|
1077
|
-
case 'auth-status':
|
|
1078
|
-
handleStatus();
|
|
1079
|
-
break;
|
|
996
|
+
|
|
1080
997
|
|
|
1081
998
|
case 'call': {
|
|
1082
999
|
if (args.length < 2) {
|
package/src/utils.js
CHANGED
|
@@ -626,7 +626,6 @@ function processCSV(csvData, options = {}) {
|
|
|
626
626
|
*/
|
|
627
627
|
async function executeCommand(command, args = [], options = {}) {
|
|
628
628
|
const { spawn } = require('child_process');
|
|
629
|
-
const path = require('path');
|
|
630
629
|
|
|
631
630
|
// Default options
|
|
632
631
|
const opts = {
|
|
@@ -913,4 +912,4 @@ module.exports = {
|
|
|
913
912
|
encryptData,
|
|
914
913
|
decryptData,
|
|
915
914
|
generateKey,
|
|
916
|
-
};
|
|
915
|
+
};
|