erosolar-cli 2.1.282 → 2.1.284
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/core/unifiedOrchestrator.d.ts +108 -5
- package/dist/core/unifiedOrchestrator.d.ts.map +1 -1
- package/dist/core/unifiedOrchestrator.js +319 -23
- package/dist/core/unifiedOrchestrator.js.map +1 -1
- package/dist/shell/interactiveShell.d.ts +1 -0
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +57 -8
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/tools/tao/rl.d.ts.map +1 -1
- package/dist/tools/tao/rl.js +2 -1
- package/dist/tools/tao/rl.js.map +1 -1
- package/dist/ui/orchestration/OrchestrationUIBridge.d.ts +199 -0
- package/dist/ui/orchestration/OrchestrationUIBridge.d.ts.map +1 -0
- package/dist/ui/orchestration/OrchestrationUIBridge.js +681 -0
- package/dist/ui/orchestration/OrchestrationUIBridge.js.map +1 -0
- package/dist/ui/orchestration/StatusOrchestrator.d.ts +33 -0
- package/dist/ui/orchestration/StatusOrchestrator.d.ts.map +1 -1
- package/dist/ui/orchestration/StatusOrchestrator.js +136 -6
- package/dist/ui/orchestration/StatusOrchestrator.js.map +1 -1
- package/dist/ui/orchestration/index.d.ts +18 -0
- package/dist/ui/orchestration/index.d.ts.map +1 -0
- package/dist/ui/orchestration/index.js +21 -0
- package/dist/ui/orchestration/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -15,7 +15,71 @@
|
|
|
15
15
|
* - Analysis: Code quality, performance, patterns
|
|
16
16
|
* - Git: Status, commits, branches, diffs
|
|
17
17
|
*/
|
|
18
|
+
import { EventEmitter } from 'node:events';
|
|
18
19
|
import * as fs from 'fs';
|
|
20
|
+
/**
|
|
21
|
+
* Event types mirror Claude Code's internal structure:
|
|
22
|
+
* - tool:* events for tool execution lifecycle
|
|
23
|
+
* - thinking:* events for reasoning display
|
|
24
|
+
* - phase:* events for orchestration phases
|
|
25
|
+
* - finding:* events for security/analysis findings
|
|
26
|
+
* - progress:* events for overall progress tracking
|
|
27
|
+
*/
|
|
28
|
+
export type OrchestratorEventType = 'tool:start' | 'tool:progress' | 'tool:complete' | 'tool:error' | 'thinking:start' | 'thinking:chunk' | 'thinking:end' | 'phase:change' | 'phase:complete' | 'finding:detected' | 'finding:resolved' | 'progress:update' | 'progress:summary' | 'command:start' | 'command:complete' | 'command:error';
|
|
29
|
+
export interface OrchestratorEvent {
|
|
30
|
+
type: OrchestratorEventType;
|
|
31
|
+
timestamp: number;
|
|
32
|
+
data: unknown;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Tool execution event - Claude Code style
|
|
36
|
+
* Rendered as: ⏺ [tool_name] description
|
|
37
|
+
* ⎿ result/output
|
|
38
|
+
*/
|
|
39
|
+
export interface ToolStartEvent {
|
|
40
|
+
toolId: string;
|
|
41
|
+
toolName: string;
|
|
42
|
+
description: string;
|
|
43
|
+
index: number;
|
|
44
|
+
total?: number;
|
|
45
|
+
args?: Record<string, unknown>;
|
|
46
|
+
}
|
|
47
|
+
export interface ToolProgressEvent {
|
|
48
|
+
toolId: string;
|
|
49
|
+
toolName: string;
|
|
50
|
+
output: string;
|
|
51
|
+
progress?: {
|
|
52
|
+
current: number;
|
|
53
|
+
total: number;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export interface ToolCompleteEvent {
|
|
57
|
+
toolId: string;
|
|
58
|
+
toolName: string;
|
|
59
|
+
success: boolean;
|
|
60
|
+
output: string;
|
|
61
|
+
duration: number;
|
|
62
|
+
exitCode?: number;
|
|
63
|
+
}
|
|
64
|
+
export interface CommandStartEvent {
|
|
65
|
+
command: string;
|
|
66
|
+
index: number;
|
|
67
|
+
total?: number;
|
|
68
|
+
}
|
|
69
|
+
export interface CommandCompleteEvent {
|
|
70
|
+
command: string;
|
|
71
|
+
result: ExecutionResult;
|
|
72
|
+
duration: number;
|
|
73
|
+
}
|
|
74
|
+
export interface PhaseChangeEvent {
|
|
75
|
+
phase: string;
|
|
76
|
+
objective: string;
|
|
77
|
+
description?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface ThinkingEvent {
|
|
80
|
+
content: string;
|
|
81
|
+
isComplete?: boolean;
|
|
82
|
+
}
|
|
19
83
|
export interface ExecutionResult {
|
|
20
84
|
success: boolean;
|
|
21
85
|
output: string;
|
|
@@ -78,14 +142,41 @@ export interface Task {
|
|
|
78
142
|
timeout?: number;
|
|
79
143
|
optional?: boolean;
|
|
80
144
|
}
|
|
81
|
-
export declare class UnifiedOrchestrator {
|
|
145
|
+
export declare class UnifiedOrchestrator extends EventEmitter {
|
|
82
146
|
private workingDir;
|
|
83
147
|
private results;
|
|
84
148
|
private findings;
|
|
85
149
|
private backgroundProcesses;
|
|
150
|
+
private commandIndex;
|
|
151
|
+
private currentPhase;
|
|
152
|
+
private currentObjective;
|
|
86
153
|
constructor(workingDir?: string);
|
|
87
|
-
/**
|
|
154
|
+
/** Emit an orchestrator event */
|
|
155
|
+
private emitOrchestratorEvent;
|
|
156
|
+
/** Set current phase and emit event */
|
|
157
|
+
private setPhase;
|
|
158
|
+
/** Subscribe to all orchestrator events */
|
|
159
|
+
onEvent(callback: (event: OrchestratorEvent) => void): () => void;
|
|
160
|
+
/** Subscribe to command events */
|
|
161
|
+
onCommand(callback: (event: OrchestratorEvent) => void): () => void;
|
|
162
|
+
/** Subscribe to finding events */
|
|
163
|
+
onFinding(callback: (finding: Finding) => void): () => void;
|
|
164
|
+
/** Get current execution phase */
|
|
165
|
+
getPhase(): string;
|
|
166
|
+
/** Get current objective */
|
|
167
|
+
getObjective(): string;
|
|
168
|
+
/**
|
|
169
|
+
* Execute a shell command with Claude Code-style event emission.
|
|
170
|
+
* Events are emitted in the tool lifecycle pattern:
|
|
171
|
+
* - tool:start -> tool:progress (optional) -> tool:complete/tool:error
|
|
172
|
+
*/
|
|
88
173
|
exec(command: string, timeout?: number): ExecutionResult;
|
|
174
|
+
/** Infer a tool name from the command for Claude Code-style display */
|
|
175
|
+
private inferToolName;
|
|
176
|
+
/** Generate a human-readable description for the command */
|
|
177
|
+
private describeCommand;
|
|
178
|
+
/** Truncate output for display in events */
|
|
179
|
+
private truncateOutput;
|
|
89
180
|
/** Execute multiple commands sequentially */
|
|
90
181
|
execMany(commands: string[], timeout?: number): ExecutionResult[];
|
|
91
182
|
/** Execute multiple commands in parallel */
|
|
@@ -201,20 +292,32 @@ export declare class UnifiedOrchestrator {
|
|
|
201
292
|
/** Get environment variables */
|
|
202
293
|
getEnv(key?: string): string | Record<string, string | undefined>;
|
|
203
294
|
/** Analyze output and extract findings */
|
|
204
|
-
analyze(output: string,
|
|
205
|
-
/** Add a custom finding */
|
|
295
|
+
analyze(output: string, _context?: string): Finding[];
|
|
296
|
+
/** Add a custom finding with event emission */
|
|
206
297
|
addFinding(finding: Finding): void;
|
|
207
298
|
/** Get all findings */
|
|
208
299
|
getFindings(): Finding[];
|
|
209
300
|
/** Get all results */
|
|
210
301
|
getResults(): ExecutionResult[];
|
|
211
|
-
/** Reset state */
|
|
302
|
+
/** Reset state for new operation */
|
|
212
303
|
reset(): void;
|
|
304
|
+
/**
|
|
305
|
+
* Collapse duplicate findings into a single entry while preserving useful evidence.
|
|
306
|
+
*/
|
|
307
|
+
private dedupeFindings;
|
|
308
|
+
private buildFindingKey;
|
|
309
|
+
private mergeEvidence;
|
|
310
|
+
/**
|
|
311
|
+
* Derive a consistent completion reason so the UI can present concise guidance.
|
|
312
|
+
*/
|
|
313
|
+
private determineExitReason;
|
|
314
|
+
private buildStatusSummary;
|
|
213
315
|
/** Generate comprehensive report */
|
|
214
316
|
generateReport(objective?: string): OperationReport;
|
|
215
317
|
/**
|
|
216
318
|
* Execute operations based on objective analysis.
|
|
217
319
|
* Automatically selects and runs appropriate tools based on the objective.
|
|
320
|
+
* Emits real-time events for UI integration.
|
|
218
321
|
*/
|
|
219
322
|
execute(config: OperationConfig): Promise<OperationReport>;
|
|
220
323
|
/** Check if objective matches any of the intent keywords */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unifiedOrchestrator.d.ts","sourceRoot":"","sources":["../../src/core/unifiedOrchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AASzB,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IAEjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,WAAW,CAAC,EAAE,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AO,MAAM,aAAa,GAAI,MAAM,MAAM,sBAAiD,CAAC;AAC5F,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,EAAE,MAAM,MAAM,sBAAuD,CAAC;AACnH,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,EAAE,QAAQ,OAAO,GAAG,QAAQ,GAAG,MAAM,EAAE,MAAM,MAAM,sBAA4D,CAAC;AAG1J,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,oBAQ3C,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,oBAQxC,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,oBAOzC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,oBAU7C,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,SAAS,MAAM,EAAE,MAAM,MAAM,oBAWpD,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,oBASpC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,EAAE,MAAM,MAAM,oBAQzD,CAAC;AAGF,eAAO,MAAM,GAAG,GAAI,WAAW,MAAM,EAAE,UAAU,OAAO,CAAC,eAAe,CAAC,6BAA0F,CAAC;AACpK,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,6BAAkE,CAAC"}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* - Git: Status, commits, branches, diffs
|
|
17
17
|
*/
|
|
18
18
|
import { execSync, spawn } from 'child_process';
|
|
19
|
+
import { EventEmitter } from 'node:events';
|
|
19
20
|
import * as fs from 'fs';
|
|
20
21
|
import * as path from 'path';
|
|
21
22
|
import * as crypto from 'crypto';
|
|
@@ -23,20 +24,100 @@ import * as os from 'os';
|
|
|
23
24
|
// ============================================================================
|
|
24
25
|
// UNIFIED ORCHESTRATOR - Comprehensive Tool Set
|
|
25
26
|
// ============================================================================
|
|
26
|
-
export class UnifiedOrchestrator {
|
|
27
|
+
export class UnifiedOrchestrator extends EventEmitter {
|
|
27
28
|
workingDir;
|
|
28
29
|
results = [];
|
|
29
30
|
findings = [];
|
|
30
31
|
backgroundProcesses = new Map();
|
|
32
|
+
commandIndex = 0;
|
|
33
|
+
currentPhase = 'idle';
|
|
34
|
+
currentObjective = '';
|
|
31
35
|
constructor(workingDir) {
|
|
36
|
+
super();
|
|
32
37
|
this.workingDir = workingDir || process.cwd();
|
|
33
38
|
}
|
|
34
39
|
// ==========================================================================
|
|
40
|
+
// EVENT EMISSION - For UI integration
|
|
41
|
+
// ==========================================================================
|
|
42
|
+
/** Emit an orchestrator event */
|
|
43
|
+
emitOrchestratorEvent(type, data) {
|
|
44
|
+
const event = {
|
|
45
|
+
type,
|
|
46
|
+
timestamp: Date.now(),
|
|
47
|
+
data,
|
|
48
|
+
};
|
|
49
|
+
this.emit(type, event);
|
|
50
|
+
this.emit('orchestrator:event', event);
|
|
51
|
+
}
|
|
52
|
+
/** Set current phase and emit event */
|
|
53
|
+
setPhase(phase) {
|
|
54
|
+
this.currentPhase = phase;
|
|
55
|
+
this.emitOrchestratorEvent('phase:change', {
|
|
56
|
+
phase,
|
|
57
|
+
objective: this.currentObjective,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/** Subscribe to all orchestrator events */
|
|
61
|
+
onEvent(callback) {
|
|
62
|
+
this.on('orchestrator:event', callback);
|
|
63
|
+
return () => this.off('orchestrator:event', callback);
|
|
64
|
+
}
|
|
65
|
+
/** Subscribe to command events */
|
|
66
|
+
onCommand(callback) {
|
|
67
|
+
const handler = (event) => {
|
|
68
|
+
if (event.type.startsWith('command:')) {
|
|
69
|
+
callback(event);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
this.on('orchestrator:event', handler);
|
|
73
|
+
return () => this.off('orchestrator:event', handler);
|
|
74
|
+
}
|
|
75
|
+
/** Subscribe to finding events */
|
|
76
|
+
onFinding(callback) {
|
|
77
|
+
const handler = (event) => {
|
|
78
|
+
if (event.type === 'finding:detected') {
|
|
79
|
+
callback(event.data);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
this.on('orchestrator:event', handler);
|
|
83
|
+
return () => this.off('orchestrator:event', handler);
|
|
84
|
+
}
|
|
85
|
+
/** Get current execution phase */
|
|
86
|
+
getPhase() {
|
|
87
|
+
return this.currentPhase;
|
|
88
|
+
}
|
|
89
|
+
/** Get current objective */
|
|
90
|
+
getObjective() {
|
|
91
|
+
return this.currentObjective;
|
|
92
|
+
}
|
|
93
|
+
// ==========================================================================
|
|
35
94
|
// CORE EXECUTION TOOLS
|
|
36
95
|
// ==========================================================================
|
|
37
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* Execute a shell command with Claude Code-style event emission.
|
|
98
|
+
* Events are emitted in the tool lifecycle pattern:
|
|
99
|
+
* - tool:start -> tool:progress (optional) -> tool:complete/tool:error
|
|
100
|
+
*/
|
|
38
101
|
exec(command, timeout = 60000) {
|
|
39
102
|
const start = Date.now();
|
|
103
|
+
this.commandIndex++;
|
|
104
|
+
const toolId = `exec-${this.commandIndex}-${Date.now()}`;
|
|
105
|
+
const toolName = this.inferToolName(command);
|
|
106
|
+
const description = this.describeCommand(command);
|
|
107
|
+
// Emit Claude Code-style tool:start event
|
|
108
|
+
this.emitOrchestratorEvent('tool:start', {
|
|
109
|
+
toolId,
|
|
110
|
+
toolName,
|
|
111
|
+
description,
|
|
112
|
+
index: this.commandIndex,
|
|
113
|
+
args: { command },
|
|
114
|
+
});
|
|
115
|
+
// Legacy event for backward compatibility
|
|
116
|
+
this.emitOrchestratorEvent('command:start', {
|
|
117
|
+
command,
|
|
118
|
+
index: this.commandIndex,
|
|
119
|
+
total: undefined,
|
|
120
|
+
});
|
|
40
121
|
try {
|
|
41
122
|
const output = execSync(command, {
|
|
42
123
|
cwd: this.workingDir,
|
|
@@ -45,18 +126,137 @@ export class UnifiedOrchestrator {
|
|
|
45
126
|
maxBuffer: 50 * 1024 * 1024,
|
|
46
127
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
47
128
|
});
|
|
48
|
-
const
|
|
129
|
+
const duration = Date.now() - start;
|
|
130
|
+
const result = { success: true, output: output || '', duration, command, exitCode: 0 };
|
|
49
131
|
this.results.push(result);
|
|
132
|
+
// Emit Claude Code-style tool:complete event
|
|
133
|
+
this.emitOrchestratorEvent('tool:complete', {
|
|
134
|
+
toolId,
|
|
135
|
+
toolName,
|
|
136
|
+
success: true,
|
|
137
|
+
output: this.truncateOutput(output || ''),
|
|
138
|
+
duration,
|
|
139
|
+
exitCode: 0,
|
|
140
|
+
});
|
|
141
|
+
// Legacy event
|
|
142
|
+
this.emitOrchestratorEvent('command:complete', {
|
|
143
|
+
command,
|
|
144
|
+
result,
|
|
145
|
+
duration,
|
|
146
|
+
});
|
|
50
147
|
return result;
|
|
51
148
|
}
|
|
52
149
|
catch (e) {
|
|
53
150
|
const err = e;
|
|
54
151
|
const output = (err.stdout || err.stderr || err.message || '');
|
|
55
|
-
const
|
|
152
|
+
const duration = Date.now() - start;
|
|
153
|
+
const result = { success: false, output, error: err.message, duration, command, exitCode: err.status };
|
|
56
154
|
this.results.push(result);
|
|
155
|
+
// Emit Claude Code-style tool:error event
|
|
156
|
+
this.emitOrchestratorEvent('tool:error', {
|
|
157
|
+
toolId,
|
|
158
|
+
toolName,
|
|
159
|
+
success: false,
|
|
160
|
+
output: this.truncateOutput(output),
|
|
161
|
+
duration,
|
|
162
|
+
exitCode: err.status,
|
|
163
|
+
});
|
|
164
|
+
// Legacy event
|
|
165
|
+
this.emitOrchestratorEvent('command:error', {
|
|
166
|
+
command,
|
|
167
|
+
result,
|
|
168
|
+
duration,
|
|
169
|
+
});
|
|
57
170
|
return result;
|
|
58
171
|
}
|
|
59
172
|
}
|
|
173
|
+
/** Infer a tool name from the command for Claude Code-style display */
|
|
174
|
+
inferToolName(command) {
|
|
175
|
+
const cmd = command.trim().split(/\s+/)[0] || 'exec';
|
|
176
|
+
const toolMap = {
|
|
177
|
+
npm: 'npm',
|
|
178
|
+
npx: 'npx',
|
|
179
|
+
node: 'node',
|
|
180
|
+
git: 'git',
|
|
181
|
+
grep: 'search',
|
|
182
|
+
find: 'find',
|
|
183
|
+
curl: 'fetch',
|
|
184
|
+
cat: 'read',
|
|
185
|
+
ls: 'list',
|
|
186
|
+
mkdir: 'mkdir',
|
|
187
|
+
rm: 'delete',
|
|
188
|
+
mv: 'move',
|
|
189
|
+
cp: 'copy',
|
|
190
|
+
docker: 'docker',
|
|
191
|
+
dig: 'dns',
|
|
192
|
+
whois: 'whois',
|
|
193
|
+
nmap: 'scan',
|
|
194
|
+
nc: 'netcat',
|
|
195
|
+
openssl: 'ssl',
|
|
196
|
+
security: 'security',
|
|
197
|
+
sqlite3: 'sqlite',
|
|
198
|
+
ps: 'processes',
|
|
199
|
+
netstat: 'network',
|
|
200
|
+
lsof: 'lsof',
|
|
201
|
+
ifconfig: 'network',
|
|
202
|
+
ip: 'network',
|
|
203
|
+
arp: 'arp',
|
|
204
|
+
crontab: 'cron',
|
|
205
|
+
host: 'dns',
|
|
206
|
+
};
|
|
207
|
+
return toolMap[cmd] || 'bash';
|
|
208
|
+
}
|
|
209
|
+
/** Generate a human-readable description for the command */
|
|
210
|
+
describeCommand(command) {
|
|
211
|
+
const trimmed = command.trim();
|
|
212
|
+
const firstWord = trimmed.split(/\s+/)[0] || '';
|
|
213
|
+
// Common patterns
|
|
214
|
+
if (trimmed.startsWith('npm run build'))
|
|
215
|
+
return 'Building project';
|
|
216
|
+
if (trimmed.startsWith('npm run lint'))
|
|
217
|
+
return 'Running linter';
|
|
218
|
+
if (trimmed.startsWith('npm test'))
|
|
219
|
+
return 'Running tests';
|
|
220
|
+
if (trimmed.startsWith('npm audit'))
|
|
221
|
+
return 'Auditing dependencies';
|
|
222
|
+
if (trimmed.startsWith('npm install'))
|
|
223
|
+
return 'Installing dependencies';
|
|
224
|
+
if (trimmed.startsWith('npx tsc'))
|
|
225
|
+
return 'Type checking';
|
|
226
|
+
if (trimmed.startsWith('npx prettier'))
|
|
227
|
+
return 'Formatting code';
|
|
228
|
+
if (trimmed.startsWith('npx eslint'))
|
|
229
|
+
return 'Linting code';
|
|
230
|
+
if (trimmed.startsWith('git status'))
|
|
231
|
+
return 'Checking git status';
|
|
232
|
+
if (trimmed.startsWith('git diff'))
|
|
233
|
+
return 'Showing git diff';
|
|
234
|
+
if (trimmed.startsWith('git log'))
|
|
235
|
+
return 'Showing git log';
|
|
236
|
+
if (trimmed.startsWith('grep'))
|
|
237
|
+
return 'Searching files';
|
|
238
|
+
if (trimmed.startsWith('find'))
|
|
239
|
+
return 'Finding files';
|
|
240
|
+
if (trimmed.startsWith('curl'))
|
|
241
|
+
return 'Fetching URL';
|
|
242
|
+
if (trimmed.startsWith('dig') || trimmed.startsWith('host'))
|
|
243
|
+
return 'DNS lookup';
|
|
244
|
+
if (trimmed.startsWith('whois'))
|
|
245
|
+
return 'WHOIS lookup';
|
|
246
|
+
if (trimmed.startsWith('openssl'))
|
|
247
|
+
return 'SSL/TLS analysis';
|
|
248
|
+
// Generic description
|
|
249
|
+
if (firstWord) {
|
|
250
|
+
return `Running ${firstWord}`;
|
|
251
|
+
}
|
|
252
|
+
return 'Executing command';
|
|
253
|
+
}
|
|
254
|
+
/** Truncate output for display in events */
|
|
255
|
+
truncateOutput(output, maxLength = 500) {
|
|
256
|
+
if (output.length <= maxLength)
|
|
257
|
+
return output;
|
|
258
|
+
return output.slice(0, maxLength - 3) + '...';
|
|
259
|
+
}
|
|
60
260
|
/** Execute multiple commands sequentially */
|
|
61
261
|
execMany(commands, timeout) {
|
|
62
262
|
return commands.map(cmd => this.exec(cmd, timeout));
|
|
@@ -181,8 +381,7 @@ export class UnifiedOrchestrator {
|
|
|
181
381
|
persistenceCheck() {
|
|
182
382
|
return this.execMany([
|
|
183
383
|
'crontab -l 2>/dev/null || echo "No crontab"',
|
|
184
|
-
'
|
|
185
|
-
'cat ~/.ssh/authorized_keys 2>/dev/null | head -10 || echo "No authorized_keys"',
|
|
384
|
+
'echo "Skipped ~/.ssh inspection (out of scope for workspace-limited run)"',
|
|
186
385
|
'ls -la /Library/LaunchDaemons 2>/dev/null | head -20',
|
|
187
386
|
'ls -la ~/Library/LaunchAgents 2>/dev/null | head -20',
|
|
188
387
|
'grep -l "curl\\|wget\\|python\\|bash" ~/.bashrc ~/.zshrc ~/.bash_profile 2>/dev/null || echo "No suspicious profile entries"',
|
|
@@ -297,13 +496,13 @@ export class UnifiedOrchestrator {
|
|
|
297
496
|
/** Credential hunting */
|
|
298
497
|
credentialHunt() {
|
|
299
498
|
return this.execMany([
|
|
300
|
-
'grep -rn "password\\|passwd\\|secret\\|api.key\\|apikey\\|token\\|credential" --include="*.json" --include="*.yml" --include="*.yaml" --include="*.conf" --include="*.config" --include="*.env" . 2>/dev/null | grep -v node_modules | head -30 || echo "No credentials in config files"',
|
|
301
|
-
'find
|
|
302
|
-
'find
|
|
303
|
-
'
|
|
304
|
-
'
|
|
305
|
-
'
|
|
306
|
-
'
|
|
499
|
+
'grep -rn "password\\|passwd\\|secret\\|api.key\\|apikey\\|token\\|credential" --include="*.json" --include="*.yml" --include="*.yaml" --include="*.conf" --include="*.config" --include="*.env" . 2>/dev/null | grep -v node_modules | head -30 || echo "No credentials in config files (workspace)"',
|
|
500
|
+
'find . -name ".env" -o -name ".env.*" -o -name "*.pem" -o -name "*.key" 2>/dev/null | head -20',
|
|
501
|
+
'find . -name "id_rsa" -o -name "id_ed25519" -o -name "*.ppk" 2>/dev/null | head -10',
|
|
502
|
+
'echo "Skipped ~/.aws credentials scan (out of scope)"',
|
|
503
|
+
'echo "Skipped ~/.ssh scan (out of scope)"',
|
|
504
|
+
'echo "Skipped ~/.gitconfig scan (out of scope)"',
|
|
505
|
+
'echo "Skipped ~/.netrc scan (out of scope)"',
|
|
307
506
|
]);
|
|
308
507
|
}
|
|
309
508
|
/** Network attack surface mapping */
|
|
@@ -567,7 +766,7 @@ export class UnifiedOrchestrator {
|
|
|
567
766
|
// ANALYSIS & FINDINGS
|
|
568
767
|
// ==========================================================================
|
|
569
768
|
/** Analyze output and extract findings */
|
|
570
|
-
analyze(output,
|
|
769
|
+
analyze(output, _context) {
|
|
571
770
|
const findings = [];
|
|
572
771
|
const lower = output.toLowerCase();
|
|
573
772
|
// TypeScript errors
|
|
@@ -629,11 +828,16 @@ export class UnifiedOrchestrator {
|
|
|
629
828
|
});
|
|
630
829
|
}
|
|
631
830
|
this.findings.push(...findings);
|
|
831
|
+
// Emit finding events for real-time UI updates
|
|
832
|
+
for (const finding of findings) {
|
|
833
|
+
this.emitOrchestratorEvent('finding:detected', finding);
|
|
834
|
+
}
|
|
632
835
|
return findings;
|
|
633
836
|
}
|
|
634
|
-
/** Add a custom finding */
|
|
837
|
+
/** Add a custom finding with event emission */
|
|
635
838
|
addFinding(finding) {
|
|
636
839
|
this.findings.push(finding);
|
|
840
|
+
this.emitOrchestratorEvent('finding:detected', finding);
|
|
637
841
|
}
|
|
638
842
|
/** Get all findings */
|
|
639
843
|
getFindings() {
|
|
@@ -643,20 +847,99 @@ export class UnifiedOrchestrator {
|
|
|
643
847
|
getResults() {
|
|
644
848
|
return this.results;
|
|
645
849
|
}
|
|
646
|
-
/** Reset state */
|
|
850
|
+
/** Reset state for new operation */
|
|
647
851
|
reset() {
|
|
648
852
|
this.results = [];
|
|
649
853
|
this.findings = [];
|
|
854
|
+
this.commandIndex = 0;
|
|
855
|
+
this.currentPhase = 'idle';
|
|
856
|
+
this.currentObjective = '';
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* Collapse duplicate findings into a single entry while preserving useful evidence.
|
|
860
|
+
*/
|
|
861
|
+
dedupeFindings(findings) {
|
|
862
|
+
const seen = new Map();
|
|
863
|
+
for (const finding of findings) {
|
|
864
|
+
const key = this.buildFindingKey(finding);
|
|
865
|
+
const existing = seen.get(key);
|
|
866
|
+
if (existing) {
|
|
867
|
+
existing.evidence = this.mergeEvidence(existing.evidence, finding.evidence);
|
|
868
|
+
if (existing.file === undefined && finding.file !== undefined) {
|
|
869
|
+
existing.file = finding.file;
|
|
870
|
+
}
|
|
871
|
+
if (existing.line === undefined && finding.line !== undefined) {
|
|
872
|
+
existing.line = finding.line;
|
|
873
|
+
}
|
|
874
|
+
continue;
|
|
875
|
+
}
|
|
876
|
+
seen.set(key, { ...finding });
|
|
877
|
+
}
|
|
878
|
+
return Array.from(seen.values());
|
|
879
|
+
}
|
|
880
|
+
buildFindingKey(finding) {
|
|
881
|
+
return [
|
|
882
|
+
finding.severity,
|
|
883
|
+
finding.category,
|
|
884
|
+
finding.title,
|
|
885
|
+
finding.recommendation ?? '',
|
|
886
|
+
].join('|');
|
|
887
|
+
}
|
|
888
|
+
mergeEvidence(first, second) {
|
|
889
|
+
const parts = [first, second]
|
|
890
|
+
.map(part => (typeof part === 'string' ? part.trim() : ''))
|
|
891
|
+
.filter(Boolean);
|
|
892
|
+
return Array.from(new Set(parts)).join('\n');
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Derive a consistent completion reason so the UI can present concise guidance.
|
|
896
|
+
*/
|
|
897
|
+
determineExitReason(results, findings) {
|
|
898
|
+
if (results.length === 0) {
|
|
899
|
+
return 'no-commands';
|
|
900
|
+
}
|
|
901
|
+
const failedCount = results.filter(r => !r.success).length;
|
|
902
|
+
const criticalFindings = findings.filter(f => f.severity === 'critical').length;
|
|
903
|
+
if (failedCount === 0 && criticalFindings === 0) {
|
|
904
|
+
return 'complete';
|
|
905
|
+
}
|
|
906
|
+
if (failedCount > 0) {
|
|
907
|
+
return 'failed-commands';
|
|
908
|
+
}
|
|
909
|
+
if (criticalFindings > 0) {
|
|
910
|
+
return 'critical-findings';
|
|
911
|
+
}
|
|
912
|
+
return 'incomplete';
|
|
913
|
+
}
|
|
914
|
+
buildStatusSummary(results, findings) {
|
|
915
|
+
const total = results.length;
|
|
916
|
+
if (total === 0) {
|
|
917
|
+
return 'No commands executed';
|
|
918
|
+
}
|
|
919
|
+
const successCount = results.filter(r => r.success).length;
|
|
920
|
+
const failedCount = total - successCount;
|
|
921
|
+
const criticalFindings = findings.filter(f => f.severity === 'critical').length;
|
|
922
|
+
const parts = [`${successCount}/${total} commands succeeded${failedCount ? ` (${failedCount} failed)` : ''}`];
|
|
923
|
+
if (findings.length > 0) {
|
|
924
|
+
parts.push(`${findings.length} finding${findings.length === 1 ? '' : 's'}${criticalFindings ? ` (${criticalFindings} critical)` : ''}`);
|
|
925
|
+
}
|
|
926
|
+
return parts.join(', ');
|
|
650
927
|
}
|
|
651
928
|
// ==========================================================================
|
|
652
929
|
// REPORT GENERATION
|
|
653
930
|
// ==========================================================================
|
|
654
931
|
/** Generate comprehensive report */
|
|
655
932
|
generateReport(objective = 'Operation') {
|
|
933
|
+
const uniqueFindings = this.dedupeFindings(this.findings);
|
|
934
|
+
this.findings = uniqueFindings;
|
|
656
935
|
const successCount = this.results.filter(r => r.success).length;
|
|
657
936
|
const totalDuration = this.results.reduce((sum, r) => sum + r.duration, 0);
|
|
658
|
-
const criticalFindings =
|
|
659
|
-
const
|
|
937
|
+
const criticalFindings = uniqueFindings.filter(f => f.severity === 'critical').length;
|
|
938
|
+
const failedCount = this.results.length - successCount;
|
|
939
|
+
const isSuccess = failedCount === 0 && criticalFindings === 0;
|
|
940
|
+
const exitReason = this.determineExitReason(this.results, uniqueFindings);
|
|
941
|
+
const statusSummary = this.buildStatusSummary(this.results, uniqueFindings);
|
|
942
|
+
const recommendations = Array.from(new Set(uniqueFindings.filter(f => f.recommendation).map(f => f.recommendation)));
|
|
660
943
|
return {
|
|
661
944
|
id: `OP-${Date.now()}-${crypto.randomBytes(4).toString('hex').toUpperCase()}`,
|
|
662
945
|
objective,
|
|
@@ -664,16 +947,16 @@ export class UnifiedOrchestrator {
|
|
|
664
947
|
endTime: Date.now(),
|
|
665
948
|
duration: totalDuration,
|
|
666
949
|
results: this.results,
|
|
667
|
-
findings:
|
|
668
|
-
summary:
|
|
950
|
+
findings: uniqueFindings,
|
|
951
|
+
summary: statusSummary,
|
|
669
952
|
success: isSuccess,
|
|
670
953
|
mode: objective,
|
|
671
954
|
phasesCompleted: [...new Set(this.results.filter(r => r.success).map(r => (r.command || '').split(' ')[0]))],
|
|
672
|
-
recommendations
|
|
955
|
+
recommendations,
|
|
673
956
|
limitations: [],
|
|
674
957
|
toolsUsed: [...new Set(this.results.map(r => (r.command || '').split(' ')[0]))],
|
|
675
|
-
exitReason
|
|
676
|
-
statusSummary
|
|
958
|
+
exitReason,
|
|
959
|
+
statusSummary,
|
|
677
960
|
finalResponse: this.results.slice(-3).map(r => r.output).join('\n').slice(0, 2000),
|
|
678
961
|
completed: isSuccess,
|
|
679
962
|
evidence: [],
|
|
@@ -685,11 +968,20 @@ export class UnifiedOrchestrator {
|
|
|
685
968
|
/**
|
|
686
969
|
* Execute operations based on objective analysis.
|
|
687
970
|
* Automatically selects and runs appropriate tools based on the objective.
|
|
971
|
+
* Emits real-time events for UI integration.
|
|
688
972
|
*/
|
|
689
973
|
async execute(config) {
|
|
690
974
|
this.reset();
|
|
691
975
|
const objective = (config.objective || config.mode || 'operation').toLowerCase();
|
|
692
976
|
const target = config.target;
|
|
977
|
+
// Store objective for event emission
|
|
978
|
+
this.currentObjective = config.objective || config.mode || 'operation';
|
|
979
|
+
// Phase: Initialization
|
|
980
|
+
this.setPhase('initializing');
|
|
981
|
+
// Phase: Analysis - Determine which tools to run
|
|
982
|
+
this.setPhase('analyzing');
|
|
983
|
+
// Phase: Execution - Run the appropriate tools
|
|
984
|
+
this.setPhase('executing');
|
|
693
985
|
// Analyze objective and execute appropriate tools
|
|
694
986
|
if (this.matchesIntent(objective, ['build', 'compile', 'typescript', 'tsc'])) {
|
|
695
987
|
this.typecheck();
|
|
@@ -750,12 +1042,16 @@ export class UnifiedOrchestrator {
|
|
|
750
1042
|
this.typecheck();
|
|
751
1043
|
this.deps('audit');
|
|
752
1044
|
}
|
|
1045
|
+
// Phase: Reporting - Analyze results and generate report
|
|
1046
|
+
this.setPhase('reporting');
|
|
753
1047
|
// Analyze all results for findings
|
|
754
1048
|
for (const result of this.results) {
|
|
755
1049
|
this.analyze(result.output, objective);
|
|
756
1050
|
}
|
|
757
1051
|
const report = this.generateReport(config.objective || 'Operation');
|
|
758
1052
|
report.finalResponse = this.generateFinalResponse(report);
|
|
1053
|
+
// Phase: Complete
|
|
1054
|
+
this.setPhase('complete');
|
|
759
1055
|
return report;
|
|
760
1056
|
}
|
|
761
1057
|
/** Check if objective matches any of the intent keywords */
|