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.
@@ -0,0 +1,199 @@
1
+ /**
2
+ * OrchestrationUIBridge - Claude Code / Codex CLI Style UI Rendering
3
+ *
4
+ * This module provides real-time integration between the UnifiedOrchestrator and the UI system,
5
+ * rendering output in the Claude Code / Codex CLI visual style:
6
+ *
7
+ * Visual Style:
8
+ * - ⏺ [tool_name] description (tool start, with spinner during execution)
9
+ * - ⎿ output/result (tool result, indented under action)
10
+ * - ✓ success indicator (green checkmark on completion)
11
+ * - ✗ error indicator (red X on failure)
12
+ *
13
+ * Architecture:
14
+ * - Subscribes to orchestrator events (tool:*, phase:*, finding:*)
15
+ * - Renders each event type with appropriate visual treatment
16
+ * - Uses UIUpdateCoordinator for serialized, non-interleaved output
17
+ * - Uses StatusOrchestrator for status line management
18
+ *
19
+ * Key Features:
20
+ * - Real-time tool execution feedback with spinners
21
+ * - Progressive output streaming
22
+ * - Findings displayed inline as discovered
23
+ * - Status line shows current operation
24
+ * - Clean separation between execution and rendering
25
+ */
26
+ import { EventEmitter } from 'node:events';
27
+ import { type ExecutionResult, type Finding, type OperationReport, type OperationConfig } from '../../core/unifiedOrchestrator.js';
28
+ import { UIUpdateCoordinator } from './UIUpdateCoordinator.js';
29
+ import { StatusOrchestrator } from './StatusOrchestrator.js';
30
+ import { Display } from '../display.js';
31
+ export type OrchestrationPhase = 'initializing' | 'analyzing' | 'executing' | 'reporting' | 'complete' | 'error';
32
+ export interface OrchestrationProgress {
33
+ phase: OrchestrationPhase;
34
+ currentCommand?: string;
35
+ commandIndex: number;
36
+ totalCommands: number;
37
+ elapsedMs: number;
38
+ findings: Finding[];
39
+ errors: string[];
40
+ }
41
+ export interface OrchestrationEvent {
42
+ type: 'start' | 'progress' | 'command' | 'finding' | 'complete' | 'error';
43
+ timestamp: number;
44
+ data: unknown;
45
+ }
46
+ export interface OrchestrationUIBridgeConfig {
47
+ display: Display;
48
+ updateCoordinator?: UIUpdateCoordinator;
49
+ statusOrchestrator?: StatusOrchestrator;
50
+ showRealTimeOutput?: boolean;
51
+ showProgressBar?: boolean;
52
+ maxVisibleFindings?: number;
53
+ verboseMode?: boolean;
54
+ }
55
+ export interface OrchestrationUIState {
56
+ isRunning: boolean;
57
+ phase: OrchestrationPhase;
58
+ progress: number;
59
+ currentCommand: string | null;
60
+ findingsCount: number;
61
+ errorsCount: number;
62
+ elapsedMs: number;
63
+ }
64
+ export declare class OrchestrationUIBridge extends EventEmitter {
65
+ private readonly display;
66
+ private readonly updateCoordinator;
67
+ private readonly statusOrchestrator;
68
+ private readonly config;
69
+ private orchestrator;
70
+ private currentState;
71
+ private startTime;
72
+ private commandResults;
73
+ private findings;
74
+ private heartbeatId;
75
+ private disposed;
76
+ private activeTools;
77
+ private spinnerInterval;
78
+ private orchestratorUnsubscribe;
79
+ constructor(config: OrchestrationUIBridgeConfig);
80
+ /**
81
+ * Execute an orchestration operation with Claude Code-style real-time UI updates.
82
+ *
83
+ * Renders tool executions as:
84
+ * ⏺ [tool_name] description
85
+ * ⎿ output line 1
86
+ * ⎿ output line 2
87
+ * ✓ tool_name (duration)
88
+ */
89
+ execute(objective: string, options?: Partial<OperationConfig>): Promise<OperationReport>;
90
+ /**
91
+ * Subscribe to orchestrator events for real-time Claude Code-style rendering.
92
+ */
93
+ private subscribeToOrchestratorEvents;
94
+ /**
95
+ * Unsubscribe from orchestrator events.
96
+ */
97
+ private unsubscribeFromOrchestratorEvents;
98
+ /**
99
+ * Handle an orchestrator event and render it in Claude Code style.
100
+ */
101
+ private handleOrchestratorEvent;
102
+ /**
103
+ * Render tool start in Claude Code style:
104
+ * ⏺ [tool_name] description
105
+ */
106
+ private renderToolStart;
107
+ /**
108
+ * Render tool progress (streaming output) in Claude Code style:
109
+ * ⎿ output line
110
+ */
111
+ private renderToolProgress;
112
+ /**
113
+ * Render tool completion in Claude Code style:
114
+ * ✓ tool_name (1.2s) or ✗ tool_name - error
115
+ */
116
+ private renderToolComplete;
117
+ /**
118
+ * Render phase change notification.
119
+ */
120
+ private renderPhaseChange;
121
+ /**
122
+ * Render a finding in Claude Code style:
123
+ * ⚠ [SEVERITY] title
124
+ * Recommendation: ...
125
+ */
126
+ private renderFinding;
127
+ /**
128
+ * Start the spinner animation for active tools.
129
+ */
130
+ private startSpinner;
131
+ /**
132
+ * Stop the spinner animation.
133
+ */
134
+ private stopSpinner;
135
+ /**
136
+ * Execute a specific command with UI feedback.
137
+ */
138
+ executeCommand(command: string, timeout?: number): Promise<ExecutionResult>;
139
+ /**
140
+ * Get current orchestration state.
141
+ */
142
+ getState(): OrchestrationUIState;
143
+ /**
144
+ * Check if orchestration is currently running.
145
+ */
146
+ isRunning(): boolean;
147
+ /**
148
+ * Dispose the bridge and clean up resources.
149
+ */
150
+ dispose(): void;
151
+ private executeWithProgress;
152
+ /**
153
+ * Show start banner in Claude Code style - minimal and clean.
154
+ */
155
+ private showStartBanner;
156
+ private displayCommandResult;
157
+ /**
158
+ * Display final report in Claude Code style:
159
+ *
160
+ * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
161
+ * ✓ Operation Complete
162
+ * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
163
+ *
164
+ * Status: ✓ Success Duration: 2.3s Commands: 5/5 succeeded
165
+ *
166
+ * Findings
167
+ * • [CRITICAL] Potential secrets in code
168
+ * ⎿ Recommendation: Use environment variables
169
+ *
170
+ * Failed Commands
171
+ * ✗ npm run lint - Command failed
172
+ *
173
+ * Summary
174
+ * 5/5 succeeded, 2 findings (1 critical)
175
+ */
176
+ private displayReport;
177
+ private handleError;
178
+ private setPhase;
179
+ private updateStatus;
180
+ private getProgress;
181
+ private startHeartbeat;
182
+ private stopHeartbeat;
183
+ private updateElapsedTime;
184
+ private setupStatusListeners;
185
+ private handleToolStatusEvent;
186
+ private emitEvent;
187
+ private enqueueUIUpdate;
188
+ private createInitialState;
189
+ private reset;
190
+ private truncate;
191
+ private formatElapsed;
192
+ private getSeverityColor;
193
+ }
194
+ /**
195
+ * Create an OrchestrationUIBridge with default configuration.
196
+ */
197
+ export declare function createOrchestrationUIBridge(display: Display, options?: Partial<Omit<OrchestrationUIBridgeConfig, 'display'>>): OrchestrationUIBridge;
198
+ export type { ExecutionResult, Finding, OperationReport, OperationConfig, };
199
+ //# sourceMappingURL=OrchestrationUIBridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrchestrationUIBridge.d.ts","sourceRoot":"","sources":["../../../src/ui/orchestration/OrchestrationUIBridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,eAAe,EAMrB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAqB,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAmB,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAoBxC,MAAM,MAAM,kBAAkB,GAC1B,cAAc,GACd,WAAW,GACX,WAAW,GACX,WAAW,GACX,UAAU,GACV,OAAO,CAAC;AAEZ,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,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