erosolar-cli 2.0.5 → 2.1.2
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/agents/erosolar-security.rules.json +147 -0
- package/dist/capabilities/enhancedAnalysisCapability.d.ts +13 -0
- package/dist/capabilities/enhancedAnalysisCapability.d.ts.map +1 -0
- package/dist/capabilities/enhancedAnalysisCapability.js +20 -0
- package/dist/capabilities/enhancedAnalysisCapability.js.map +1 -0
- package/dist/capabilities/offsecOpsCapability.d.ts +6 -0
- package/dist/capabilities/offsecOpsCapability.d.ts.map +1 -0
- package/dist/capabilities/offsecOpsCapability.js +20 -0
- package/dist/capabilities/offsecOpsCapability.js.map +1 -0
- package/dist/capabilities/offsecSearchCapability.d.ts +12 -0
- package/dist/capabilities/offsecSearchCapability.d.ts.map +1 -0
- package/dist/capabilities/offsecSearchCapability.js +27 -0
- package/dist/capabilities/offsecSearchCapability.js.map +1 -0
- package/dist/capabilities/taoCapability.d.ts +6 -0
- package/dist/capabilities/taoCapability.d.ts.map +1 -0
- package/dist/capabilities/taoCapability.js +20 -0
- package/dist/capabilities/taoCapability.js.map +1 -0
- package/dist/capabilities/toolRegistry.d.ts +2 -1
- package/dist/capabilities/toolRegistry.d.ts.map +1 -1
- package/dist/capabilities/toolRegistry.js +6 -1
- package/dist/capabilities/toolRegistry.js.map +1 -1
- package/dist/contracts/agent-schemas.json +18 -19
- package/dist/contracts/tools.schema.json +38 -8
- package/dist/core/agent.js +4 -4
- package/dist/core/agent.js.map +1 -1
- package/dist/core/alphaZeroEngine.js +1 -1
- package/dist/core/alphaZeroEngine.js.map +1 -1
- package/dist/core/alphaZeroModular.js +2 -2
- package/dist/core/alphaZeroModular.js.map +1 -1
- package/dist/core/contextManager.d.ts +8 -2
- package/dist/core/contextManager.d.ts.map +1 -1
- package/dist/core/contextManager.js +15 -2
- package/dist/core/contextManager.js.map +1 -1
- package/dist/core/costTracker.js +1 -1
- package/dist/core/costTracker.js.map +1 -1
- package/dist/core/deepBugAnalyzer.d.ts +128 -0
- package/dist/core/deepBugAnalyzer.d.ts.map +1 -0
- package/dist/core/deepBugAnalyzer.js +406 -0
- package/dist/core/deepBugAnalyzer.js.map +1 -0
- package/dist/core/hypothesisEngine.d.ts +113 -0
- package/dist/core/hypothesisEngine.d.ts.map +1 -0
- package/dist/core/hypothesisEngine.js +264 -0
- package/dist/core/hypothesisEngine.js.map +1 -0
- package/dist/core/intelligentSummarizer.d.ts +79 -0
- package/dist/core/intelligentSummarizer.d.ts.map +1 -0
- package/dist/core/intelligentSummarizer.js +273 -0
- package/dist/core/intelligentSummarizer.js.map +1 -0
- package/dist/core/memorySystem.js +2 -2
- package/dist/core/memorySystem.js.map +1 -1
- package/dist/core/offsecAlphaZero.d.ts +3 -0
- package/dist/core/offsecAlphaZero.d.ts.map +1 -1
- package/dist/core/offsecAlphaZero.js +166 -5
- package/dist/core/offsecAlphaZero.js.map +1 -1
- package/dist/core/productTestHarness.d.ts +113 -0
- package/dist/core/productTestHarness.d.ts.map +1 -0
- package/dist/core/productTestHarness.js +345 -0
- package/dist/core/productTestHarness.js.map +1 -0
- package/dist/core/securityAssessment.js +1 -1
- package/dist/core/securityAssessment.js.map +1 -1
- package/dist/core/toolPatternAnalyzer.d.ts +87 -0
- package/dist/core/toolPatternAnalyzer.d.ts.map +1 -0
- package/dist/core/toolPatternAnalyzer.js +272 -0
- package/dist/core/toolPatternAnalyzer.js.map +1 -0
- package/dist/core/updateChecker.js +3 -3
- package/dist/core/updateChecker.js.map +1 -1
- package/dist/mcp/sseClient.js +1 -1
- package/dist/mcp/sseClient.js.map +1 -1
- package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.d.ts +3 -0
- package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.js +14 -0
- package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.js.map +1 -0
- package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.d.ts +3 -0
- package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.d.ts.map +1 -0
- package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.js +12 -0
- package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.js.map +1 -0
- package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.d.ts +3 -0
- package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.js +12 -0
- package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.js.map +1 -0
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
- package/dist/plugins/tools/nodeDefaults.js +12 -0
- package/dist/plugins/tools/nodeDefaults.js.map +1 -1
- package/dist/plugins/tools/offsec/offsecOpsPlugin.d.ts +3 -0
- package/dist/plugins/tools/offsec/offsecOpsPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/offsec/offsecOpsPlugin.js +10 -0
- package/dist/plugins/tools/offsec/offsecOpsPlugin.js.map +1 -0
- package/dist/plugins/tools/offsec/offsecSearchPlugin.d.ts +3 -0
- package/dist/plugins/tools/offsec/offsecSearchPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/offsec/offsecSearchPlugin.js +12 -0
- package/dist/plugins/tools/offsec/offsecSearchPlugin.js.map +1 -0
- package/dist/plugins/tools/tao/taoPlugin.d.ts +3 -0
- package/dist/plugins/tools/tao/taoPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/tao/taoPlugin.js +10 -0
- package/dist/plugins/tools/tao/taoPlugin.js.map +1 -0
- package/dist/shell/composableMessage.js +2 -2
- package/dist/shell/composableMessage.js.map +1 -1
- package/dist/shell/interactiveShell.d.ts +6 -0
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +50 -15
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/shellApp.js +1 -1
- package/dist/shell/shellApp.js.map +1 -1
- package/dist/shell/systemPrompt.d.ts.map +1 -1
- package/dist/shell/systemPrompt.js +3 -0
- package/dist/shell/systemPrompt.js.map +1 -1
- package/dist/tools/buildTools.js +1 -1
- package/dist/tools/buildTools.js.map +1 -1
- package/dist/tools/diffUtils.js +6 -6
- package/dist/tools/diffUtils.js.map +1 -1
- package/dist/tools/editTools.js +1 -1
- package/dist/tools/editTools.js.map +1 -1
- package/dist/tools/enhancedAnalysisTools.d.ts +9 -0
- package/dist/tools/enhancedAnalysisTools.d.ts.map +1 -0
- package/dist/tools/enhancedAnalysisTools.js +382 -0
- package/dist/tools/enhancedAnalysisTools.js.map +1 -0
- package/dist/tools/enhancedCodeIntelligenceTools.d.ts +1 -21
- package/dist/tools/enhancedCodeIntelligenceTools.d.ts.map +1 -1
- package/dist/tools/enhancedCodeIntelligenceTools.js +378 -256
- package/dist/tools/enhancedCodeIntelligenceTools.js.map +1 -1
- package/dist/tools/enhancedDevWorkflowTools.d.ts +2 -10
- package/dist/tools/enhancedDevWorkflowTools.d.ts.map +1 -1
- package/dist/tools/enhancedDevWorkflowTools.js +293 -165
- package/dist/tools/enhancedDevWorkflowTools.js.map +1 -1
- package/dist/tools/interactionTools.d.ts.map +1 -1
- package/dist/tools/interactionTools.js +55 -0
- package/dist/tools/interactionTools.js.map +1 -1
- package/dist/tools/learnTools.js +1 -1
- package/dist/tools/learnTools.js.map +1 -1
- package/dist/tools/offsec/offsecOperationsTools.d.ts +3 -0
- package/dist/tools/offsec/offsecOperationsTools.d.ts.map +1 -0
- package/dist/tools/offsec/offsecOperationsTools.js +333 -0
- package/dist/tools/offsec/offsecOperationsTools.js.map +1 -0
- package/dist/tools/offsecSearchTools.d.ts +3 -0
- package/dist/tools/offsecSearchTools.d.ts.map +1 -0
- package/dist/tools/offsecSearchTools.js +330 -0
- package/dist/tools/offsecSearchTools.js.map +1 -0
- package/dist/tools/taoOperations.d.ts +7 -0
- package/dist/tools/taoOperations.d.ts.map +1 -0
- package/dist/tools/taoOperations.js +744 -0
- package/dist/tools/taoOperations.js.map +1 -0
- package/dist/ui/ClaudeCodeRenderer.js +1 -1
- package/dist/ui/ClaudeCodeRenderer.js.map +1 -1
- package/dist/ui/ShellUIAdapter.d.ts +10 -6
- package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
- package/dist/ui/ShellUIAdapter.js +69 -67
- package/dist/ui/ShellUIAdapter.js.map +1 -1
- package/dist/ui/UnifiedUIRenderer.d.ts +2 -0
- package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -1
- package/dist/ui/UnifiedUIRenderer.js +64 -13
- package/dist/ui/UnifiedUIRenderer.js.map +1 -1
- package/dist/ui/globalWriteLock.d.ts.map +1 -1
- package/dist/ui/globalWriteLock.js +6 -0
- package/dist/ui/globalWriteLock.js.map +1 -1
- package/dist/ui/inPlaceUpdater.js +1 -1
- package/dist/ui/inPlaceUpdater.js.map +1 -1
- package/dist/ui/outputMode.d.ts.map +1 -1
- package/dist/ui/outputMode.js +1 -2
- package/dist/ui/outputMode.js.map +1 -1
- package/dist/ui/richText.js +4 -4
- package/dist/ui/richText.js.map +1 -1
- package/dist/ui/streamingFormatter.d.ts +11 -0
- package/dist/ui/streamingFormatter.d.ts.map +1 -1
- package/dist/ui/streamingFormatter.js +27 -1
- package/dist/ui/streamingFormatter.js.map +1 -1
- package/dist/ui/toolDisplay.js +1 -1
- package/dist/ui/toolDisplay.js.map +1 -1
- package/package.json +4 -13
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced Analysis Tools - Expose advanced reasoning and testing capabilities to AI
|
|
3
|
+
*
|
|
4
|
+
* These tools enable the AI to use hypothesis testing, comprehensive runtime testing,
|
|
5
|
+
* and deep bug analysis for better problem-solving.
|
|
6
|
+
*/
|
|
7
|
+
import { HypothesisEngine } from '../core/hypothesisEngine.js';
|
|
8
|
+
import { DeepBugAnalyzer } from '../core/deepBugAnalyzer.js';
|
|
9
|
+
import { ProductTestHarness, createRuntimeEnvironment, } from '../core/productTestHarness.js';
|
|
10
|
+
// Global instances for session continuity
|
|
11
|
+
let hypothesisEngine = null;
|
|
12
|
+
let bugAnalyzer = null;
|
|
13
|
+
let testHarness = null;
|
|
14
|
+
function getHypothesisEngine() {
|
|
15
|
+
if (!hypothesisEngine) {
|
|
16
|
+
hypothesisEngine = new HypothesisEngine(10);
|
|
17
|
+
}
|
|
18
|
+
return hypothesisEngine;
|
|
19
|
+
}
|
|
20
|
+
function getBugAnalyzer() {
|
|
21
|
+
if (!bugAnalyzer) {
|
|
22
|
+
bugAnalyzer = new DeepBugAnalyzer();
|
|
23
|
+
}
|
|
24
|
+
return bugAnalyzer;
|
|
25
|
+
}
|
|
26
|
+
function getTestHarness() {
|
|
27
|
+
if (!testHarness) {
|
|
28
|
+
testHarness = new ProductTestHarness();
|
|
29
|
+
}
|
|
30
|
+
return testHarness;
|
|
31
|
+
}
|
|
32
|
+
export const enhancedAnalysisTools = {
|
|
33
|
+
id: 'enhanced-analysis',
|
|
34
|
+
description: 'Advanced reasoning, hypothesis testing, and comprehensive bug analysis tools',
|
|
35
|
+
tools: [
|
|
36
|
+
{
|
|
37
|
+
name: 'GenerateHypothesis',
|
|
38
|
+
description: `Generate a hypothesis about a problem or bug. Use this when you want to explore multiple possible explanations before settling on a solution. The hypothesis can then be tested with evidence and test results.
|
|
39
|
+
|
|
40
|
+
Usage: Call this when:
|
|
41
|
+
- Investigating a bug with unclear root cause
|
|
42
|
+
- Exploring multiple solution approaches
|
|
43
|
+
- Need to systematically evaluate possibilities
|
|
44
|
+
- Want to track confidence in different explanations
|
|
45
|
+
|
|
46
|
+
Returns a hypothesis ID that can be used with AddEvidence and TestHypothesis tools.`,
|
|
47
|
+
parameters: {
|
|
48
|
+
type: 'object',
|
|
49
|
+
required: ['description'],
|
|
50
|
+
properties: {
|
|
51
|
+
description: {
|
|
52
|
+
type: 'string',
|
|
53
|
+
description: 'Clear description of the hypothesis (e.g., "The bug is caused by a race condition in async initialization")',
|
|
54
|
+
},
|
|
55
|
+
initialEvidence: {
|
|
56
|
+
type: 'array',
|
|
57
|
+
description: 'Optional initial evidence supporting this hypothesis',
|
|
58
|
+
items: {
|
|
59
|
+
type: 'object',
|
|
60
|
+
required: ['type', 'content', 'weight'],
|
|
61
|
+
properties: {
|
|
62
|
+
type: {
|
|
63
|
+
type: 'string',
|
|
64
|
+
enum: ['observation', 'data', 'test_result', 'user_feedback'],
|
|
65
|
+
description: 'Type of evidence',
|
|
66
|
+
},
|
|
67
|
+
content: {
|
|
68
|
+
type: 'string',
|
|
69
|
+
description: 'Description of the evidence',
|
|
70
|
+
},
|
|
71
|
+
weight: {
|
|
72
|
+
type: 'number',
|
|
73
|
+
description: 'How much this evidence supports the hypothesis (-1 to 1, where 1 is strong support)',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
handler: async (args) => {
|
|
81
|
+
const description = args['description'];
|
|
82
|
+
const initialEvidence = args['initialEvidence'];
|
|
83
|
+
const engine = getHypothesisEngine();
|
|
84
|
+
const evidence = (initialEvidence || []).map(e => ({
|
|
85
|
+
type: e.type,
|
|
86
|
+
content: e.content,
|
|
87
|
+
weight: e.weight,
|
|
88
|
+
timestamp: new Date(),
|
|
89
|
+
}));
|
|
90
|
+
const hypothesis = engine.generateHypothesis(description, evidence);
|
|
91
|
+
return JSON.stringify({
|
|
92
|
+
success: true,
|
|
93
|
+
hypothesisId: hypothesis.id,
|
|
94
|
+
description: hypothesis.description,
|
|
95
|
+
initialConfidence: hypothesis.confidence,
|
|
96
|
+
status: hypothesis.status,
|
|
97
|
+
}, null, 2);
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'AddEvidence',
|
|
102
|
+
description: `Add evidence to an existing hypothesis to update its confidence level. Use this as you gather more information during investigation.
|
|
103
|
+
|
|
104
|
+
Returns the updated hypothesis with new confidence score.`,
|
|
105
|
+
parameters: {
|
|
106
|
+
type: 'object',
|
|
107
|
+
required: ['hypothesisId', 'evidenceType', 'content', 'weight'],
|
|
108
|
+
properties: {
|
|
109
|
+
hypothesisId: {
|
|
110
|
+
type: 'string',
|
|
111
|
+
description: 'The ID of the hypothesis returned from GenerateHypothesis',
|
|
112
|
+
},
|
|
113
|
+
evidenceType: {
|
|
114
|
+
type: 'string',
|
|
115
|
+
enum: ['observation', 'data', 'test_result', 'user_feedback'],
|
|
116
|
+
description: 'Type of evidence being added',
|
|
117
|
+
},
|
|
118
|
+
content: {
|
|
119
|
+
type: 'string',
|
|
120
|
+
description: 'Description of the evidence',
|
|
121
|
+
},
|
|
122
|
+
weight: {
|
|
123
|
+
type: 'number',
|
|
124
|
+
description: 'How much this supports the hypothesis (-1 to 1)',
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
handler: async (args) => {
|
|
129
|
+
const hypothesisId = args['hypothesisId'];
|
|
130
|
+
const evidenceType = args['evidenceType'];
|
|
131
|
+
const content = args['content'];
|
|
132
|
+
const weight = args['weight'];
|
|
133
|
+
const engine = getHypothesisEngine();
|
|
134
|
+
try {
|
|
135
|
+
engine.addEvidence(hypothesisId, {
|
|
136
|
+
type: evidenceType,
|
|
137
|
+
content,
|
|
138
|
+
weight,
|
|
139
|
+
timestamp: new Date(),
|
|
140
|
+
});
|
|
141
|
+
const hypothesis = engine.getHypothesis(hypothesisId);
|
|
142
|
+
return JSON.stringify({
|
|
143
|
+
success: true,
|
|
144
|
+
hypothesisId,
|
|
145
|
+
updatedConfidence: hypothesis?.confidence,
|
|
146
|
+
evidenceCount: hypothesis?.evidence.length,
|
|
147
|
+
}, null, 2);
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
return JSON.stringify({
|
|
151
|
+
success: false,
|
|
152
|
+
error: error instanceof Error ? error.message : String(error),
|
|
153
|
+
}, null, 2);
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: 'GetBestHypothesis',
|
|
159
|
+
description: `Get the most promising hypothesis based on current evidence and confidence. Use this after generating multiple hypotheses to determine which one to pursue.
|
|
160
|
+
|
|
161
|
+
Returns the hypothesis with highest confidence that hasn't been rejected.`,
|
|
162
|
+
parameters: {
|
|
163
|
+
type: 'object',
|
|
164
|
+
properties: {},
|
|
165
|
+
},
|
|
166
|
+
handler: async () => {
|
|
167
|
+
const engine = getHypothesisEngine();
|
|
168
|
+
const best = engine.getBestHypothesis();
|
|
169
|
+
if (!best) {
|
|
170
|
+
return JSON.stringify({
|
|
171
|
+
success: false,
|
|
172
|
+
message: 'No hypotheses have been generated yet',
|
|
173
|
+
}, null, 2);
|
|
174
|
+
}
|
|
175
|
+
return JSON.stringify({
|
|
176
|
+
success: true,
|
|
177
|
+
hypothesis: {
|
|
178
|
+
id: best.id,
|
|
179
|
+
description: best.description,
|
|
180
|
+
confidence: best.confidence,
|
|
181
|
+
status: best.status,
|
|
182
|
+
evidenceCount: best.evidence.length,
|
|
183
|
+
testResults: best.testResults?.length || 0,
|
|
184
|
+
},
|
|
185
|
+
}, null, 2);
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: 'AnalyzeBugDeep',
|
|
190
|
+
description: `Perform deep multi-causal bug analysis. This investigates ALL potential causes systematically rather than stopping at the first plausible explanation.
|
|
191
|
+
|
|
192
|
+
Use this for complex bugs where the root cause is unclear. The analysis will:
|
|
193
|
+
1. Generate hypotheses across multiple categories (code, config, environment, data, timing, dependencies)
|
|
194
|
+
2. Test each hypothesis systematically
|
|
195
|
+
3. Rank causes by likelihood and evidence
|
|
196
|
+
4. Provide recommended actions
|
|
197
|
+
|
|
198
|
+
Analysis depths:
|
|
199
|
+
- shallow: Quick analysis, code and config only
|
|
200
|
+
- moderate: Add environment and data analysis
|
|
201
|
+
- deep: Add timing/concurrency analysis (recommended)
|
|
202
|
+
- exhaustive: Full analysis including dependencies (slowest but most thorough)`,
|
|
203
|
+
parameters: {
|
|
204
|
+
type: 'object',
|
|
205
|
+
required: ['title', 'description'],
|
|
206
|
+
properties: {
|
|
207
|
+
title: {
|
|
208
|
+
type: 'string',
|
|
209
|
+
description: 'Short title for the bug',
|
|
210
|
+
},
|
|
211
|
+
description: {
|
|
212
|
+
type: 'string',
|
|
213
|
+
description: 'Detailed description of the bug',
|
|
214
|
+
},
|
|
215
|
+
expectedBehavior: {
|
|
216
|
+
type: 'string',
|
|
217
|
+
description: 'What should happen',
|
|
218
|
+
},
|
|
219
|
+
actualBehavior: {
|
|
220
|
+
type: 'string',
|
|
221
|
+
description: 'What actually happens',
|
|
222
|
+
},
|
|
223
|
+
stackTrace: {
|
|
224
|
+
type: 'string',
|
|
225
|
+
description: 'Stack trace if available',
|
|
226
|
+
},
|
|
227
|
+
reproductionSteps: {
|
|
228
|
+
type: 'array',
|
|
229
|
+
items: { type: 'string' },
|
|
230
|
+
description: 'Steps to reproduce the bug',
|
|
231
|
+
},
|
|
232
|
+
relatedFiles: {
|
|
233
|
+
type: 'array',
|
|
234
|
+
items: { type: 'string' },
|
|
235
|
+
description: 'File paths that might be related',
|
|
236
|
+
},
|
|
237
|
+
codeContext: {
|
|
238
|
+
type: 'object',
|
|
239
|
+
description: 'Map of filename to file content for analysis',
|
|
240
|
+
},
|
|
241
|
+
depth: {
|
|
242
|
+
type: 'string',
|
|
243
|
+
enum: ['shallow', 'moderate', 'deep', 'exhaustive'],
|
|
244
|
+
description: 'How deep to analyze (default: deep)',
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
handler: async (args) => {
|
|
249
|
+
const title = args['title'];
|
|
250
|
+
const description = args['description'];
|
|
251
|
+
const expectedBehavior = args['expectedBehavior'];
|
|
252
|
+
const actualBehavior = args['actualBehavior'];
|
|
253
|
+
const stackTrace = args['stackTrace'];
|
|
254
|
+
const reproductionSteps = args['reproductionSteps'];
|
|
255
|
+
const relatedFiles = args['relatedFiles'];
|
|
256
|
+
const codeContext = args['codeContext'];
|
|
257
|
+
const depth = args['depth'] || 'deep';
|
|
258
|
+
const analyzer = getBugAnalyzer();
|
|
259
|
+
const bugReport = {
|
|
260
|
+
title,
|
|
261
|
+
description,
|
|
262
|
+
expectedBehavior,
|
|
263
|
+
actualBehavior,
|
|
264
|
+
stackTrace,
|
|
265
|
+
reproductionSteps,
|
|
266
|
+
relatedFiles,
|
|
267
|
+
};
|
|
268
|
+
const codeContextMap = new Map(Object.entries(codeContext || {}));
|
|
269
|
+
const result = await analyzer.analyze(bugReport, codeContextMap, depth);
|
|
270
|
+
// Format the result for readability
|
|
271
|
+
const output = {
|
|
272
|
+
analysisDepth: result.analysisDepth,
|
|
273
|
+
confidence: `${(result.confidence * 100).toFixed(1)}%`,
|
|
274
|
+
primaryCause: result.primaryCause ? {
|
|
275
|
+
category: result.primaryCause.category,
|
|
276
|
+
description: result.primaryCause.description,
|
|
277
|
+
likelihood: `${(result.primaryCause.likelihood * 100).toFixed(1)}%`,
|
|
278
|
+
evidence: result.primaryCause.evidence,
|
|
279
|
+
suggestedFix: result.primaryCause.suggestedFix,
|
|
280
|
+
} : null,
|
|
281
|
+
contributingFactors: result.contributingFactors.slice(0, 5).map(f => ({
|
|
282
|
+
category: f.category,
|
|
283
|
+
description: f.description,
|
|
284
|
+
likelihood: `${(f.likelihood * 100).toFixed(1)}%`,
|
|
285
|
+
suggestedFix: f.suggestedFix,
|
|
286
|
+
})),
|
|
287
|
+
recommendedActions: result.recommendedActions,
|
|
288
|
+
hypothesesGenerated: result.allHypotheses.length,
|
|
289
|
+
hypothesesValidated: result.allHypotheses.filter(h => h.status === 'validated').length,
|
|
290
|
+
hypothesesRejected: result.allHypotheses.filter(h => h.status === 'rejected').length,
|
|
291
|
+
};
|
|
292
|
+
return JSON.stringify(output, null, 2);
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
name: 'CreateRuntimeTest',
|
|
297
|
+
description: `Create an isolated runtime environment and execute code to test it. This simulates real execution like a human product tester would.
|
|
298
|
+
|
|
299
|
+
Use this when you want to:
|
|
300
|
+
- Test code changes before applying them
|
|
301
|
+
- Verify a fix works correctly
|
|
302
|
+
- Run edge case tests
|
|
303
|
+
- Performance testing
|
|
304
|
+
|
|
305
|
+
The test runs in an isolated environment and returns execution results including stdout, stderr, exit code, and duration.`,
|
|
306
|
+
parameters: {
|
|
307
|
+
type: 'object',
|
|
308
|
+
required: ['testName', 'code', 'language'],
|
|
309
|
+
properties: {
|
|
310
|
+
testName: {
|
|
311
|
+
type: 'string',
|
|
312
|
+
description: 'Name for this test scenario',
|
|
313
|
+
},
|
|
314
|
+
description: {
|
|
315
|
+
type: 'string',
|
|
316
|
+
description: 'What this test is checking',
|
|
317
|
+
},
|
|
318
|
+
code: {
|
|
319
|
+
type: 'string',
|
|
320
|
+
description: 'The code to execute in the test environment',
|
|
321
|
+
},
|
|
322
|
+
language: {
|
|
323
|
+
type: 'string',
|
|
324
|
+
enum: ['node', 'bash', 'typescript'],
|
|
325
|
+
description: 'Language/runtime to use',
|
|
326
|
+
},
|
|
327
|
+
timeout: {
|
|
328
|
+
type: 'number',
|
|
329
|
+
description: 'Timeout in milliseconds (default: 30000)',
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
handler: async (args) => {
|
|
334
|
+
const testName = args['testName'];
|
|
335
|
+
const description = args['description'];
|
|
336
|
+
const code = args['code'];
|
|
337
|
+
const language = args['language'];
|
|
338
|
+
const timeout = args['timeout'];
|
|
339
|
+
const env = createRuntimeEnvironment();
|
|
340
|
+
try {
|
|
341
|
+
const result = await env.execute(code, language);
|
|
342
|
+
return JSON.stringify({
|
|
343
|
+
testName,
|
|
344
|
+
passed: result.exitCode === 0,
|
|
345
|
+
duration: result.duration,
|
|
346
|
+
exitCode: result.exitCode,
|
|
347
|
+
stdout: result.stdout,
|
|
348
|
+
stderr: result.stderr,
|
|
349
|
+
error: result.error?.message,
|
|
350
|
+
}, null, 2);
|
|
351
|
+
}
|
|
352
|
+
finally {
|
|
353
|
+
env.cleanup();
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
name: 'ClearAnalysisState',
|
|
359
|
+
description: `Clear all hypothesis and bug analysis state to start fresh. Use this when beginning a new investigation or when context needs to be reset.`,
|
|
360
|
+
parameters: {
|
|
361
|
+
type: 'object',
|
|
362
|
+
properties: {},
|
|
363
|
+
},
|
|
364
|
+
handler: async () => {
|
|
365
|
+
if (hypothesisEngine) {
|
|
366
|
+
hypothesisEngine.clear();
|
|
367
|
+
}
|
|
368
|
+
if (bugAnalyzer) {
|
|
369
|
+
bugAnalyzer.clear();
|
|
370
|
+
}
|
|
371
|
+
if (testHarness) {
|
|
372
|
+
testHarness.clear();
|
|
373
|
+
}
|
|
374
|
+
return JSON.stringify({
|
|
375
|
+
success: true,
|
|
376
|
+
message: 'All analysis state cleared',
|
|
377
|
+
}, null, 2);
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
],
|
|
381
|
+
};
|
|
382
|
+
//# sourceMappingURL=enhancedAnalysisTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enhancedAnalysisTools.js","sourceRoot":"","sources":["../../src/tools/enhancedAnalysisTools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,gBAAgB,EAA8E,MAAM,6BAA6B,CAAC;AAC3I,OAAO,EAAE,eAAe,EAAkB,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GAGzB,MAAM,+BAA+B,CAAC;AAEvC,0CAA0C;AAC1C,IAAI,gBAAgB,GAA4B,IAAI,CAAC;AACrD,IAAI,WAAW,GAA2B,IAAI,CAAC;AAC/C,IA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AE,QAAQ;gBACd,UAAU,EAAE,EAAE;aACf;YACD,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,IAAI,gBAAgB,EAAE,CAAC;oBACrB,gBAAgB,CAAC,KAAK,EAAE,CAAC;gBAC3B,CAAC;gBACD,IAAI,WAAW,EAAE,CAAC;oBAChB,WAAW,CAAC,KAAK,EAAE,CAAC;gBACtB,CAAC;gBACD,IAAI,WAAW,EAAE,CAAC;oBAChB,WAAW,CAAC,KAAK,EAAE,CAAC;gBACtB,CAAC;gBAED,OAAO,IAAI,CAAC,SAAS,CAAC;oBACpB,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE,4BAA4B;iBACtC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YACd,CAAC;SACF;KACF;CACF,CAAC"}
|
|
@@ -1,27 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Enhanced Code Intelligence Tools
|
|
3
|
-
*
|
|
3
|
+
* Production-ready code analysis, refactoring, and automation helpers.
|
|
4
4
|
*/
|
|
5
5
|
import type { ToolDefinition } from '../core/toolRuntime.js';
|
|
6
|
-
export interface ComplexityMetrics {
|
|
7
|
-
file: string;
|
|
8
|
-
cyclomaticComplexity: number;
|
|
9
|
-
cognitiveComplexity: number;
|
|
10
|
-
maintainabilityIndex: number;
|
|
11
|
-
linesOfCode: number;
|
|
12
|
-
functionCount: number;
|
|
13
|
-
classCount: number;
|
|
14
|
-
maxNestingDepth: number;
|
|
15
|
-
anyTypeUsage: number;
|
|
16
|
-
todoCount: number;
|
|
17
|
-
}
|
|
18
|
-
export interface RefactoringSuggestion {
|
|
19
|
-
file: string;
|
|
20
|
-
line: number;
|
|
21
|
-
type: 'complexity' | 'nesting' | 'any-type' | 'duplication' | 'performance';
|
|
22
|
-
description: string;
|
|
23
|
-
suggestion: string;
|
|
24
|
-
priority: 'low' | 'medium' | 'high';
|
|
25
|
-
}
|
|
26
6
|
export declare function createEnhancedCodeIntelligenceTools(workingDir: string): ToolDefinition[];
|
|
27
7
|
//# sourceMappingURL=enhancedCodeIntelligenceTools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enhancedCodeIntelligenceTools.d.ts","sourceRoot":"","sources":["../../src/tools/enhancedCodeIntelligenceTools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"enhancedCodeIntelligenceTools.d.ts","sourceRoot":"","sources":["../../src/tools/enhancedCodeIntelligenceTools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAS7D,wBAAgB,mCAAmC,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,EAAE,CAkLxF"}
|