erosolar-cli 1.7.253 → 1.7.254
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/README.md +148 -22
- package/dist/core/aiFlowOptimizer.d.ts +26 -0
- package/dist/core/aiFlowOptimizer.d.ts.map +1 -0
- package/dist/core/aiFlowOptimizer.js +31 -0
- package/dist/core/aiFlowOptimizer.js.map +1 -0
- package/dist/core/aiOptimizationEngine.d.ts +158 -0
- package/dist/core/aiOptimizationEngine.d.ts.map +1 -0
- package/dist/core/aiOptimizationEngine.js +428 -0
- package/dist/core/aiOptimizationEngine.js.map +1 -0
- package/dist/core/aiOptimizationIntegration.d.ts +93 -0
- package/dist/core/aiOptimizationIntegration.d.ts.map +1 -0
- package/dist/core/aiOptimizationIntegration.js +250 -0
- package/dist/core/aiOptimizationIntegration.js.map +1 -0
- package/dist/core/customCommands.d.ts +0 -1
- package/dist/core/customCommands.d.ts.map +1 -1
- package/dist/core/customCommands.js +0 -3
- package/dist/core/customCommands.js.map +1 -1
- package/dist/core/enhancedErrorRecovery.d.ts +100 -0
- package/dist/core/enhancedErrorRecovery.d.ts.map +1 -0
- package/dist/core/enhancedErrorRecovery.js +345 -0
- package/dist/core/enhancedErrorRecovery.js.map +1 -0
- package/dist/core/toolPreconditions.d.ts.map +1 -1
- package/dist/core/toolPreconditions.js +14 -0
- package/dist/core/toolPreconditions.js.map +1 -1
- package/dist/core/toolRuntime.d.ts.map +1 -1
- package/dist/core/toolRuntime.js +5 -0
- package/dist/core/toolRuntime.js.map +1 -1
- package/dist/core/toolValidation.d.ts.map +1 -1
- package/dist/core/toolValidation.js +3 -14
- package/dist/core/toolValidation.js.map +1 -1
- package/dist/mcp/sseClient.d.ts.map +1 -1
- package/dist/mcp/sseClient.js +18 -9
- package/dist/mcp/sseClient.js.map +1 -1
- package/dist/plugins/tools/build/buildPlugin.d.ts +6 -0
- package/dist/plugins/tools/build/buildPlugin.d.ts.map +1 -1
- package/dist/plugins/tools/build/buildPlugin.js +10 -4
- package/dist/plugins/tools/build/buildPlugin.js.map +1 -1
- package/dist/shell/claudeCodeStreamHandler.d.ts +145 -0
- package/dist/shell/claudeCodeStreamHandler.d.ts.map +1 -0
- package/dist/shell/claudeCodeStreamHandler.js +322 -0
- package/dist/shell/claudeCodeStreamHandler.js.map +1 -0
- package/dist/shell/inputQueueManager.d.ts +144 -0
- package/dist/shell/inputQueueManager.d.ts.map +1 -0
- package/dist/shell/inputQueueManager.js +290 -0
- package/dist/shell/inputQueueManager.js.map +1 -0
- package/dist/shell/interactiveShell.d.ts +2 -10
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +31 -183
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/streamingOutputManager.d.ts +115 -0
- package/dist/shell/streamingOutputManager.d.ts.map +1 -0
- package/dist/shell/streamingOutputManager.js +225 -0
- package/dist/shell/streamingOutputManager.js.map +1 -0
- package/dist/shell/terminalInput.d.ts +131 -54
- package/dist/shell/terminalInput.d.ts.map +1 -1
- package/dist/shell/terminalInput.js +643 -353
- package/dist/shell/terminalInput.js.map +1 -1
- package/dist/shell/terminalInputAdapter.d.ts +15 -12
- package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
- package/dist/shell/terminalInputAdapter.js +22 -8
- package/dist/shell/terminalInputAdapter.js.map +1 -1
- package/dist/ui/display.d.ts +0 -19
- package/dist/ui/display.d.ts.map +1 -1
- package/dist/ui/display.js +2 -133
- package/dist/ui/display.js.map +1 -1
- package/dist/ui/persistentPrompt.d.ts +50 -0
- package/dist/ui/persistentPrompt.d.ts.map +1 -0
- package/dist/ui/persistentPrompt.js +92 -0
- package/dist/ui/persistentPrompt.js.map +1 -0
- package/dist/ui/terminalUISchema.d.ts +195 -0
- package/dist/ui/terminalUISchema.d.ts.map +1 -0
- package/dist/ui/terminalUISchema.js +113 -0
- package/dist/ui/terminalUISchema.js.map +1 -0
- package/dist/ui/theme.d.ts.map +1 -1
- package/dist/ui/theme.js +8 -6
- package/dist/ui/theme.js.map +1 -1
- package/dist/ui/unified/layout.d.ts +0 -1
- package/dist/ui/unified/layout.d.ts.map +1 -1
- package/dist/ui/unified/layout.js +25 -15
- package/dist/ui/unified/layout.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,47 +1,173 @@
|
|
|
1
1
|
# erosolar-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## AI Coding Agent Comparison
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
| Agent | Screenshot |
|
|
6
|
+
|-------|------------|
|
|
7
|
+
| **Claude Code** |  |
|
|
8
|
+
| **OpenAI Codex CLI** |  |
|
|
9
|
+
| **Erosolar CLI** |  |
|
|
10
|
+
|
|
11
|
+
### Current State
|
|
12
|
+
|
|
13
|
+
**Claude Code** currently delivers the best results for creating complete projects from scratch. It successfully built a CS50 final project end-to-end and launched it without manual intervention.
|
|
14
|
+
|
|
15
|
+
**OpenAI Codex CLI** provides solid coding assistance but requires more human guidance for complex multi-step project creation.
|
|
16
|
+
|
|
17
|
+
**Erosolar CLI** is actively being developed by Bo Shang to match and eventually exceed these capabilities. The goal is to achieve the same level of autonomous project creation, constrained only by the underlying model's limits—not by the CLI tooling itself. This work is ongoing.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Overview
|
|
22
|
+
|
|
23
|
+
**Erosolar CLI** is a sophisticated, unified AI coding agent framework for the command line that provides multi-provider AI support with advanced code intelligence and security research capabilities.
|
|
24
|
+
|
|
25
|
+
### Core Purpose
|
|
26
|
+
|
|
27
|
+
1. **Universal AI Interface**: Acts as a model-agnostic CLI that works with any major AI provider (OpenAI, Anthropic, Google, xAI, DeepSeek, Ollama) - you bring your own API keys
|
|
28
|
+
|
|
29
|
+
2. **Advanced Code Intelligence**: Provides comprehensive coding capabilities including:
|
|
30
|
+
- File system operations (read/write/edit)
|
|
31
|
+
- Code search and analysis
|
|
32
|
+
- Bash command execution
|
|
33
|
+
- Git operations
|
|
34
|
+
- Browser automation
|
|
35
|
+
- Cloud deployment
|
|
36
|
+
- Testing and validation
|
|
37
|
+
|
|
38
|
+
3. **Security Research Toolkit**: Includes sophisticated security testing and research capabilities for:
|
|
39
|
+
- Penetration testing
|
|
40
|
+
- Vulnerability scanning
|
|
41
|
+
- Threat intelligence
|
|
42
|
+
- Red team operations
|
|
43
|
+
- Counter-intelligence simulations
|
|
44
|
+
|
|
45
|
+
### Key Features
|
|
46
|
+
|
|
47
|
+
- **Multi-Provider Support** - Switch between OpenAI, Anthropic, Google, xAI, DeepSeek, or run locally with Ollama
|
|
48
|
+
- **25+ Built-in Models** - From GPT-5 to Claude Opus to Gemini Pro to local Llama models
|
|
49
|
+
- **Advanced Code Intelligence** - Full file system access, git operations, bash command execution
|
|
50
|
+
- **Browser Automation** - Web scraping, form filling, authentication, testing
|
|
51
|
+
- **Cloud Deployment** - Firebase, Vercel, Netlify, AWS, GCP, Azure support
|
|
52
|
+
- **Security Research** - Penetration testing, vulnerability scanning, threat intelligence
|
|
53
|
+
- **Testing Framework** - Unit tests, E2E tests, accessibility tests, performance audits
|
|
54
|
+
- **Email Automation** - SMTP email sending, batch campaigns, template personalization
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Installation
|
|
9
59
|
|
|
10
|
-
## Install
|
|
11
60
|
```bash
|
|
12
61
|
npm install -g erosolar-cli
|
|
13
|
-
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Or use npx:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
14
67
|
npx erosolar-cli
|
|
15
68
|
```
|
|
16
69
|
|
|
17
|
-
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Quick Start
|
|
73
|
+
|
|
18
74
|
```bash
|
|
19
|
-
#
|
|
75
|
+
# Basic usage
|
|
20
76
|
erosolar
|
|
21
77
|
|
|
22
|
-
#
|
|
78
|
+
# With specific provider and model
|
|
23
79
|
erosolar --provider openai --model gpt-4o
|
|
24
80
|
|
|
25
|
-
#
|
|
81
|
+
# With agent profile
|
|
82
|
+
erosolar --profile erosolar-code
|
|
83
|
+
|
|
84
|
+
# Resume last session
|
|
26
85
|
erosolar --restore
|
|
27
86
|
```
|
|
28
87
|
|
|
29
|
-
|
|
30
|
-
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Configuration
|
|
91
|
+
|
|
92
|
+
Set your API keys as environment variables:
|
|
93
|
+
|
|
31
94
|
```bash
|
|
32
|
-
|
|
33
|
-
|
|
95
|
+
# OpenAI
|
|
96
|
+
OPENAI_API_KEY=sk-...
|
|
97
|
+
|
|
98
|
+
# Anthropic
|
|
99
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
100
|
+
|
|
101
|
+
# Google AI
|
|
34
102
|
GOOGLE_API_KEY=...
|
|
103
|
+
|
|
104
|
+
# xAI
|
|
35
105
|
XAI_API_KEY=...
|
|
106
|
+
|
|
107
|
+
# DeepSeek
|
|
36
108
|
DEEPSEEK_API_KEY=...
|
|
109
|
+
|
|
110
|
+
# Ollama (local)
|
|
37
111
|
OLLAMA_BASE_URL=http://localhost:11434
|
|
38
112
|
```
|
|
39
113
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Usage
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
erosolar [options]
|
|
120
|
+
|
|
121
|
+
Options:
|
|
122
|
+
--provider <name> AI provider (openai, anthropic, google, xai, deepseek, ollama)
|
|
123
|
+
--model <name> Specific model to use
|
|
124
|
+
--profile <name> Agent profile (general, erosolar-code)
|
|
125
|
+
--restore Resume last session
|
|
126
|
+
--version Show version
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Agent Profiles
|
|
132
|
+
|
|
133
|
+
Erosolar CLI supports multiple agent profiles optimized for different tasks:
|
|
134
|
+
|
|
135
|
+
- **`erosolar-code`**: Coding specialist optimized for fast, deterministic edits
|
|
136
|
+
- **`general`**: General-purpose agent for research and analysis
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Development Status
|
|
141
|
+
|
|
142
|
+
Erosolar CLI is actively being developed to achieve production readiness. Current focus areas include:
|
|
143
|
+
|
|
144
|
+
- ✅ Multi-provider AI support
|
|
145
|
+
- ✅ Advanced code intelligence
|
|
146
|
+
- ✅ Security research capabilities
|
|
147
|
+
- 🔄 Performance optimization
|
|
148
|
+
- 🔄 Enterprise features
|
|
149
|
+
- 🔄 Enhanced reliability
|
|
150
|
+
|
|
151
|
+
See [CRITICAL_ENHANCEMENTS.md](./CRITICAL_ENHANCEMENTS.md) for detailed roadmap.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## License
|
|
156
|
+
|
|
157
|
+
MIT
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Links
|
|
162
|
+
|
|
163
|
+
- [npm Package](https://www.npmjs.com/package/erosolar-cli)
|
|
164
|
+
- [GitHub](https://github.com/ErosolarAI/erosolar-by-bo)
|
|
165
|
+
- [Issues](https://github.com/ErosolarAI/erosolar-by-bo/issues)
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Author
|
|
170
|
+
|
|
171
|
+
Built by **Bo Shang** with assistance from Claude Code and OpenAI Codex CLI. A special thanks goes to Samantha Briasco-Stewart (erosolar) for motivating Bo to code.
|
|
46
172
|
|
|
47
|
-
|
|
173
|
+
And an apology to Samantha for all of Bo's mistakes.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight AI flow optimizer stub.
|
|
3
|
+
*/
|
|
4
|
+
export interface AIFlowMetrics {
|
|
5
|
+
latencyMs: number;
|
|
6
|
+
toolCalls: number;
|
|
7
|
+
tokenUsage?: number;
|
|
8
|
+
parallelExecution?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface OptimizedFlow {
|
|
11
|
+
originalMetrics: AIFlowMetrics;
|
|
12
|
+
optimizedMetrics: AIFlowMetrics;
|
|
13
|
+
suggestions: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface OptimizationInsights {
|
|
16
|
+
patterns: string[];
|
|
17
|
+
averageLatency?: number;
|
|
18
|
+
}
|
|
19
|
+
export declare class AIFlowOptimizer {
|
|
20
|
+
constructor(_options?: {
|
|
21
|
+
workingDir?: string;
|
|
22
|
+
});
|
|
23
|
+
analyzeFlow(flowData: any): OptimizedFlow;
|
|
24
|
+
getOptimizationInsights(): OptimizationInsights;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=aiFlowOptimizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aiFlowOptimizer.d.ts","sourceRoot":"","sources":["../../src/core/aiFlowOptimizer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,aAAa,CAAC;IAC/B,gBAAgB,EAAE,aAAa,CAAC;IAChC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,eAAe;gBAEd,QAAQ,GAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAO;IAElD,WAAW,CAAC,QAAQ,EAAE,GAAG,GAAG,aAAa;IAoBzC,uBAAuB,IAAI,oBAAoB;CAMhD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight AI flow optimizer stub.
|
|
3
|
+
*/
|
|
4
|
+
export class AIFlowOptimizer {
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
|
+
constructor(_options = {}) { }
|
|
7
|
+
analyzeFlow(flowData) {
|
|
8
|
+
const baseline = {
|
|
9
|
+
latencyMs: Number(flowData?.latencyMs ?? 1000),
|
|
10
|
+
toolCalls: Number(flowData?.toolCalls ?? 1),
|
|
11
|
+
tokenUsage: Number(flowData?.tokenUsage ?? 0),
|
|
12
|
+
parallelExecution: Boolean(flowData?.parallelExecution ?? false),
|
|
13
|
+
};
|
|
14
|
+
const optimized = {
|
|
15
|
+
...baseline,
|
|
16
|
+
latencyMs: Math.max(100, Math.round(baseline.latencyMs * 0.9)),
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
originalMetrics: baseline,
|
|
20
|
+
optimizedMetrics: optimized,
|
|
21
|
+
suggestions: ['Enable parallel execution where safe', 'Trim redundant tool calls'],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
getOptimizationInsights() {
|
|
25
|
+
return {
|
|
26
|
+
patterns: ['stub-optimization-pattern'],
|
|
27
|
+
averageLatency: undefined,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=aiFlowOptimizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aiFlowOptimizer.js","sourceRoot":"","sources":["../../src/core/aiFlowOptimizer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAoBH,MAAM,OAAO,eAAe;IAC1B,6DAA6D;IAC7D,YAAY,WAAoC,EAAE,IAAG,CAAC;IAEtD,WAAW,CAAC,QAAa;QACvB,MAAM,QAAQ,GAAkB;YAC9B,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS,IAAI,IAAI,CAAC;YAC9C,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS,IAAI,CAAC,CAAC;YAC3C,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,UAAU,IAAI,CAAC,CAAC;YAC7C,iBAAiB,EAAE,OAAO,CAAC,QAAQ,EAAE,iBAAiB,IAAI,KAAK,CAAC;SACjE,CAAC;QAEF,MAAM,SAAS,GAAkB;YAC/B,GAAG,QAAQ;YACX,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC;SAC/D,CAAC;QAEF,OAAO;YACL,eAAe,EAAE,QAAQ;YACzB,gBAAgB,EAAE,SAAS;YAC3B,WAAW,EAAE,CAAC,sCAAsC,EAAE,2BAA2B,CAAC;SACnF,CAAC;IACJ,CAAC;IAED,uBAAuB;QACrB,OAAO;YACL,QAAQ,EAAE,CAAC,2BAA2B,CAAC;YACvC,cAAc,EAAE,SAAS;SAC1B,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Optimization Engine - Advanced Decision Making and Error Recovery
|
|
3
|
+
*
|
|
4
|
+
* Provides intelligent problem-solving with:
|
|
5
|
+
* - Optimal solution path analysis
|
|
6
|
+
* - Multi-strategy decision making
|
|
7
|
+
* - Intelligent error recovery
|
|
8
|
+
* - Performance optimization
|
|
9
|
+
* - Context-aware reasoning
|
|
10
|
+
*
|
|
11
|
+
* @license MIT
|
|
12
|
+
* @author Bo Shang
|
|
13
|
+
*/
|
|
14
|
+
export declare enum ProblemComplexity {
|
|
15
|
+
TRIVIAL = "trivial",// Single-step, deterministic solution
|
|
16
|
+
SIMPLE = "simple",// 2-3 steps, clear path
|
|
17
|
+
MODERATE = "moderate",// Multiple steps, some uncertainty
|
|
18
|
+
COMPLEX = "complex",// Complex dependencies, multiple approaches
|
|
19
|
+
VERY_COMPLEX = "very_complex"
|
|
20
|
+
}
|
|
21
|
+
export declare enum SolutionStrategy {
|
|
22
|
+
DIRECT = "direct",// Straightforward implementation
|
|
23
|
+
INCREMENTAL = "incremental",// Step-by-step with validation
|
|
24
|
+
DEFENSIVE = "defensive",// Conservative with fallbacks
|
|
25
|
+
OPTIMISTIC = "optimistic",// Aggressive with rollback
|
|
26
|
+
ADAPTIVE = "adaptive",// Dynamic strategy selection
|
|
27
|
+
EXPLORATORY = "exploratory"
|
|
28
|
+
}
|
|
29
|
+
export interface ProblemAnalysis {
|
|
30
|
+
complexity: ProblemComplexity;
|
|
31
|
+
riskLevel: 'low' | 'medium' | 'high';
|
|
32
|
+
dependencies: string[];
|
|
33
|
+
constraints: string[];
|
|
34
|
+
successCriteria: string[];
|
|
35
|
+
failurePoints: string[];
|
|
36
|
+
optimalStrategy: SolutionStrategy;
|
|
37
|
+
alternativeStrategies: SolutionStrategy[];
|
|
38
|
+
estimatedSteps: number;
|
|
39
|
+
confidence: number;
|
|
40
|
+
}
|
|
41
|
+
export interface SolutionPath {
|
|
42
|
+
strategy: SolutionStrategy;
|
|
43
|
+
steps: SolutionStep[];
|
|
44
|
+
validationPoints: ValidationPoint[];
|
|
45
|
+
rollbackPlan: RollbackStep[];
|
|
46
|
+
estimatedTime: number;
|
|
47
|
+
successProbability: number;
|
|
48
|
+
}
|
|
49
|
+
export interface SolutionStep {
|
|
50
|
+
id: string;
|
|
51
|
+
action: string;
|
|
52
|
+
tool?: string;
|
|
53
|
+
parameters?: Record<string, unknown>;
|
|
54
|
+
validation?: string;
|
|
55
|
+
fallback?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface ValidationPoint {
|
|
58
|
+
stepId: string;
|
|
59
|
+
validationType: 'tool_output' | 'file_content' | 'test_result' | 'user_confirmation';
|
|
60
|
+
expectedPattern?: string;
|
|
61
|
+
failureAction: 'retry' | 'fallback' | 'abort';
|
|
62
|
+
}
|
|
63
|
+
export interface RollbackStep {
|
|
64
|
+
stepId: string;
|
|
65
|
+
action: string;
|
|
66
|
+
tool?: string;
|
|
67
|
+
parameters?: Record<string, unknown>;
|
|
68
|
+
}
|
|
69
|
+
export interface ErrorRecoveryStrategy {
|
|
70
|
+
errorType: string;
|
|
71
|
+
errorPattern: RegExp;
|
|
72
|
+
recoveryActions: RecoveryAction[];
|
|
73
|
+
priority: 'immediate' | 'high' | 'medium' | 'low';
|
|
74
|
+
autoRecoverable: boolean;
|
|
75
|
+
}
|
|
76
|
+
export interface RecoveryAction {
|
|
77
|
+
action: string;
|
|
78
|
+
tool?: string;
|
|
79
|
+
parameters?: Record<string, unknown>;
|
|
80
|
+
validation?: string;
|
|
81
|
+
successProbability: number;
|
|
82
|
+
}
|
|
83
|
+
export declare class AIOptimizationEngine {
|
|
84
|
+
private readonly workingDir;
|
|
85
|
+
private readonly performanceThresholds;
|
|
86
|
+
constructor(options?: {
|
|
87
|
+
workingDir?: string;
|
|
88
|
+
});
|
|
89
|
+
/**
|
|
90
|
+
* Analyze problem and determine optimal solution strategy
|
|
91
|
+
*/
|
|
92
|
+
analyzeProblem(problemDescription: string, context?: {
|
|
93
|
+
filesRead?: string[];
|
|
94
|
+
toolsUsed?: string[];
|
|
95
|
+
errorsEncountered?: string[];
|
|
96
|
+
complexityHints?: string[];
|
|
97
|
+
}): ProblemAnalysis;
|
|
98
|
+
/**
|
|
99
|
+
* Generate optimal solution path with validation and rollback
|
|
100
|
+
*/
|
|
101
|
+
generateSolutionPath(analysis: ProblemAnalysis, context: {
|
|
102
|
+
availableTools: string[];
|
|
103
|
+
currentState: Record<string, unknown>;
|
|
104
|
+
userPreferences?: {
|
|
105
|
+
riskTolerance: 'low' | 'medium' | 'high';
|
|
106
|
+
validationPreference: 'minimal' | 'balanced' | 'thorough';
|
|
107
|
+
};
|
|
108
|
+
}): SolutionPath;
|
|
109
|
+
/**
|
|
110
|
+
* Intelligent error recovery with multiple strategies
|
|
111
|
+
*/
|
|
112
|
+
recoverFromError(error: string, context: {
|
|
113
|
+
currentStep: SolutionStep;
|
|
114
|
+
analysis: ProblemAnalysis;
|
|
115
|
+
attemptedSolutions: string[];
|
|
116
|
+
availableTools: string[];
|
|
117
|
+
}): RecoveryAction[];
|
|
118
|
+
/**
|
|
119
|
+
* Optimize AI flow for efficiency and effectiveness
|
|
120
|
+
*/
|
|
121
|
+
optimizeAIFlow(currentFlow: {
|
|
122
|
+
toolCalls: Array<{
|
|
123
|
+
tool: string;
|
|
124
|
+
parameters: Record<string, unknown>;
|
|
125
|
+
}>;
|
|
126
|
+
contextUsage: {
|
|
127
|
+
filesRead: number;
|
|
128
|
+
searches: number;
|
|
129
|
+
edits: number;
|
|
130
|
+
};
|
|
131
|
+
validationRounds: number;
|
|
132
|
+
}): {
|
|
133
|
+
optimizedFlow: Array<{
|
|
134
|
+
tool: string;
|
|
135
|
+
parameters: Record<string, unknown>;
|
|
136
|
+
}>;
|
|
137
|
+
efficiencyGains: number;
|
|
138
|
+
recommendations: string[];
|
|
139
|
+
};
|
|
140
|
+
private assessComplexity;
|
|
141
|
+
private assessRisk;
|
|
142
|
+
private extractDependencies;
|
|
143
|
+
private extractConstraints;
|
|
144
|
+
private extractSuccessCriteria;
|
|
145
|
+
private identifyFailurePoints;
|
|
146
|
+
private selectOptimalStrategy;
|
|
147
|
+
private getAlternativeStrategies;
|
|
148
|
+
private estimateSteps;
|
|
149
|
+
private calculateConfidence;
|
|
150
|
+
private generateSteps;
|
|
151
|
+
private getErrorRecoveryStrategies;
|
|
152
|
+
private isStrategyApplicable;
|
|
153
|
+
private detectSequentialReads;
|
|
154
|
+
private mergeSequentialReads;
|
|
155
|
+
private calculateContextEfficiency;
|
|
156
|
+
private calculateEfficiencyGains;
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=aiOptimizationEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aiOptimizationEngine.d.ts","sourceRoot":"","sources":["../../src/core/aiOptimizationEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,oBAA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