erosolar-cli 1.7.396 → 1.7.398
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/browser/BrowserSessionManager.d.ts +3 -1
- package/dist/browser/BrowserSessionManager.d.ts.map +1 -1
- package/dist/browser/BrowserSessionManager.js +24 -4
- package/dist/browser/BrowserSessionManager.js.map +1 -1
- package/dist/contracts/agent-schemas.json +5 -0
- package/dist/contracts/unified-schema.json +2 -1
- package/dist/core/agent.d.ts +5 -0
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/agent.js +99 -0
- package/dist/core/agent.js.map +1 -1
- package/dist/core/alphaZeroConfig.d.ts +11 -0
- package/dist/core/alphaZeroConfig.d.ts.map +1 -0
- package/dist/core/alphaZeroConfig.js +59 -0
- package/dist/core/alphaZeroConfig.js.map +1 -0
- package/dist/core/alphaZeroEngine.d.ts +8 -0
- package/dist/core/alphaZeroEngine.d.ts.map +1 -1
- package/dist/core/alphaZeroEngine.js +149 -35
- package/dist/core/alphaZeroEngine.js.map +1 -1
- package/dist/core/alphaZeroEnhanced.d.ts +125 -0
- package/dist/core/alphaZeroEnhanced.d.ts.map +1 -0
- package/dist/core/alphaZeroEnhanced.js +386 -0
- package/dist/core/alphaZeroEnhanced.js.map +1 -0
- package/dist/core/alphaZeroOrchestrator.d.ts +17 -0
- package/dist/core/alphaZeroOrchestrator.d.ts.map +1 -1
- package/dist/core/alphaZeroOrchestrator.js +95 -8
- package/dist/core/alphaZeroOrchestrator.js.map +1 -1
- package/dist/core/autonomousVerification.d.ts +103 -0
- package/dist/core/autonomousVerification.d.ts.map +1 -0
- package/dist/core/autonomousVerification.js +583 -0
- package/dist/core/autonomousVerification.js.map +1 -0
- package/dist/core/cliTestHarness.d.ts +5 -0
- package/dist/core/cliTestHarness.d.ts.map +1 -1
- package/dist/core/cliTestHarness.js +14 -3
- package/dist/core/cliTestHarness.js.map +1 -1
- package/dist/core/contextManager.d.ts +10 -0
- package/dist/core/contextManager.d.ts.map +1 -1
- package/dist/core/contextManager.js +18 -0
- package/dist/core/contextManager.js.map +1 -1
- package/dist/core/offsecAlphaZeroEnhanced.d.ts +98 -0
- package/dist/core/offsecAlphaZeroEnhanced.d.ts.map +1 -0
- package/dist/core/offsecAlphaZeroEnhanced.js +441 -0
- package/dist/core/offsecAlphaZeroEnhanced.js.map +1 -0
- package/dist/core/parallelAgentOrchestrator.d.ts +171 -0
- package/dist/core/parallelAgentOrchestrator.d.ts.map +1 -0
- package/dist/core/parallelAgentOrchestrator.js +459 -0
- package/dist/core/parallelAgentOrchestrator.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/shell/interactiveShell.d.ts +15 -0
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +344 -210
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/shellApp.d.ts.map +1 -1
- package/dist/shell/shellApp.js +15 -1
- package/dist/shell/shellApp.js.map +1 -1
- package/dist/shell/terminalInput.d.ts +42 -1
- package/dist/shell/terminalInput.d.ts.map +1 -1
- package/dist/shell/terminalInput.js +276 -6
- package/dist/shell/terminalInput.js.map +1 -1
- package/dist/shell/terminalInputAdapter.d.ts +14 -2
- package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
- package/dist/shell/terminalInputAdapter.js +19 -1
- package/dist/shell/terminalInputAdapter.js.map +1 -1
- package/dist/ui/assistantBlockRenderer.d.ts +28 -0
- package/dist/ui/assistantBlockRenderer.d.ts.map +1 -0
- package/dist/ui/assistantBlockRenderer.js +99 -0
- package/dist/ui/assistantBlockRenderer.js.map +1 -0
- package/dist/ui/display.d.ts +11 -0
- package/dist/ui/display.d.ts.map +1 -1
- package/dist/ui/display.js +37 -0
- package/dist/ui/display.js.map +1 -1
- package/dist/ui/theme.d.ts +80 -81
- package/dist/ui/theme.d.ts.map +1 -1
- package/dist/ui/unified/layout.d.ts +0 -23
- package/dist/ui/unified/layout.d.ts.map +1 -1
- package/dist/ui/unified/layout.js +11 -114
- package/dist/ui/unified/layout.js.map +1 -1
- package/package.json +33 -19
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced AlphaZero Offensive Security Coordinator
|
|
3
|
+
*
|
|
4
|
+
* Extends offsecAlphaZero with:
|
|
5
|
+
* - Autonomous verification for strict confirmation of success
|
|
6
|
+
* - Retry strategies with alternative approaches
|
|
7
|
+
* - Confidence-based outcome recording
|
|
8
|
+
* - Multi-method verification before confirming success
|
|
9
|
+
*/
|
|
10
|
+
import { startOffsecRun, resumeOffsecRun, recordOffsecOutcome, getOffsecNextActions, listOffsecRuns, formatOffsecStatus, } from './offsecAlphaZero.js';
|
|
11
|
+
import { autonomousVerification, } from './autonomousVerification.js';
|
|
12
|
+
import { spawn } from 'child_process';
|
|
13
|
+
/**
|
|
14
|
+
* Default retry strategies for offensive security actions
|
|
15
|
+
*/
|
|
16
|
+
const DEFAULT_RETRY_STRATEGIES = [
|
|
17
|
+
{
|
|
18
|
+
name: 'stealth-mode',
|
|
19
|
+
description: 'Reduce scan speed and use evasion techniques',
|
|
20
|
+
modifyCommand: (cmd, attempt) => {
|
|
21
|
+
// Add stealth flags for nmap
|
|
22
|
+
if (cmd.includes('nmap')) {
|
|
23
|
+
return cmd.replace(/-T[0-5]/, `-T${Math.max(0, 4 - attempt)}`);
|
|
24
|
+
}
|
|
25
|
+
// Add delays for other tools
|
|
26
|
+
if (cmd.includes('dirsearch')) {
|
|
27
|
+
return cmd + ` --delay=${attempt * 500}`;
|
|
28
|
+
}
|
|
29
|
+
return cmd;
|
|
30
|
+
},
|
|
31
|
+
applicableCategories: ['recon', 'web'],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'alt-user-agent',
|
|
35
|
+
description: 'Try different user agents to bypass WAF',
|
|
36
|
+
modifyCommand: (cmd, attempt) => {
|
|
37
|
+
const userAgents = [
|
|
38
|
+
'Mozilla/5.0 (Windows NT 10.0; Win64; x64)',
|
|
39
|
+
'Googlebot/2.1 (+http://www.google.com/bot.html)',
|
|
40
|
+
'curl/7.68.0',
|
|
41
|
+
];
|
|
42
|
+
const ua = userAgents[attempt % userAgents.length];
|
|
43
|
+
if (cmd.includes('curl')) {
|
|
44
|
+
return cmd.replace(/curl/, `curl -A "${ua}"`);
|
|
45
|
+
}
|
|
46
|
+
return cmd;
|
|
47
|
+
},
|
|
48
|
+
applicableCategories: ['web', 'payload'],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'encoding-bypass',
|
|
52
|
+
description: 'Apply encoding to bypass filters',
|
|
53
|
+
modifyCommand: (cmd, attempt) => {
|
|
54
|
+
// URL encode parameters
|
|
55
|
+
if (cmd.includes('sqlmap')) {
|
|
56
|
+
const encodings = ['', '--tamper=base64encode', '--tamper=charencode'];
|
|
57
|
+
const tamper = encodings[attempt % encodings.length];
|
|
58
|
+
return cmd + ` ${tamper}`;
|
|
59
|
+
}
|
|
60
|
+
return cmd;
|
|
61
|
+
},
|
|
62
|
+
applicableCategories: ['payload', 'web'],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'alt-port',
|
|
66
|
+
description: 'Try alternative ports for the same service',
|
|
67
|
+
modifyCommand: (cmd, attempt) => {
|
|
68
|
+
// Common alternative ports
|
|
69
|
+
const altPorts = {
|
|
70
|
+
80: [8080, 8000, 8888],
|
|
71
|
+
443: [8443, 4443],
|
|
72
|
+
22: [2222, 2200],
|
|
73
|
+
3306: [3307, 13306],
|
|
74
|
+
};
|
|
75
|
+
// Modify port in command if possible
|
|
76
|
+
for (const [standard, alts] of Object.entries(altPorts)) {
|
|
77
|
+
if (cmd.includes(`:${standard}`)) {
|
|
78
|
+
const alt = alts[(attempt - 1) % alts.length];
|
|
79
|
+
return cmd.replace(`:${standard}`, `:${alt}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return cmd;
|
|
83
|
+
},
|
|
84
|
+
applicableCategories: ['recon', 'lateral'],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'credential-variation',
|
|
88
|
+
description: 'Try credential variations (case changes, common mutations)',
|
|
89
|
+
modifyCommand: (cmd, attempt) => {
|
|
90
|
+
// Apply common password variations
|
|
91
|
+
// This is a simplified example
|
|
92
|
+
return cmd;
|
|
93
|
+
},
|
|
94
|
+
applicableCategories: ['creds', 'lateral'],
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
/**
|
|
98
|
+
* Enhanced offensive security coordinator with autonomous verification
|
|
99
|
+
*/
|
|
100
|
+
export class OffsecAlphaZeroEnhanced {
|
|
101
|
+
context;
|
|
102
|
+
verificationConfig;
|
|
103
|
+
constructor(initialContext = {}, verificationConfig) {
|
|
104
|
+
this.context = {
|
|
105
|
+
target: initialContext.target || '<target>',
|
|
106
|
+
url: initialContext.url || 'http://<target>',
|
|
107
|
+
previousOutputs: initialContext.previousOutputs || [],
|
|
108
|
+
discoveredCredentials: initialContext.discoveredCredentials || [],
|
|
109
|
+
discoveredHosts: initialContext.discoveredHosts || [],
|
|
110
|
+
currentPrivilegeLevel: initialContext.currentPrivilegeLevel || 'unknown',
|
|
111
|
+
detectionRisk: initialContext.detectionRisk || 'low',
|
|
112
|
+
};
|
|
113
|
+
this.verificationConfig = {
|
|
114
|
+
methods: verificationConfig?.methods || [
|
|
115
|
+
'output_parsing',
|
|
116
|
+
'state_validation',
|
|
117
|
+
'behavioral_check',
|
|
118
|
+
'response_validation',
|
|
119
|
+
],
|
|
120
|
+
minConfidence: verificationConfig?.minConfidence || 0.75,
|
|
121
|
+
maxRetries: verificationConfig?.maxRetries || 3,
|
|
122
|
+
retryStrategies: verificationConfig?.retryStrategies || DEFAULT_RETRY_STRATEGIES,
|
|
123
|
+
timeout: verificationConfig?.timeout || 60000,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Execute an offensive security action with autonomous verification
|
|
128
|
+
*/
|
|
129
|
+
async executeWithVerification(run, action) {
|
|
130
|
+
let retryAttempt = 0;
|
|
131
|
+
let bestResult = null;
|
|
132
|
+
let bestConfidence = 0;
|
|
133
|
+
while (retryAttempt < this.verificationConfig.maxRetries) {
|
|
134
|
+
const startTime = Date.now();
|
|
135
|
+
// Get command (possibly modified by retry strategy)
|
|
136
|
+
const command = this.getCommandForAttempt(action, retryAttempt);
|
|
137
|
+
// Execute command
|
|
138
|
+
const { output, exitCode } = await this.executeCommand(command, this.verificationConfig.timeout);
|
|
139
|
+
// Extract context from output
|
|
140
|
+
const executionContext = this.extractContextFromOutput(output, action.category);
|
|
141
|
+
// Run autonomous verification
|
|
142
|
+
const verification = await autonomousVerification.verify('offensive-security', action.command, output, {
|
|
143
|
+
...this.context,
|
|
144
|
+
...executionContext,
|
|
145
|
+
exitCode,
|
|
146
|
+
category: action.category,
|
|
147
|
+
});
|
|
148
|
+
const executionTimeMs = Date.now() - startTime;
|
|
149
|
+
// Determine outcome based on verification
|
|
150
|
+
const finalOutcome = this.determineOutcome(verification, exitCode, output);
|
|
151
|
+
const result = {
|
|
152
|
+
actionId: action.id,
|
|
153
|
+
command,
|
|
154
|
+
output,
|
|
155
|
+
exitCode,
|
|
156
|
+
verification,
|
|
157
|
+
retryAttempt,
|
|
158
|
+
finalOutcome,
|
|
159
|
+
confidence: verification.confidence,
|
|
160
|
+
executionTimeMs,
|
|
161
|
+
};
|
|
162
|
+
// Track best result
|
|
163
|
+
if (verification.confidence > bestConfidence) {
|
|
164
|
+
bestConfidence = verification.confidence;
|
|
165
|
+
bestResult = result;
|
|
166
|
+
}
|
|
167
|
+
// If we have strong confirmation of success, stop retrying
|
|
168
|
+
if (verification.approved && verification.confidence >= this.verificationConfig.minConfidence) {
|
|
169
|
+
// Update context with discoveries
|
|
170
|
+
this.updateContextFromResult(result);
|
|
171
|
+
// Record outcome in the run
|
|
172
|
+
recordOffsecOutcome(run.id, action.id, finalOutcome, this.formatResultNote(result));
|
|
173
|
+
return result;
|
|
174
|
+
}
|
|
175
|
+
// If detected, stop immediately
|
|
176
|
+
if (finalOutcome === 'detected') {
|
|
177
|
+
recordOffsecOutcome(run.id, action.id, finalOutcome, this.formatResultNote(result));
|
|
178
|
+
return result;
|
|
179
|
+
}
|
|
180
|
+
retryAttempt++;
|
|
181
|
+
}
|
|
182
|
+
// All retries exhausted, use best result
|
|
183
|
+
if (!bestResult) {
|
|
184
|
+
throw new Error('No execution results available');
|
|
185
|
+
}
|
|
186
|
+
// Record the best outcome
|
|
187
|
+
recordOffsecOutcome(run.id, action.id, bestResult.finalOutcome, this.formatResultNote(bestResult));
|
|
188
|
+
return bestResult;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Get command for a specific retry attempt
|
|
192
|
+
*/
|
|
193
|
+
getCommandForAttempt(action, attempt) {
|
|
194
|
+
if (attempt === 0) {
|
|
195
|
+
return action.command;
|
|
196
|
+
}
|
|
197
|
+
// Apply retry strategies
|
|
198
|
+
const applicableStrategies = this.verificationConfig.retryStrategies.filter((s) => s.applicableCategories.includes(action.category));
|
|
199
|
+
if (applicableStrategies.length === 0) {
|
|
200
|
+
return action.command;
|
|
201
|
+
}
|
|
202
|
+
// Use a different strategy for each attempt
|
|
203
|
+
const strategy = applicableStrategies[(attempt - 1) % applicableStrategies.length];
|
|
204
|
+
if (!strategy) {
|
|
205
|
+
return action.command;
|
|
206
|
+
}
|
|
207
|
+
return strategy.modifyCommand(action.command, attempt);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Execute a shell command with timeout
|
|
211
|
+
*/
|
|
212
|
+
async executeCommand(command, timeout) {
|
|
213
|
+
return new Promise((resolve, reject) => {
|
|
214
|
+
const child = spawn(command, { shell: true });
|
|
215
|
+
let output = '';
|
|
216
|
+
let timedOut = false;
|
|
217
|
+
const timer = setTimeout(() => {
|
|
218
|
+
timedOut = true;
|
|
219
|
+
child.kill('SIGTERM');
|
|
220
|
+
resolve({ output: output + '\n[TIMEOUT]', exitCode: 124 });
|
|
221
|
+
}, timeout);
|
|
222
|
+
child.stdout?.on('data', (data) => {
|
|
223
|
+
output += data.toString();
|
|
224
|
+
});
|
|
225
|
+
child.stderr?.on('data', (data) => {
|
|
226
|
+
output += data.toString();
|
|
227
|
+
});
|
|
228
|
+
child.on('close', (code) => {
|
|
229
|
+
clearTimeout(timer);
|
|
230
|
+
if (!timedOut) {
|
|
231
|
+
resolve({ output, exitCode: code || 0 });
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
child.on('error', (error) => {
|
|
235
|
+
clearTimeout(timer);
|
|
236
|
+
reject(error);
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Extract context information from command output
|
|
242
|
+
*/
|
|
243
|
+
extractContextFromOutput(output, category) {
|
|
244
|
+
const context = {
|
|
245
|
+
states: [],
|
|
246
|
+
};
|
|
247
|
+
// Extract based on category
|
|
248
|
+
switch (category) {
|
|
249
|
+
case 'recon':
|
|
250
|
+
// Look for open ports
|
|
251
|
+
const portMatches = output.match(/(\d+)\/tcp\s+open/gi);
|
|
252
|
+
if (portMatches) {
|
|
253
|
+
context.states.push('ports_discovered');
|
|
254
|
+
context.discoveredPorts = portMatches
|
|
255
|
+
.map((m) => m.match(/\d+/)?.[0])
|
|
256
|
+
.filter((value) => Boolean(value));
|
|
257
|
+
}
|
|
258
|
+
break;
|
|
259
|
+
case 'web':
|
|
260
|
+
// Look for interesting endpoints
|
|
261
|
+
if (output.match(/200|301|302/)) {
|
|
262
|
+
context.states.push('endpoints_found');
|
|
263
|
+
}
|
|
264
|
+
break;
|
|
265
|
+
case 'creds':
|
|
266
|
+
// Look for credentials
|
|
267
|
+
if (output.match(/password|token|key|secret/i)) {
|
|
268
|
+
context.states.push('new_credentials');
|
|
269
|
+
}
|
|
270
|
+
break;
|
|
271
|
+
case 'payload':
|
|
272
|
+
// Look for successful exploitation
|
|
273
|
+
if (output.match(/shell|uid=|gid=|root|admin/i)) {
|
|
274
|
+
context.states.push('new_access');
|
|
275
|
+
context.states.push('shell_obtained');
|
|
276
|
+
}
|
|
277
|
+
break;
|
|
278
|
+
case 'lateral':
|
|
279
|
+
// Look for successful lateral movement
|
|
280
|
+
if (output.match(/logged in|authenticated|connected/i)) {
|
|
281
|
+
context.states.push('new_access');
|
|
282
|
+
}
|
|
283
|
+
break;
|
|
284
|
+
case 'privilege':
|
|
285
|
+
// Look for privilege escalation
|
|
286
|
+
if (output.match(/root|administrator|SYSTEM/i)) {
|
|
287
|
+
context.states.push('privilege_escalated');
|
|
288
|
+
}
|
|
289
|
+
break;
|
|
290
|
+
case 'cloud':
|
|
291
|
+
// Look for cloud metadata access
|
|
292
|
+
if (output.match(/ami-|AccessKeyId|SecretAccessKey/i)) {
|
|
293
|
+
context.states.push('cloud_metadata_accessed');
|
|
294
|
+
}
|
|
295
|
+
break;
|
|
296
|
+
}
|
|
297
|
+
return context;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Determine outcome from verification result
|
|
301
|
+
*/
|
|
302
|
+
determineOutcome(verification, exitCode, output) {
|
|
303
|
+
// Check for detection indicators
|
|
304
|
+
const detectionPatterns = [
|
|
305
|
+
/blocked|banned|firewall|WAF/i,
|
|
306
|
+
/rate.?limit|too many requests/i,
|
|
307
|
+
/suspicious.?activity/i,
|
|
308
|
+
/blacklist/i,
|
|
309
|
+
];
|
|
310
|
+
const isDetected = detectionPatterns.some((pattern) => pattern.test(output));
|
|
311
|
+
if (isDetected) {
|
|
312
|
+
return 'detected';
|
|
313
|
+
}
|
|
314
|
+
// If verification approved with high confidence, it's a success
|
|
315
|
+
if (verification.approved && verification.confidence >= this.verificationConfig.minConfidence) {
|
|
316
|
+
return 'success';
|
|
317
|
+
}
|
|
318
|
+
// If verification confidence is moderate, treat as success with note
|
|
319
|
+
if (verification.confidence >= 0.5) {
|
|
320
|
+
return 'success';
|
|
321
|
+
}
|
|
322
|
+
// Otherwise it's a failure
|
|
323
|
+
return 'fail';
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Update internal context based on execution result
|
|
327
|
+
*/
|
|
328
|
+
updateContextFromResult(result) {
|
|
329
|
+
this.context.previousOutputs.push(result.output);
|
|
330
|
+
// Extract and store credentials
|
|
331
|
+
const credMatches = result.output.match(/(?:password|token|key)[:=]\s*(\S+)/gi);
|
|
332
|
+
if (credMatches) {
|
|
333
|
+
this.context.discoveredCredentials.push(...credMatches);
|
|
334
|
+
}
|
|
335
|
+
// Extract and store discovered hosts
|
|
336
|
+
const hostMatches = result.output.match(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/g);
|
|
337
|
+
if (hostMatches) {
|
|
338
|
+
this.context.discoveredHosts.push(...hostMatches);
|
|
339
|
+
}
|
|
340
|
+
// Update privilege level
|
|
341
|
+
if (result.output.match(/root|administrator|SYSTEM/i)) {
|
|
342
|
+
this.context.currentPrivilegeLevel = 'root';
|
|
343
|
+
}
|
|
344
|
+
else if (result.output.match(/admin/i)) {
|
|
345
|
+
this.context.currentPrivilegeLevel = 'admin';
|
|
346
|
+
}
|
|
347
|
+
else if (result.output.match(/uid=/i)) {
|
|
348
|
+
this.context.currentPrivilegeLevel = 'user';
|
|
349
|
+
}
|
|
350
|
+
// Adjust detection risk
|
|
351
|
+
if (result.finalOutcome === 'detected') {
|
|
352
|
+
this.context.detectionRisk = 'high';
|
|
353
|
+
}
|
|
354
|
+
else if (result.verification.confidence < 0.5) {
|
|
355
|
+
this.context.detectionRisk = this.context.detectionRisk === 'low' ? 'medium' : 'high';
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Format result as a note for storage
|
|
360
|
+
*/
|
|
361
|
+
formatResultNote(result) {
|
|
362
|
+
const lines = [];
|
|
363
|
+
lines.push(`Confidence: ${(result.confidence * 100).toFixed(1)}%`);
|
|
364
|
+
lines.push(`Verification: ${result.verification.reason}`);
|
|
365
|
+
lines.push(`Attempts: ${result.retryAttempt + 1}`);
|
|
366
|
+
lines.push(`Time: ${result.executionTimeMs}ms`);
|
|
367
|
+
if (result.verification.results.length > 0) {
|
|
368
|
+
lines.push('Checks:');
|
|
369
|
+
for (const check of result.verification.results) {
|
|
370
|
+
lines.push(` - ${check.method}: ${check.passed ? '✓' : '✗'} (${(check.confidence * 100).toFixed(0)}%)`);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return lines.join('\n');
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Execute a full offensive security run with autonomous verification
|
|
377
|
+
*/
|
|
378
|
+
async executeAutonomousRun(objective, scope, maxActions = 10) {
|
|
379
|
+
// Start or resume run
|
|
380
|
+
const run = startOffsecRun(objective, scope);
|
|
381
|
+
let actionsExecuted = 0;
|
|
382
|
+
while (actionsExecuted < maxActions) {
|
|
383
|
+
// Get next action
|
|
384
|
+
const nextActions = getOffsecNextActions(run.id, 1);
|
|
385
|
+
if (nextActions.length === 0) {
|
|
386
|
+
console.log('No more actions available');
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
const nextAction = nextActions[0];
|
|
390
|
+
if (!nextAction) {
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
console.log(`Executing: ${nextAction.label}`);
|
|
394
|
+
console.log(`Command: ${nextAction.command}`);
|
|
395
|
+
try {
|
|
396
|
+
// Execute with verification
|
|
397
|
+
const result = await this.executeWithVerification(run, nextAction);
|
|
398
|
+
console.log(`Result: ${result.finalOutcome} (confidence: ${(result.confidence * 100).toFixed(1)}%)`);
|
|
399
|
+
// Stop if detected
|
|
400
|
+
if (result.finalOutcome === 'detected') {
|
|
401
|
+
console.log('Detected! Stopping autonomous run.');
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
actionsExecuted++;
|
|
405
|
+
}
|
|
406
|
+
catch (error) {
|
|
407
|
+
console.error(`Error executing action: ${error instanceof Error ? error.message : String(error)}`);
|
|
408
|
+
recordOffsecOutcome(run.id, nextAction.id, 'fail', `Error: ${error}`);
|
|
409
|
+
actionsExecuted++;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
return run;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Get current context
|
|
416
|
+
*/
|
|
417
|
+
getContext() {
|
|
418
|
+
return { ...this.context };
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Update context
|
|
422
|
+
*/
|
|
423
|
+
updateContext(updates) {
|
|
424
|
+
this.context = { ...this.context, ...updates };
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Convenience function to execute an action with verification
|
|
429
|
+
*/
|
|
430
|
+
export async function executeOffsecActionWithVerification(run, actionId, context) {
|
|
431
|
+
const coordinator = new OffsecAlphaZeroEnhanced(context);
|
|
432
|
+
const actions = getOffsecNextActions(run.id, 100);
|
|
433
|
+
const action = actions.find((a) => a.id === actionId);
|
|
434
|
+
if (!action) {
|
|
435
|
+
throw new Error(`Action ${actionId} not found`);
|
|
436
|
+
}
|
|
437
|
+
return coordinator.executeWithVerification(run, action);
|
|
438
|
+
}
|
|
439
|
+
// Re-export for convenience
|
|
440
|
+
export { startOffsecRun, resumeOffsecRun, listOffsecRuns, getOffsecNextActions, formatOffsecStatus, };
|
|
441
|
+
//# sourceMappingURL=offsecAlphaZeroEnhanced.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offsecAlphaZeroEnhanced.js","sourceRoot":"","sources":["../../src/core/offsecAlphaZeroEnhanced.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAML,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,sBAAsB,GAGvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;A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Ac,EACd,QAAgB,EAChB,OAAsC;IAEtC,MAAM,WAAW,GAAG,IAAI,uBAAuB,CAAC,OAAO,CAAC,CAAC;IACzD,MAAM,OAAO,GAAG,oBAAoB,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC;IAEtD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,UAAU,QAAQ,YAAY,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,WAAW,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAC1D,CAAC;AAED,4BAA4B;AAC5B,OAAO,EACL,cAAc,EACd,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,kBAAkB,GACnB,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context-Aware Parallel Agent Orchestrator
|
|
3
|
+
*
|
|
4
|
+
* Manages multiple agents running in parallel while optimizing for:
|
|
5
|
+
* - Model context limits
|
|
6
|
+
* - Token budget management
|
|
7
|
+
* - Auto-compaction before spawning
|
|
8
|
+
* - Result aggregation and conflict resolution
|
|
9
|
+
* - Dependency graph analysis for optimal parallelization
|
|
10
|
+
*/
|
|
11
|
+
import { ContextManager } from './contextManager.js';
|
|
12
|
+
import { VerificationOutcome } from './autonomousVerification.js';
|
|
13
|
+
export type AgentStatus = 'pending' | 'running' | 'completed' | 'failed' | 'blocked';
|
|
14
|
+
export interface AgentTask {
|
|
15
|
+
id: string;
|
|
16
|
+
description: string;
|
|
17
|
+
type: 'exploration' | 'implementation' | 'verification' | 'testing' | 'security';
|
|
18
|
+
priority: number;
|
|
19
|
+
estimatedTokens: number;
|
|
20
|
+
dependencies: string[];
|
|
21
|
+
requiredArtifacts: string[];
|
|
22
|
+
producedArtifacts: string[];
|
|
23
|
+
timeout: number;
|
|
24
|
+
retryable: boolean;
|
|
25
|
+
maxRetries: number;
|
|
26
|
+
}
|
|
27
|
+
export interface AgentInstance {
|
|
28
|
+
taskId: string;
|
|
29
|
+
agentId: string;
|
|
30
|
+
status: AgentStatus;
|
|
31
|
+
startTime: number;
|
|
32
|
+
endTime?: number;
|
|
33
|
+
tokenUsage: number;
|
|
34
|
+
result?: AgentResult;
|
|
35
|
+
error?: string;
|
|
36
|
+
retryCount: number;
|
|
37
|
+
}
|
|
38
|
+
export interface AgentResult {
|
|
39
|
+
success: boolean;
|
|
40
|
+
output: string;
|
|
41
|
+
artifacts: Record<string, any>;
|
|
42
|
+
metrics: {
|
|
43
|
+
tokensUsed: number;
|
|
44
|
+
executionTimeMs: number;
|
|
45
|
+
toolCalls: number;
|
|
46
|
+
};
|
|
47
|
+
verification?: VerificationOutcome;
|
|
48
|
+
conflicts?: Conflict[];
|
|
49
|
+
}
|
|
50
|
+
export interface Conflict {
|
|
51
|
+
type: 'file_modification' | 'data_inconsistency' | 'resource_contention';
|
|
52
|
+
description: string;
|
|
53
|
+
severity: 'low' | 'medium' | 'high';
|
|
54
|
+
affectedAgents: string[];
|
|
55
|
+
resolution?: ConflictResolution;
|
|
56
|
+
}
|
|
57
|
+
export interface ConflictResolution {
|
|
58
|
+
strategy: 'accept_first' | 'accept_last' | 'merge' | 'manual_review' | 'retry';
|
|
59
|
+
resolvedBy: string;
|
|
60
|
+
details: string;
|
|
61
|
+
}
|
|
62
|
+
export interface TokenBudget {
|
|
63
|
+
total: number;
|
|
64
|
+
reserved: number;
|
|
65
|
+
available: number;
|
|
66
|
+
allocated: number;
|
|
67
|
+
consumed: number;
|
|
68
|
+
}
|
|
69
|
+
export interface DependencyGraph {
|
|
70
|
+
nodes: Map<string, AgentTask>;
|
|
71
|
+
edges: Map<string, string[]>;
|
|
72
|
+
levels: string[][];
|
|
73
|
+
}
|
|
74
|
+
export interface ParallelExecutionPlan {
|
|
75
|
+
waves: AgentTask[][];
|
|
76
|
+
estimatedTotalTokens: number;
|
|
77
|
+
estimatedTotalTimeMs: number;
|
|
78
|
+
criticalPath: string[];
|
|
79
|
+
}
|
|
80
|
+
export declare class ParallelAgentOrchestrator {
|
|
81
|
+
private contextManager;
|
|
82
|
+
private verificationEngine;
|
|
83
|
+
private tokenBudget;
|
|
84
|
+
private tasks;
|
|
85
|
+
private agents;
|
|
86
|
+
private maxConcurrentAgents;
|
|
87
|
+
private autoCompactionEnabled;
|
|
88
|
+
private compactionThreshold;
|
|
89
|
+
constructor(contextManager: ContextManager, config?: {
|
|
90
|
+
totalTokens?: number;
|
|
91
|
+
maxConcurrentAgents?: number;
|
|
92
|
+
autoCompactionEnabled?: boolean;
|
|
93
|
+
compactionThreshold?: number;
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* Add a task to the orchestrator
|
|
97
|
+
*/
|
|
98
|
+
addTask(task: AgentTask): void;
|
|
99
|
+
/**
|
|
100
|
+
* Add multiple tasks
|
|
101
|
+
*/
|
|
102
|
+
addTasks(tasks: AgentTask[]): void;
|
|
103
|
+
/**
|
|
104
|
+
* Build dependency graph from tasks
|
|
105
|
+
*/
|
|
106
|
+
buildDependencyGraph(): DependencyGraph;
|
|
107
|
+
/**
|
|
108
|
+
* Create an execution plan that optimizes for parallelism and token budget
|
|
109
|
+
*/
|
|
110
|
+
createExecutionPlan(): ParallelExecutionPlan;
|
|
111
|
+
/**
|
|
112
|
+
* Find the critical path (longest dependency chain)
|
|
113
|
+
*/
|
|
114
|
+
private findCriticalPath;
|
|
115
|
+
/**
|
|
116
|
+
* Execute tasks according to the plan
|
|
117
|
+
*/
|
|
118
|
+
executePlan(plan?: ParallelExecutionPlan): Promise<Map<string, AgentResult>>;
|
|
119
|
+
/**
|
|
120
|
+
* Check if compaction is needed and perform it
|
|
121
|
+
*/
|
|
122
|
+
private checkAndCompact;
|
|
123
|
+
/**
|
|
124
|
+
* Execute a wave of tasks in parallel
|
|
125
|
+
*/
|
|
126
|
+
private executeWave;
|
|
127
|
+
/**
|
|
128
|
+
* Execute a single task
|
|
129
|
+
*/
|
|
130
|
+
private executeTask;
|
|
131
|
+
/**
|
|
132
|
+
* Execute the actual agent task (placeholder for integration with agent system)
|
|
133
|
+
*/
|
|
134
|
+
private executeAgentTask;
|
|
135
|
+
/**
|
|
136
|
+
* Detect conflicts between parallel agents
|
|
137
|
+
*/
|
|
138
|
+
private detectConflicts;
|
|
139
|
+
/**
|
|
140
|
+
* Resolve conflicts between agents
|
|
141
|
+
*/
|
|
142
|
+
private resolveConflicts;
|
|
143
|
+
/**
|
|
144
|
+
* Get current token budget status
|
|
145
|
+
*/
|
|
146
|
+
getTokenBudget(): TokenBudget;
|
|
147
|
+
/**
|
|
148
|
+
* Get all running agents
|
|
149
|
+
*/
|
|
150
|
+
getRunningAgents(): AgentInstance[];
|
|
151
|
+
/**
|
|
152
|
+
* Get agent by ID
|
|
153
|
+
*/
|
|
154
|
+
getAgent(agentId: string): AgentInstance | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* Cancel a running agent
|
|
157
|
+
*/
|
|
158
|
+
cancelAgent(agentId: string): Promise<void>;
|
|
159
|
+
/**
|
|
160
|
+
* Get execution summary
|
|
161
|
+
*/
|
|
162
|
+
getSummary(): {
|
|
163
|
+
totalTasks: number;
|
|
164
|
+
completed: number;
|
|
165
|
+
failed: number;
|
|
166
|
+
running: number;
|
|
167
|
+
pending: number;
|
|
168
|
+
tokenUsage: TokenBudget;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=parallelAgentOrchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelAgentOrchestrator.d.ts","sourceRoot":"","sources":["../../src/core/parallelAgentOrchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAgC,mBAAmB,EAA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