erosolar-cli 1.7.55 → 1.7.57
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/dist/shell/unifiedInputProcessor.d.ts +15 -12
- package/dist/shell/unifiedInputProcessor.d.ts.map +1 -1
- package/dist/shell/unifiedInputProcessor.js +45 -72
- package/dist/shell/unifiedInputProcessor.js.map +1 -1
- package/package.json +4 -4
- package/dist/active-stack-security.d.ts +0 -110
- package/dist/active-stack-security.js +0 -313
- package/dist/active-stack-security.js.map +0 -1
- package/dist/advanced-targeting.d.ts +0 -113
- package/dist/advanced-targeting.js +0 -252
- package/dist/advanced-targeting.js.map +0 -1
- package/dist/bin/adapters/node/index.js +0 -33
- package/dist/bin/adapters/types.js +0 -1
- package/dist/bin/alpha-zero/agentWrapper.js +0 -165
- package/dist/bin/alpha-zero/codeEvaluator.js +0 -272
- package/dist/bin/alpha-zero/competitiveRunner.js +0 -219
- package/dist/bin/alpha-zero/index.js +0 -98
- package/dist/bin/alpha-zero/introspection.js +0 -298
- package/dist/bin/alpha-zero/metricsTracker.js +0 -207
- package/dist/bin/alpha-zero/security/core.js +0 -269
- package/dist/bin/alpha-zero/security/google.js +0 -308
- package/dist/bin/alpha-zero/security/googleLoader.js +0 -40
- package/dist/bin/alpha-zero/security/index.js +0 -31
- package/dist/bin/alpha-zero/security/simulation.js +0 -274
- package/dist/bin/alpha-zero/selfModification.js +0 -231
- package/dist/bin/alpha-zero/types.js +0 -30
- package/dist/bin/bin/erosolar-optimized.js +0 -205
- package/dist/bin/capabilities/agentSpawningCapability.js +0 -116
- package/dist/bin/capabilities/bashCapability.js +0 -22
- package/dist/bin/capabilities/cloudCapability.js +0 -36
- package/dist/bin/capabilities/codeAnalysisCapability.js +0 -22
- package/dist/bin/capabilities/codeQualityCapability.js +0 -23
- package/dist/bin/capabilities/dependencySecurityCapability.js +0 -22
- package/dist/bin/capabilities/devCapability.js +0 -22
- package/dist/bin/capabilities/editCapability.js +0 -28
- package/dist/bin/capabilities/emailCapability.js +0 -20
- package/dist/bin/capabilities/enhancedGitCapability.js +0 -221
- package/dist/bin/capabilities/filesystemCapability.js +0 -22
- package/dist/bin/capabilities/globCapability.js +0 -28
- package/dist/bin/capabilities/interactionCapability.js +0 -20
- package/dist/bin/capabilities/learnCapability.js +0 -22
- package/dist/bin/capabilities/mcpCapability.js +0 -20
- package/dist/bin/capabilities/notebookCapability.js +0 -28
- package/dist/bin/capabilities/planningCapability.js +0 -27
- package/dist/bin/capabilities/refactoringCapability.js +0 -23
- package/dist/bin/capabilities/repoChecksCapability.js +0 -22
- package/dist/bin/capabilities/searchCapability.js +0 -22
- package/dist/bin/capabilities/skillCapability.js +0 -76
- package/dist/bin/capabilities/taskManagementCapability.js +0 -20
- package/dist/bin/capabilities/testingCapability.js +0 -23
- package/dist/bin/capabilities/toolManifest.js +0 -159
- package/dist/bin/capabilities/toolRegistry.js +0 -114
- package/dist/bin/capabilities/webCapability.js +0 -20
- package/dist/bin/config.js +0 -139
- package/dist/bin/contracts/v1/agent.js +0 -7
- package/dist/bin/contracts/v1/agentProfileManifest.js +0 -8
- package/dist/bin/contracts/v1/agentRules.js +0 -9
- package/dist/bin/contracts/v1/toolAccess.js +0 -8
- package/dist/bin/erosolar-optimized.d.ts +0 -12
- package/dist/bin/erosolar-optimized.d.ts.map +0 -1
- package/dist/bin/erosolar-optimized.js +0 -239
- package/dist/bin/erosolar-optimized.js.map +0 -1
- package/dist/bin/headless/headlessApp.js +0 -172
- package/dist/bin/mcp/config.js +0 -202
- package/dist/bin/mcp/stdioClient.js +0 -172
- package/dist/bin/mcp/toolBridge.js +0 -104
- package/dist/bin/mcp/types.js +0 -1
- package/dist/bin/plugins/index.js +0 -113
- package/dist/bin/plugins/providers/anthropic/index.js +0 -25
- package/dist/bin/plugins/providers/deepseek/index.js +0 -24
- package/dist/bin/plugins/providers/google/index.js +0 -26
- package/dist/bin/plugins/providers/index.js +0 -19
- package/dist/bin/plugins/providers/ollama/index.js +0 -59
- package/dist/bin/plugins/providers/openai/index.js +0 -26
- package/dist/bin/plugins/providers/xai/index.js +0 -24
- package/dist/bin/plugins/tools/agentSpawning/agentSpawningPlugin.js +0 -8
- package/dist/bin/plugins/tools/bash/localBashPlugin.js +0 -13
- package/dist/bin/plugins/tools/checks/localRepoChecksPlugin.js +0 -13
- package/dist/bin/plugins/tools/cloud/cloudPlugin.js +0 -13
- package/dist/bin/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +0 -13
- package/dist/bin/plugins/tools/codeQuality/codeQualityPlugin.js +0 -13
- package/dist/bin/plugins/tools/dependency/dependencyPlugin.js +0 -11
- package/dist/bin/plugins/tools/development/devPlugin.js +0 -13
- package/dist/bin/plugins/tools/edit/editPlugin.js +0 -14
- package/dist/bin/plugins/tools/email/emailPlugin.js +0 -11
- package/dist/bin/plugins/tools/enhancedGit/enhancedGitPlugin.js +0 -8
- package/dist/bin/plugins/tools/filesystem/localFilesystemPlugin.js +0 -13
- package/dist/bin/plugins/tools/glob/globPlugin.js +0 -14
- package/dist/bin/plugins/tools/index.js +0 -2
- package/dist/bin/plugins/tools/interaction/interactionPlugin.js +0 -11
- package/dist/bin/plugins/tools/learn/learnPlugin.js +0 -13
- package/dist/bin/plugins/tools/mcp/mcpPlugin.js +0 -8
- package/dist/bin/plugins/tools/nodeDefaults.js +0 -56
- package/dist/bin/plugins/tools/notebook/notebookPlugin.js +0 -14
- package/dist/bin/plugins/tools/planning/planningPlugin.js +0 -14
- package/dist/bin/plugins/tools/refactoring/refactoringPlugin.js +0 -11
- package/dist/bin/plugins/tools/registry.js +0 -57
- package/dist/bin/plugins/tools/search/localSearchPlugin.js +0 -13
- package/dist/bin/plugins/tools/skills/skillPlugin.js +0 -8
- package/dist/bin/plugins/tools/taskManagement/taskManagementPlugin.js +0 -11
- package/dist/bin/plugins/tools/testing/testingPlugin.js +0 -11
- package/dist/bin/plugins/tools/web/webPlugin.js +0 -11
- package/dist/bin/providers/anthropicProvider.js +0 -329
- package/dist/bin/providers/googleProvider.js +0 -203
- package/dist/bin/providers/openaiChatCompletionsProvider.js +0 -208
- package/dist/bin/providers/openaiResponsesProvider.js +0 -249
- package/dist/bin/providers/providerFactory.js +0 -24
- package/dist/bin/runtime/agentController.js +0 -321
- package/dist/bin/runtime/agentHost.js +0 -153
- package/dist/bin/runtime/agentSession.js +0 -195
- package/dist/bin/runtime/node.js +0 -10
- package/dist/bin/runtime/universal.js +0 -28
- package/dist/bin/skills/skillRepository.js +0 -236
- package/dist/bin/skills/types.js +0 -1
- package/dist/bin/subagents/taskRunner.js +0 -269
- package/dist/bin/tools/backgroundBashTools.js +0 -211
- package/dist/bin/tools/bashTools.js +0 -159
- package/dist/bin/tools/cloudTools.js +0 -864
- package/dist/bin/tools/codeAnalysisTools.js +0 -641
- package/dist/bin/tools/codeQualityTools.js +0 -294
- package/dist/bin/tools/dependencyTools.js +0 -282
- package/dist/bin/tools/devTools.js +0 -238
- package/dist/bin/tools/diffUtils.js +0 -137
- package/dist/bin/tools/editTools.js +0 -134
- package/dist/bin/tools/emailTools.js +0 -448
- package/dist/bin/tools/fileTools.js +0 -282
- package/dist/bin/tools/globTools.js +0 -173
- package/dist/bin/tools/grepTools.js +0 -332
- package/dist/bin/tools/interactionTools.js +0 -170
- package/dist/bin/tools/learnTools.js +0 -1818
- package/dist/bin/tools/notebookEditTools.js +0 -196
- package/dist/bin/tools/planningTools.js +0 -46
- package/dist/bin/tools/refactoringTools.js +0 -293
- package/dist/bin/tools/repoChecksTools.js +0 -160
- package/dist/bin/tools/searchTools.js +0 -206
- package/dist/bin/tools/skillTools.js +0 -177
- package/dist/bin/tools/taskManagementTools.js +0 -156
- package/dist/bin/tools/testingTools.js +0 -232
- package/dist/bin/tools/webTools.js +0 -480
- package/dist/bin/workspace.js +0 -106
- package/dist/bin/workspace.validator.js +0 -213
- package/dist/capabilities/offensiveSecurityCapability.d.ts +0 -26
- package/dist/capabilities/offensiveSecurityCapability.d.ts.map +0 -1
- package/dist/capabilities/offensiveSecurityCapability.js +0 -58
- package/dist/capabilities/offensiveSecurityCapability.js.map +0 -1
- package/dist/capabilities/realSecurityCapability.d.ts +0 -26
- package/dist/capabilities/realSecurityCapability.d.ts.map +0 -1
- package/dist/capabilities/realSecurityCapability.js +0 -53
- package/dist/capabilities/realSecurityCapability.js.map +0 -1
- package/dist/capabilities/securityCapability.d.ts +0 -32
- package/dist/capabilities/securityCapability.d.ts.map +0 -1
- package/dist/capabilities/securityCapability.js +0 -57
- package/dist/capabilities/securityCapability.js.map +0 -1
- package/dist/capabilities/ultimateSecurityCapability.d.ts +0 -42
- package/dist/capabilities/ultimateSecurityCapability.d.ts.map +0 -1
- package/dist/capabilities/ultimateSecurityCapability.js +0 -96
- package/dist/capabilities/ultimateSecurityCapability.js.map +0 -1
- package/dist/core/designThoughtCheck.d.ts +0 -196
- package/dist/core/designThoughtCheck.d.ts.map +0 -1
- package/dist/core/designThoughtCheck.js +0 -287
- package/dist/core/designThoughtCheck.js.map +0 -1
- package/dist/core/designThoughtCheckEngine.d.ts +0 -58
- package/dist/core/designThoughtCheckEngine.d.ts.map +0 -1
- package/dist/core/designThoughtCheckEngine.js +0 -358
- package/dist/core/designThoughtCheckEngine.js.map +0 -1
- package/dist/core/designThoughtCheckIntegration.d.ts +0 -103
- package/dist/core/designThoughtCheckIntegration.d.ts.map +0 -1
- package/dist/core/designThoughtCheckIntegration.js +0 -207
- package/dist/core/designThoughtCheckIntegration.js.map +0 -1
- package/dist/core/intelligenceTools.d.ts +0 -19
- package/dist/core/intelligenceTools.d.ts.map +0 -1
- package/dist/core/intelligenceTools.js +0 -453
- package/dist/core/intelligenceTools.js.map +0 -1
- package/dist/core/operationalTools.d.ts +0 -19
- package/dist/core/operationalTools.d.ts.map +0 -1
- package/dist/core/operationalTools.js +0 -467
- package/dist/core/operationalTools.js.map +0 -1
- package/dist/offensive/core/offensive-engine.d.ts +0 -171
- package/dist/offensive/core/offensive-engine.d.ts.map +0 -1
- package/dist/offensive/core/offensive-engine.js +0 -345
- package/dist/offensive/core/offensive-engine.js.map +0 -1
- package/dist/offensive/core/offensive-integration.d.ts +0 -129
- package/dist/offensive/core/offensive-integration.d.ts.map +0 -1
- package/dist/offensive/core/offensive-integration.js +0 -364
- package/dist/offensive/core/offensive-integration.js.map +0 -1
- package/dist/offensive/core/offensive-tools.d.ts +0 -55
- package/dist/offensive/core/offensive-tools.d.ts.map +0 -1
- package/dist/offensive/core/offensive-tools.js +0 -438
- package/dist/offensive/core/offensive-tools.js.map +0 -1
- package/dist/offensive/offensive-cli.d.ts +0 -48
- package/dist/offensive/offensive-cli.d.ts.map +0 -1
- package/dist/offensive/offensive-cli.js +0 -233
- package/dist/offensive/offensive-cli.js.map +0 -1
- package/dist/security/apt-simulation-cli.d.ts +0 -57
- package/dist/security/apt-simulation-cli.d.ts.map +0 -1
- package/dist/security/apt-simulation-cli.js +0 -278
- package/dist/security/apt-simulation-cli.js.map +0 -1
- package/dist/security/apt-simulation-engine-complete.d.ts +0 -97
- package/dist/security/apt-simulation-engine-complete.d.ts.map +0 -1
- package/dist/security/apt-simulation-engine-complete.js +0 -441
- package/dist/security/apt-simulation-engine-complete.js.map +0 -1
- package/dist/security/apt-simulation-engine.d.ts +0 -97
- package/dist/security/apt-simulation-engine.d.ts.map +0 -1
- package/dist/security/apt-simulation-engine.js +0 -441
- package/dist/security/apt-simulation-engine.js.map +0 -1
- package/dist/security/authorization.d.ts +0 -45
- package/dist/security/authorization.d.ts.map +0 -1
- package/dist/security/authorization.js +0 -128
- package/dist/security/authorization.js.map +0 -1
- package/dist/security/comprehensive-security-research.d.ts +0 -84
- package/dist/security/comprehensive-security-research.d.ts.map +0 -1
- package/dist/security/comprehensive-security-research.js +0 -211
- package/dist/security/comprehensive-security-research.js.map +0 -1
- package/dist/security/offensive/exploitationEngine.d.ts +0 -54
- package/dist/security/offensive/exploitationEngine.d.ts.map +0 -1
- package/dist/security/offensive/exploitationEngine.js +0 -263
- package/dist/security/offensive/exploitationEngine.js.map +0 -1
- package/dist/security/real/networkExploitation.d.ts +0 -92
- package/dist/security/real/networkExploitation.d.ts.map +0 -1
- package/dist/security/real/networkExploitation.js +0 -316
- package/dist/security/real/networkExploitation.js.map +0 -1
- package/dist/security/real/persistenceImplementation.d.ts +0 -62
- package/dist/security/real/persistenceImplementation.d.ts.map +0 -1
- package/dist/security/real/persistenceImplementation.js +0 -323
- package/dist/security/real/persistenceImplementation.js.map +0 -1
- package/dist/security/real/vulnerabilityScanner.d.ts +0 -73
- package/dist/security/real/vulnerabilityScanner.d.ts.map +0 -1
- package/dist/security/real/vulnerabilityScanner.js +0 -341
- package/dist/security/real/vulnerabilityScanner.js.map +0 -1
- package/dist/shell/capturePastePatch.d.ts +0 -9
- package/dist/shell/capturePastePatch.d.ts.map +0 -1
- package/dist/shell/capturePastePatch.js +0 -98
- package/dist/shell/capturePastePatch.js.map +0 -1
- package/dist/shell/enhancedInteractiveShell.d.ts +0 -90
- package/dist/shell/enhancedInteractiveShell.d.ts.map +0 -1
- package/dist/shell/enhancedInteractiveShell.js +0 -248
- package/dist/shell/enhancedInteractiveShell.js.map +0 -1
- package/dist/shell/inputProcessor.d.ts +0 -56
- package/dist/shell/inputProcessor.d.ts.map +0 -1
- package/dist/shell/inputProcessor.js +0 -172
- package/dist/shell/inputProcessor.js.map +0 -1
- package/dist/shell/interactiveShell-patch.d.ts +0 -27
- package/dist/shell/interactiveShell-patch.d.ts.map +0 -1
- package/dist/shell/interactiveShell-patch.js +0 -38
- package/dist/shell/interactiveShell-patch.js.map +0 -1
- package/dist/shell/interactiveShell-robust.d.ts +0 -26
- package/dist/shell/interactiveShell-robust.d.ts.map +0 -1
- package/dist/shell/interactiveShell-robust.js +0 -34
- package/dist/shell/interactiveShell-robust.js.map +0 -1
- package/dist/shell/multiLinePasteManager.d.ts +0 -106
- package/dist/shell/multiLinePasteManager.d.ts.map +0 -1
- package/dist/shell/multiLinePasteManager.js +0 -308
- package/dist/shell/multiLinePasteManager.js.map +0 -1
- package/dist/shell/processInputBlockPatch.d.ts +0 -8
- package/dist/shell/processInputBlockPatch.d.ts.map +0 -1
- package/dist/shell/processInputBlockPatch.js +0 -133
- package/dist/shell/processInputBlockPatch.js.map +0 -1
- package/dist/tools/enhancedSecurityTools.d.ts +0 -19
- package/dist/tools/enhancedSecurityTools.d.ts.map +0 -1
- package/dist/tools/enhancedSecurityTools.js +0 -215
- package/dist/tools/enhancedSecurityTools.js.map +0 -1
- package/dist/tools/offensiveSecurityTools.d.ts +0 -16
- package/dist/tools/offensiveSecurityTools.d.ts.map +0 -1
- package/dist/tools/offensiveSecurityTools.js +0 -285
- package/dist/tools/offensiveSecurityTools.js.map +0 -1
- package/dist/tools/realSecurityTools.d.ts +0 -18
- package/dist/tools/realSecurityTools.d.ts.map +0 -1
- package/dist/tools/realSecurityTools.js +0 -468
- package/dist/tools/realSecurityTools.js.map +0 -1
- package/dist/tools/securityTools.d.ts +0 -20
- package/dist/tools/securityTools.d.ts.map +0 -1
- package/dist/tools/securityTools.js +0 -449
- package/dist/tools/securityTools.js.map +0 -1
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Optimized Erosolar CLI Entry Point
|
|
4
|
-
*
|
|
5
|
-
* Features:
|
|
6
|
-
* - Fast-path commands for simple operations
|
|
7
|
-
* - Lazy loading for complex functionality
|
|
8
|
-
* - Performance monitoring
|
|
9
|
-
* - Graceful error handling
|
|
10
|
-
*/
|
|
11
|
-
import { readFileSync } from 'node:fs';
|
|
12
|
-
import { dirname, resolve } from 'node:path';
|
|
13
|
-
import { fileURLToPath } from 'node:url';
|
|
14
|
-
// Fast-path command handling
|
|
15
|
-
function handleFastPathCommand(argv) {
|
|
16
|
-
const command = argv[0];
|
|
17
|
-
switch (command) {
|
|
18
|
-
case '--version':
|
|
19
|
-
case 'version':
|
|
20
|
-
case '-v':
|
|
21
|
-
console.log(`Erosolar CLI v${getPackageVersion()}`);
|
|
22
|
-
return true;
|
|
23
|
-
case '--help':
|
|
24
|
-
case 'help':
|
|
25
|
-
case '-h':
|
|
26
|
-
showFastHelp();
|
|
27
|
-
return true;
|
|
28
|
-
case '--json':
|
|
29
|
-
// Defer to full implementation for JSON mode
|
|
30
|
-
return false;
|
|
31
|
-
case 'health-check':
|
|
32
|
-
// This will be handled in main async function
|
|
33
|
-
return false;
|
|
34
|
-
case 'status':
|
|
35
|
-
showStatus();
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
// Get package version without full initialization
|
|
41
|
-
function getPackageVersion() {
|
|
42
|
-
try {
|
|
43
|
-
const filePath = fileURLToPath(import.meta.url);
|
|
44
|
-
const packagePath = resolve(dirname(filePath), '../../package.json');
|
|
45
|
-
const payload = JSON.parse(readFileSync(packagePath, 'utf8'));
|
|
46
|
-
return typeof payload.version === 'string' ? payload.version : '0.0.0';
|
|
47
|
-
}
|
|
48
|
-
catch {
|
|
49
|
-
return '0.0.0';
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
// Fast help without full initialization
|
|
53
|
-
function showFastHelp() {
|
|
54
|
-
console.log(`
|
|
55
|
-
Erosolar CLI v${getPackageVersion()} - Fast Help
|
|
56
|
-
|
|
57
|
-
Usage:
|
|
58
|
-
erosolar [command] [options]
|
|
59
|
-
|
|
60
|
-
Fast Commands:
|
|
61
|
-
version, -v Show version
|
|
62
|
-
help, -h Show this help
|
|
63
|
-
status Show system status
|
|
64
|
-
|
|
65
|
-
Full Commands:
|
|
66
|
-
[interactive] Start interactive shell
|
|
67
|
-
--json <command> Run command in JSON mode
|
|
68
|
-
health-check Run health check
|
|
69
|
-
|
|
70
|
-
Options:
|
|
71
|
-
--provider <name> Specify AI provider
|
|
72
|
-
--model <name> Specify AI model
|
|
73
|
-
--profile <name> Use specific agent profile
|
|
74
|
-
|
|
75
|
-
Examples:
|
|
76
|
-
erosolar version
|
|
77
|
-
erosolar --json "list files"
|
|
78
|
-
erosolar --provider openai --model gpt-4
|
|
79
|
-
`);
|
|
80
|
-
}
|
|
81
|
-
// Run health check without full initialization
|
|
82
|
-
async function runHealthCheck() {
|
|
83
|
-
console.log('🧪 Running fast health check...\n');
|
|
84
|
-
const checks = [
|
|
85
|
-
{ name: 'Node.js version', check: checkNodeVersion },
|
|
86
|
-
{ name: 'Package configuration', check: checkPackageConfig },
|
|
87
|
-
{ name: 'Build directory', check: checkBuildDir },
|
|
88
|
-
{ name: 'Main binary', check: checkMainBinary },
|
|
89
|
-
];
|
|
90
|
-
let passed = 0;
|
|
91
|
-
let failed = 0;
|
|
92
|
-
for (const { name, check } of checks) {
|
|
93
|
-
try {
|
|
94
|
-
await check();
|
|
95
|
-
console.log(`✅ ${name}`);
|
|
96
|
-
passed++;
|
|
97
|
-
}
|
|
98
|
-
catch (error) {
|
|
99
|
-
console.log(`❌ ${name}: ${error instanceof Error ? error.message : error}`);
|
|
100
|
-
failed++;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
console.log(`\n📊 Results: ${passed} passed, ${failed} failed`);
|
|
104
|
-
if (failed > 0) {
|
|
105
|
-
process.exit(1);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
// Check Node.js version
|
|
109
|
-
function checkNodeVersion() {
|
|
110
|
-
const version = process.version;
|
|
111
|
-
const major = parseInt(version.slice(1).split('.')[0], 10);
|
|
112
|
-
if (major < 20) {
|
|
113
|
-
throw new Error(`Node.js ${version} is too old, requires >=20.0.0`);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
// Check package configuration
|
|
117
|
-
function checkPackageConfig() {
|
|
118
|
-
const filePath = fileURLToPath(import.meta.url);
|
|
119
|
-
const packagePath = resolve(dirname(filePath), '../../package.json');
|
|
120
|
-
if (!readFileSync(packagePath, 'utf8')) {
|
|
121
|
-
throw new Error('Package.json not found or empty');
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
// Check build directory
|
|
125
|
-
function checkBuildDir() {
|
|
126
|
-
const filePath = fileURLToPath(import.meta.url);
|
|
127
|
-
const buildPath = resolve(dirname(filePath), '../../dist');
|
|
128
|
-
try {
|
|
129
|
-
const stats = readFileSync(buildPath);
|
|
130
|
-
if (!stats) {
|
|
131
|
-
throw new Error('Build directory does not exist');
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
catch {
|
|
135
|
-
throw new Error('Build directory does not exist');
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
// Check main binary
|
|
139
|
-
function checkMainBinary() {
|
|
140
|
-
const filePath = fileURLToPath(import.meta.url);
|
|
141
|
-
const binaryPath = resolve(dirname(filePath), '../../dist/bin/erosolar.js');
|
|
142
|
-
try {
|
|
143
|
-
const stats = readFileSync(binaryPath);
|
|
144
|
-
if (!stats) {
|
|
145
|
-
throw new Error('Main binary does not exist');
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
catch {
|
|
149
|
-
throw new Error('Main binary does not exist');
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
// Show system status
|
|
153
|
-
function showStatus() {
|
|
154
|
-
console.log(`
|
|
155
|
-
Erosolar CLI Status
|
|
156
|
-
───────────────────
|
|
157
|
-
Version: ${getPackageVersion()}
|
|
158
|
-
Node.js: ${process.version}
|
|
159
|
-
Platform: ${process.platform} ${process.arch}
|
|
160
|
-
Working Directory: ${process.cwd()}
|
|
161
|
-
|
|
162
|
-
Fast Commands: ✅ Available
|
|
163
|
-
Full Shell: ⚠️ May be slow to initialize
|
|
164
|
-
Health Check: ✅ Available
|
|
165
|
-
`);
|
|
166
|
-
}
|
|
167
|
-
// Main execution
|
|
168
|
-
async function main() {
|
|
169
|
-
const argv = process.argv.slice(2);
|
|
170
|
-
// Handle fast-path commands
|
|
171
|
-
if (handleFastPathCommand(argv)) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
// Handle health check (needs to be async)
|
|
175
|
-
if (argv[0] === 'health-check') {
|
|
176
|
-
await runHealthCheck();
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
// Defer to full implementation for complex commands
|
|
180
|
-
console.log('🚀 Starting full Erosolar CLI...');
|
|
181
|
-
console.log('⏳ This may take a moment for complex initialization...\n');
|
|
182
|
-
try {
|
|
183
|
-
if (argv.includes('--json')) {
|
|
184
|
-
const { runHeadlessApp } = await import('../headless/headlessApp.js');
|
|
185
|
-
await runHeadlessApp({ argv });
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
const { launchShell } = await import('../shell/shellApp.js');
|
|
189
|
-
await launchShell('erosolar-code', { enableProfileSelection: true });
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
catch (error) {
|
|
193
|
-
console.error('\n❌ CLI Error:', error instanceof Error ? error.message : error);
|
|
194
|
-
// Provide helpful suggestions
|
|
195
|
-
if (error instanceof Error && error.message.includes('Cannot find module')) {
|
|
196
|
-
console.log('\n💡 Try running: npm run build');
|
|
197
|
-
}
|
|
198
|
-
process.exit(1);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
// Start the application
|
|
202
|
-
main().catch((error) => {
|
|
203
|
-
console.error('Fatal error:', error instanceof Error ? error.message : error);
|
|
204
|
-
process.exit(1);
|
|
205
|
-
});
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { TaskRunner } from '../subagents/taskRunner.js';
|
|
2
|
-
export class AgentSpawningCapabilityModule {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.id = 'capability.agent-spawning';
|
|
5
|
-
}
|
|
6
|
-
async create(context) {
|
|
7
|
-
const runner = new TaskRunner(context);
|
|
8
|
-
return {
|
|
9
|
-
id: 'agent-spawning.tools',
|
|
10
|
-
description: 'Launch specialized agents to handle complex, multi-step tasks autonomously',
|
|
11
|
-
toolSuite: {
|
|
12
|
-
id: 'agent-spawning',
|
|
13
|
-
description: 'Task agent spawning and management',
|
|
14
|
-
tools: [
|
|
15
|
-
{
|
|
16
|
-
name: 'Task',
|
|
17
|
-
description: `Launch a new agent to handle complex, multi-step tasks autonomously.
|
|
18
|
-
|
|
19
|
-
The Task tool launches specialized agents (subprocesses) that autonomously handle complex tasks. Each agent type has specific capabilities and tools available to it.
|
|
20
|
-
|
|
21
|
-
Available agent types and the tools they have access to:
|
|
22
|
-
- general-purpose: General-purpose agent for researching complex questions, searching for code, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries use this agent to perform the search for you. (Tools: *)
|
|
23
|
-
- Explore: Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (eg. "src/components/**/*.tsx"), search code for keywords (eg. "API endpoints"), or answer questions about the codebase (eg. "how do API endpoints work?"). When calling this agent, specify the desired thoroughness level: "quick" for basic searches, "medium" for moderate exploration, or "very thorough" for comprehensive analysis across multiple locations and naming conventions. (Tools: All tools)
|
|
24
|
-
- Plan: Fast agent specialized for planning tasks. Use this when you need to break down complex tasks into steps, analyze requirements, or create implementation strategies. (Tools: All tools)
|
|
25
|
-
|
|
26
|
-
When using the Task tool, you must specify a subagent_type parameter to select which agent type to use.
|
|
27
|
-
|
|
28
|
-
When NOT to use the Task tool:
|
|
29
|
-
- If you want to read a specific file path, use the Read or Glob tool instead of the Task tool, to find the match more quickly
|
|
30
|
-
- If you are searching for a specific class definition like "class Foo", use the Glob tool instead, to find the match more quickly
|
|
31
|
-
- If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Task tool, to find the match more quickly
|
|
32
|
-
- Other tasks that are not related to the agent descriptions above
|
|
33
|
-
|
|
34
|
-
Usage notes:
|
|
35
|
-
- Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses
|
|
36
|
-
- When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.
|
|
37
|
-
- Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.
|
|
38
|
-
- The agent's outputs should generally be trusted
|
|
39
|
-
- Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent
|
|
40
|
-
- If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.
|
|
41
|
-
|
|
42
|
-
Example usage:
|
|
43
|
-
- "Find all TypeScript files in the project and identify which ones use async/await"
|
|
44
|
-
- "Explore the authentication system and explain how JWT tokens are validated"
|
|
45
|
-
- "Plan the implementation of a new user dashboard feature"`,
|
|
46
|
-
parameters: {
|
|
47
|
-
type: 'object',
|
|
48
|
-
properties: {
|
|
49
|
-
description: {
|
|
50
|
-
type: 'string',
|
|
51
|
-
description: 'A short (3-5 word) description of the task',
|
|
52
|
-
},
|
|
53
|
-
prompt: {
|
|
54
|
-
type: 'string',
|
|
55
|
-
description: 'The task for the agent to perform',
|
|
56
|
-
},
|
|
57
|
-
subagent_type: {
|
|
58
|
-
type: 'string',
|
|
59
|
-
description: 'The type of specialized agent to use for this task',
|
|
60
|
-
},
|
|
61
|
-
model: {
|
|
62
|
-
type: 'string',
|
|
63
|
-
enum: ['sonnet', 'opus', 'haiku'],
|
|
64
|
-
description: 'Optional model to use for this agent. If not specified, inherits from parent. Prefer haiku for quick, straightforward tasks to minimize cost and latency.',
|
|
65
|
-
},
|
|
66
|
-
resume: {
|
|
67
|
-
type: 'string',
|
|
68
|
-
description: 'Optional agent ID to resume from. If provided, the agent will continue from the previous execution transcript.',
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
required: ['description', 'prompt', 'subagent_type'],
|
|
72
|
-
},
|
|
73
|
-
handler: async (args) => {
|
|
74
|
-
try {
|
|
75
|
-
const input = parseTaskArguments(args);
|
|
76
|
-
const result = await runner.runTask(input);
|
|
77
|
-
return result.output;
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
81
|
-
return `Task tool failed: ${message}`;
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
function parseTaskArguments(args) {
|
|
91
|
-
const description = expectString(args['description'], 'description');
|
|
92
|
-
const prompt = expectString(args['prompt'], 'prompt');
|
|
93
|
-
const subagentType = expectString(args['subagent_type'], 'subagent_type');
|
|
94
|
-
const modelValue = typeof args['model'] === 'string' ? args['model'].trim().toLowerCase() : undefined;
|
|
95
|
-
let model;
|
|
96
|
-
if (modelValue) {
|
|
97
|
-
if (modelValue !== 'sonnet' && modelValue !== 'opus' && modelValue !== 'haiku') {
|
|
98
|
-
throw new Error(`Invalid model "${args['model']}". Allowed values are sonnet, opus, or haiku.`);
|
|
99
|
-
}
|
|
100
|
-
model = modelValue;
|
|
101
|
-
}
|
|
102
|
-
const resumeId = typeof args['resume'] === 'string' ? args['resume'].trim() : undefined;
|
|
103
|
-
return {
|
|
104
|
-
description,
|
|
105
|
-
prompt,
|
|
106
|
-
subagentType,
|
|
107
|
-
model,
|
|
108
|
-
resumeId: resumeId && resumeId.length ? resumeId : undefined,
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
function expectString(value, field) {
|
|
112
|
-
if (typeof value !== 'string' || !value.trim()) {
|
|
113
|
-
throw new Error(`Task tool is missing a valid "${field}" parameter.`);
|
|
114
|
-
}
|
|
115
|
-
return value.trim();
|
|
116
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createBashTools } from '../tools/bashTools.js';
|
|
2
|
-
export class BashCapabilityModule {
|
|
3
|
-
constructor(options = {}) {
|
|
4
|
-
this.id = 'capability.bash';
|
|
5
|
-
this.options = options;
|
|
6
|
-
}
|
|
7
|
-
async create(context) {
|
|
8
|
-
const workingDir = this.options.workingDir ?? context.workingDir;
|
|
9
|
-
return {
|
|
10
|
-
id: this.options.id ?? 'bash.tools.shell',
|
|
11
|
-
description: this.options.description ?? 'Shell execution with stdout/stderr summaries for reproducibility.',
|
|
12
|
-
toolSuite: {
|
|
13
|
-
id: 'bash',
|
|
14
|
-
description: 'Shell access',
|
|
15
|
-
tools: createBashTools(workingDir),
|
|
16
|
-
},
|
|
17
|
-
metadata: {
|
|
18
|
-
workingDir,
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { createCloudTools } from '../tools/cloudTools.js';
|
|
2
|
-
export class CloudCapabilityModule {
|
|
3
|
-
constructor(options = {}) {
|
|
4
|
-
this.id = 'capability.cloud';
|
|
5
|
-
this.options = options;
|
|
6
|
-
}
|
|
7
|
-
async create(context) {
|
|
8
|
-
const workingDir = this.options.workingDir ?? context.workingDir;
|
|
9
|
-
return {
|
|
10
|
-
id: this.options.id ?? 'cloud.tools.deployment',
|
|
11
|
-
description: this.options.description ??
|
|
12
|
-
'Cloud deployment tools with automatic CLI detection, configuration checking, and auto-fixing for Firebase, Aliyun, AWS, GCP, Azure, Vercel, Netlify, and more.',
|
|
13
|
-
toolSuite: {
|
|
14
|
-
id: 'cloud',
|
|
15
|
-
description: 'Multi-cloud deployment and management tools',
|
|
16
|
-
tools: createCloudTools(workingDir),
|
|
17
|
-
},
|
|
18
|
-
metadata: {
|
|
19
|
-
workingDir,
|
|
20
|
-
supportedProviders: [
|
|
21
|
-
'firebase',
|
|
22
|
-
'aliyun',
|
|
23
|
-
'aws',
|
|
24
|
-
'gcloud',
|
|
25
|
-
'azure',
|
|
26
|
-
'vercel',
|
|
27
|
-
'netlify',
|
|
28
|
-
'cloudflare',
|
|
29
|
-
'fly',
|
|
30
|
-
'railway',
|
|
31
|
-
'supabase',
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createCodeAnalysisTools } from '../tools/codeAnalysisTools.js';
|
|
2
|
-
export class CodeAnalysisCapabilityModule {
|
|
3
|
-
constructor(options = {}) {
|
|
4
|
-
this.id = 'capability.code-analysis';
|
|
5
|
-
this.options = options;
|
|
6
|
-
}
|
|
7
|
-
async create(context) {
|
|
8
|
-
const workingDir = this.options.workingDir ?? context.workingDir;
|
|
9
|
-
return {
|
|
10
|
-
id: this.options.id ?? 'code-analysis.tools.structural',
|
|
11
|
-
description: this.options.description ?? 'Advanced code structure analysis, dependency tracking, and complexity metrics.',
|
|
12
|
-
toolSuite: {
|
|
13
|
-
id: 'code-analysis',
|
|
14
|
-
description: 'Code analysis and metrics',
|
|
15
|
-
tools: createCodeAnalysisTools(workingDir),
|
|
16
|
-
},
|
|
17
|
-
metadata: {
|
|
18
|
-
workingDir,
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { createCodeQualityTools } from '../tools/codeQualityTools.js';
|
|
2
|
-
export class CodeQualityCapabilityModule {
|
|
3
|
-
constructor(options = {}) {
|
|
4
|
-
this.id = 'capability.code-quality';
|
|
5
|
-
this.options = options;
|
|
6
|
-
}
|
|
7
|
-
async create(context) {
|
|
8
|
-
const workingDir = this.options.workingDir ?? context.workingDir;
|
|
9
|
-
return {
|
|
10
|
-
id: this.options.id ?? 'code-quality.tools.linting',
|
|
11
|
-
description: this.options.description ??
|
|
12
|
-
'Code quality helpers for linting, maintainability analysis, and ESLint rule discovery.',
|
|
13
|
-
toolSuite: {
|
|
14
|
-
id: 'code-quality',
|
|
15
|
-
description: 'Code quality and linting',
|
|
16
|
-
tools: createCodeQualityTools(workingDir),
|
|
17
|
-
},
|
|
18
|
-
metadata: {
|
|
19
|
-
workingDir,
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createDependencyTools } from '../tools/dependencyTools.js';
|
|
2
|
-
export class DependencySecurityCapabilityModule {
|
|
3
|
-
constructor(options = {}) {
|
|
4
|
-
this.id = 'capability.dependency-security';
|
|
5
|
-
this.options = options;
|
|
6
|
-
}
|
|
7
|
-
async create(context) {
|
|
8
|
-
const workingDir = this.options.workingDir ?? context.workingDir;
|
|
9
|
-
return {
|
|
10
|
-
id: this.options.id ?? 'dependency.tools.health',
|
|
11
|
-
description: this.options.description ?? 'Dependency insight, npm audit orchestration, and lockfile health summaries.',
|
|
12
|
-
toolSuite: {
|
|
13
|
-
id: 'dependency-security',
|
|
14
|
-
description: 'Dependency analysis & security scanning',
|
|
15
|
-
tools: createDependencyTools(workingDir),
|
|
16
|
-
},
|
|
17
|
-
metadata: {
|
|
18
|
-
workingDir,
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createDevTools } from '../tools/devTools.js';
|
|
2
|
-
export class DevCapabilityModule {
|
|
3
|
-
constructor(options = {}) {
|
|
4
|
-
this.id = 'capability.development';
|
|
5
|
-
this.options = options;
|
|
6
|
-
}
|
|
7
|
-
async create(context) {
|
|
8
|
-
const workingDir = this.options.workingDir ?? context.workingDir;
|
|
9
|
-
return {
|
|
10
|
-
id: this.options.id ?? 'development.tools.workflow',
|
|
11
|
-
description: this.options.description ?? 'Development workflow tools for testing, building, and dependency management.',
|
|
12
|
-
toolSuite: {
|
|
13
|
-
id: 'development',
|
|
14
|
-
description: 'Development workflow',
|
|
15
|
-
tools: createDevTools(workingDir),
|
|
16
|
-
},
|
|
17
|
-
metadata: {
|
|
18
|
-
workingDir,
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { createEditTools } from '../tools/editTools.js';
|
|
2
|
-
/**
|
|
3
|
-
* Edit Capability Module
|
|
4
|
-
*
|
|
5
|
-
* Provides surgical file editing via exact string replacement.
|
|
6
|
-
* This capability is essential for making targeted code changes without full file rewrites.
|
|
7
|
-
*
|
|
8
|
-
* Tools:
|
|
9
|
-
* - Edit: Exact string replacement with uniqueness checking
|
|
10
|
-
*
|
|
11
|
-
* Scope: filesystem:write
|
|
12
|
-
*/
|
|
13
|
-
export class EditCapabilityModule {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.id = 'capability.edit';
|
|
16
|
-
}
|
|
17
|
-
async create(context) {
|
|
18
|
-
const tools = createEditTools(context.workingDir);
|
|
19
|
-
return {
|
|
20
|
-
id: 'edit.surgical_edits',
|
|
21
|
-
description: 'Surgical file editing via exact string replacement',
|
|
22
|
-
toolSuite: {
|
|
23
|
-
id: 'edit',
|
|
24
|
-
tools,
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { createEmailTools } from '../tools/emailTools.js';
|
|
2
|
-
export class EmailCapabilityModule {
|
|
3
|
-
constructor(options = {}) {
|
|
4
|
-
this.id = 'capability.email';
|
|
5
|
-
this.options = options;
|
|
6
|
-
}
|
|
7
|
-
async create(_context) {
|
|
8
|
-
return {
|
|
9
|
-
id: this.options.id ?? 'email.tools.smtp',
|
|
10
|
-
description: this.options.description ??
|
|
11
|
-
'Email sending tools via SMTP with support for Gmail, Outlook, and custom providers.',
|
|
12
|
-
toolSuite: {
|
|
13
|
-
id: 'email',
|
|
14
|
-
description: 'SMTP email tools for sending individual and batch emails',
|
|
15
|
-
tools: createEmailTools(),
|
|
16
|
-
},
|
|
17
|
-
metadata: {},
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
}
|