erosolar-cli 1.7.428 → 1.7.430

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.
Files changed (83) hide show
  1. package/dist/capabilities/enhancedGitCapability.js +3 -3
  2. package/dist/capabilities/enhancedGitCapability.js.map +1 -1
  3. package/dist/capabilities/learnCapability.d.ts +1 -1
  4. package/dist/capabilities/learnCapability.d.ts.map +1 -1
  5. package/dist/capabilities/learnCapability.js +1 -1
  6. package/dist/capabilities/learnCapability.js.map +1 -1
  7. package/dist/core/checkpoint.d.ts +1 -1
  8. package/dist/core/checkpoint.js +1 -1
  9. package/dist/core/costTracker.d.ts +1 -1
  10. package/dist/core/costTracker.js +1 -1
  11. package/dist/core/hooks.d.ts +1 -1
  12. package/dist/core/hooks.js +1 -1
  13. package/dist/core/memorySystem.d.ts +2 -2
  14. package/dist/core/memorySystem.js +2 -2
  15. package/dist/core/outputStyles.d.ts +2 -2
  16. package/dist/core/outputStyles.js +2 -2
  17. package/dist/core/validationRunner.d.ts +1 -1
  18. package/dist/core/validationRunner.js +1 -1
  19. package/dist/shell/interactiveShell.d.ts +6 -1
  20. package/dist/shell/interactiveShell.d.ts.map +1 -1
  21. package/dist/shell/interactiveShell.js +129 -92
  22. package/dist/shell/interactiveShell.js.map +1 -1
  23. package/dist/shell/systemPrompt.d.ts.map +1 -1
  24. package/dist/shell/systemPrompt.js +13 -33
  25. package/dist/shell/systemPrompt.js.map +1 -1
  26. package/dist/shell/terminalInputAdapter.d.ts +75 -83
  27. package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
  28. package/dist/shell/terminalInputAdapter.js +159 -220
  29. package/dist/shell/terminalInputAdapter.js.map +1 -1
  30. package/dist/shell/vimMode.d.ts +1 -1
  31. package/dist/shell/vimMode.js +1 -1
  32. package/dist/tools/buildTools.d.ts +1 -1
  33. package/dist/tools/buildTools.js +1 -1
  34. package/dist/tools/diffUtils.d.ts +2 -2
  35. package/dist/tools/diffUtils.js +2 -2
  36. package/dist/tools/editTools.js +4 -4
  37. package/dist/tools/editTools.js.map +1 -1
  38. package/dist/tools/localExplore.d.ts +3 -3
  39. package/dist/tools/localExplore.js +3 -3
  40. package/dist/tools/skillTools.js +2 -2
  41. package/dist/tools/skillTools.js.map +1 -1
  42. package/dist/tools/validationTools.js +1 -1
  43. package/dist/ui/DisplayEventQueue.d.ts +99 -0
  44. package/dist/ui/DisplayEventQueue.d.ts.map +1 -0
  45. package/dist/ui/DisplayEventQueue.js +167 -0
  46. package/dist/ui/DisplayEventQueue.js.map +1 -0
  47. package/dist/ui/SequentialRenderer.d.ts +69 -0
  48. package/dist/ui/SequentialRenderer.d.ts.map +1 -0
  49. package/dist/ui/SequentialRenderer.js +137 -0
  50. package/dist/ui/SequentialRenderer.js.map +1 -0
  51. package/dist/ui/ShellUIAdapter.d.ts +19 -12
  52. package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
  53. package/dist/ui/ShellUIAdapter.js +73 -56
  54. package/dist/ui/ShellUIAdapter.js.map +1 -1
  55. package/dist/ui/UnifiedUIRenderer.d.ts +184 -0
  56. package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -0
  57. package/dist/ui/UnifiedUIRenderer.js +567 -0
  58. package/dist/ui/UnifiedUIRenderer.js.map +1 -0
  59. package/dist/ui/display.d.ts +100 -173
  60. package/dist/ui/display.d.ts.map +1 -1
  61. package/dist/ui/display.js +359 -926
  62. package/dist/ui/display.js.map +1 -1
  63. package/dist/ui/errorFormatter.d.ts +1 -1
  64. package/dist/ui/errorFormatter.js +1 -1
  65. package/dist/ui/shortcutsHelp.d.ts +6 -6
  66. package/dist/ui/shortcutsHelp.js +6 -6
  67. package/dist/ui/streamingFormatter.d.ts +2 -10
  68. package/dist/ui/streamingFormatter.d.ts.map +1 -1
  69. package/dist/ui/streamingFormatter.js +9 -59
  70. package/dist/ui/streamingFormatter.js.map +1 -1
  71. package/dist/ui/textHighlighter.d.ts +8 -8
  72. package/dist/ui/textHighlighter.js +9 -9
  73. package/dist/ui/textHighlighter.js.map +1 -1
  74. package/dist/ui/theme.d.ts +2 -2
  75. package/dist/ui/theme.js +4 -4
  76. package/dist/ui/theme.js.map +1 -1
  77. package/dist/ui/toolDisplay.d.ts +8 -8
  78. package/dist/ui/toolDisplay.js +8 -8
  79. package/package.json +1 -1
  80. package/dist/shell/terminalInput.d.ts +0 -619
  81. package/dist/shell/terminalInput.d.ts.map +0 -1
  82. package/dist/shell/terminalInput.js +0 -2699
  83. package/dist/shell/terminalInput.js.map +0 -1
@@ -0,0 +1,137 @@
1
+ /**
2
+ * SequentialRenderer - Ensures all UI events render sequentially without overlap
3
+ *
4
+ * Key responsibilities:
5
+ * 1. Queue all content writes to prevent overlap
6
+ * 2. Track content position to ensure chat box stays below
7
+ * 3. Coordinate with terminalInput for proper positioning
8
+ * 4. Prevent race conditions between streaming and static content
9
+ */
10
+ import { writeLock } from './writeLock.js';
11
+ export class SequentialRenderer {
12
+ writeFunction;
13
+ updateChatBoxPosition;
14
+ contentQueue = [];
15
+ isProcessing = false;
16
+ lastContentEndRow = 1; // Track where content ends
17
+ terminalRows = 24;
18
+ chatBoxHeight = 5;
19
+ constructor(writeFunction, updateChatBoxPosition) {
20
+ this.writeFunction = writeFunction;
21
+ this.updateChatBoxPosition = updateChatBoxPosition;
22
+ }
23
+ /**
24
+ * Queue content for sequential rendering
25
+ */
26
+ queueContent(content, type = 'response') {
27
+ this.contentQueue.push({
28
+ content,
29
+ type,
30
+ timestamp: Date.now(),
31
+ });
32
+ if (!this.isProcessing) {
33
+ void this.processQueue();
34
+ }
35
+ }
36
+ /**
37
+ * Process the content queue sequentially
38
+ */
39
+ async processQueue() {
40
+ if (this.isProcessing)
41
+ return;
42
+ this.isProcessing = true;
43
+ try {
44
+ while (this.contentQueue.length > 0) {
45
+ const block = this.contentQueue.shift();
46
+ if (!block)
47
+ continue;
48
+ await this.renderBlock(block);
49
+ // Small delay to ensure rendering settles
50
+ await this.delay(5);
51
+ }
52
+ }
53
+ finally {
54
+ this.isProcessing = false;
55
+ // Update chat box position after all content is rendered
56
+ this.updateChatBoxPositionIfNeeded();
57
+ }
58
+ }
59
+ /**
60
+ * Render a single content block
61
+ */
62
+ async renderBlock(block) {
63
+ await writeLock.withLockAsync(async () => {
64
+ // Write the content
65
+ this.writeFunction(block.content);
66
+ // Update content position tracking
67
+ const linesInBlock = this.countLines(block.content);
68
+ this.lastContentEndRow += linesInBlock;
69
+ }, `render-${block.type}`);
70
+ }
71
+ /**
72
+ * Count newlines in content
73
+ */
74
+ countLines(content) {
75
+ return (content.match(/\n/g) || []).length;
76
+ }
77
+ /**
78
+ * Update chat box position to stay below content
79
+ */
80
+ updateChatBoxPositionIfNeeded() {
81
+ if (!this.updateChatBoxPosition)
82
+ return;
83
+ // Calculate where chat box should start (below all content)
84
+ const chatBoxStartRow = Math.min(this.lastContentEndRow + 1, this.terminalRows - this.chatBoxHeight + 1);
85
+ this.updateChatBoxPosition(chatBoxStartRow);
86
+ }
87
+ /**
88
+ * Update terminal dimensions
89
+ */
90
+ updateDimensions(rows, chatBoxHeight) {
91
+ this.terminalRows = rows;
92
+ this.chatBoxHeight = chatBoxHeight;
93
+ }
94
+ /**
95
+ * Reset content position (e.g., after clear screen)
96
+ */
97
+ resetPosition() {
98
+ this.lastContentEndRow = 1;
99
+ }
100
+ /**
101
+ * Wait for queue to complete
102
+ */
103
+ async waitForCompletion() {
104
+ while (this.isProcessing || this.contentQueue.length > 0) {
105
+ await this.delay(10);
106
+ }
107
+ }
108
+ /**
109
+ * Clear the queue
110
+ */
111
+ clear() {
112
+ this.contentQueue = [];
113
+ }
114
+ /**
115
+ * Get current queue length
116
+ */
117
+ get queueLength() {
118
+ return this.contentQueue.length;
119
+ }
120
+ delay(ms) {
121
+ return new Promise(resolve => setTimeout(resolve, ms));
122
+ }
123
+ }
124
+ /**
125
+ * Global singleton instance
126
+ */
127
+ let globalRenderer = null;
128
+ export function getSequentialRenderer(writeFunction, updateChatBoxPosition) {
129
+ if (!globalRenderer && writeFunction) {
130
+ globalRenderer = new SequentialRenderer(writeFunction, updateChatBoxPosition);
131
+ }
132
+ return globalRenderer;
133
+ }
134
+ export function resetSequentialRenderer() {
135
+ globalRenderer = null;
136
+ }
137
+ //# sourceMappingURL=SequentialRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SequentialRenderer.js","sourceRoot":"","sources":["../../src/ui/SequentialRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAQ3C,MAAM,OAAO,kBAAkB;IAQnB;IACA;IARF,YAAY,GAAmB,EAAE,CAAC;IAClC,YAAY,GAAG,KAAK,CAAC;IACrB,iBAAiB,GAAG,CAAC,CAAC,CAAC,2BAA2B;IAClD,YAAY,GAAG,EAAE,CAAC;IAClB,aAAa,GAAG,CAAC,CAAC;IAE1B,YACU,aAAwC,EACxC,qBAAkD;QADlD,kBAAa,GAAb,aAAa,CAA2B;QACxC,0BAAqB,GAArB,qBAAqB,CAA6B;IACzD,CAAC;IAEJ;;OAEG;IACH,YAAY,CAAC,OAAe,EAAE,OAA6B,UAAU;QACnE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;YACrB,OAAO;YACP,IAAI;YACJ,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;QAC3B,CAAC;IACH,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,YAAY;QACxB,IAAI,IAAI,CAAC,YAAY;YAAE,OAAO;QAE9B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAEzB,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACpC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,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C,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,aAAa;QACX,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,iBAAiB;QACrB,OAAO,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzD,MAAM,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;IAClC,CAAC;IAEO,KAAK,CAAC,EAAU;QACtB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IACzD,CAAC;CACF;AAED;;GAEG;AACH,IAAI,cAAc,GAA8B,IAAI,CAAC;AAErD,MAAM,UAAU,qBAAqB,CACnC,aAAyC,EACzC,qBAAkD;IAElD,IAAI,CAAC,cAAc,IAAI,aAAa,EAAE,CAAC;QACrC,cAAc,GAAG,IAAI,kBAAkB,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,cAAe,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,uBAAuB;IACrC,cAAc,GAAG,IAAI,CAAC;AACxB,CAAC"}
@@ -34,6 +34,7 @@ export declare class ShellUIAdapter {
34
34
  private toolWarnings;
35
35
  private exploreProgressRegions;
36
36
  private readonly exploreProgressLines;
37
+ private toolUsageCounts;
37
38
  constructor(writeStream: typeof process.stdout, display: Display, config?: Partial<ShellUIAdapterConfig>, updateCoordinator?: UIUpdateCoordinator);
38
39
  /**
39
40
  * Setup display integration
@@ -57,6 +58,17 @@ export declare class ShellUIAdapter {
57
58
  * Check if a tool should use compact (single-line) display
58
59
  */
59
60
  private isCompactTool;
61
+ /**
62
+ * Track tool usage for per-request summaries.
63
+ */
64
+ private recordToolUsage;
65
+ private resetToolUsageSummary;
66
+ /**
67
+ * Render a compact "tools used" line mirroring Claude Code.
68
+ * Shows the top two tools and how many more were used.
69
+ */
70
+ private showToolUsageSummary;
71
+ private formatToolUsageSummary;
60
72
  /**
61
73
  * Normalize preflight warnings for consistent display.
62
74
  */
@@ -79,28 +91,23 @@ export declare class ShellUIAdapter {
79
91
  */
80
92
  private extractResultSummary;
81
93
  /**
82
- * Display compact single-line result
94
+ * Display compact single-line result (Erosolar-CLI style)
95
+ * Just shows the plain output without badges or prefixes
83
96
  */
84
97
  private displayCompactResult;
85
- /**
86
- * Determine if a tool should show initial ⏺ display
87
- * Returns true for tools with streaming/progressive output
88
- * Returns false for quick single-result tools to avoid duplicate displays
89
- */
90
- private shouldShowToolStart;
91
98
  private handleExploreProgress;
92
99
  private finalizeExploreProgress;
93
100
  private getExploreRegionId;
94
101
  private renderExploreProgressBox;
95
102
  /**
96
- * Display tool call start with Claude Code style prefix
103
+ * Display tool call start with Erosolar-CLI style prefix
97
104
  * - ✢ for Task/agent tools (active task indicator)
98
105
  * - ⏺ for other tools
99
106
  * Routes through display module to work with scroll regions
100
107
  */
101
108
  private displayToolCallStart;
102
109
  /**
103
- * Format tool arguments inline for display (Claude Code style)
110
+ * Format tool arguments inline for display (Erosolar-CLI style)
104
111
  * Format: ToolName(arg1: "value1", arg2: "value2")
105
112
  */
106
113
  private formatToolArgsInline;
@@ -143,7 +150,7 @@ export declare class ShellUIAdapter {
143
150
  */
144
151
  getTelemetry(): any;
145
152
  /**
146
- * Get action description for tool execution (Claude Code style)
153
+ * Get action description for tool execution (Erosolar-CLI style)
147
154
  * Returns a human-readable description of what the tool is doing
148
155
  * Includes the actual file path, command, or search target when available
149
156
  */
@@ -170,13 +177,13 @@ export declare class ShellUIAdapter {
170
177
  */
171
178
  private parseFileChange;
172
179
  /**
173
- * Display tool result summary using Claude Code style.
180
+ * Display tool result summary using Erosolar-CLI style.
174
181
  * Format: ⎿ Summary text
175
182
  * Routes through display module to work with scroll regions
176
183
  */
177
184
  private displayToolResultSummary;
178
185
  /**
179
- * Format tool result summary in Claude Code style
186
+ * Format tool result summary in Erosolar-CLI style
180
187
  * Returns compact summary like "Found 4 files" or "Read 50 lines"
181
188
  */
182
189
  private formatClaudeCodeResultSummary;
@@ -1 +1 @@
1
- {"version":3,"file":"ShellUIAdapter.d.ts","sourceRoot":"","sources":["../../src/ui/ShellUIAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAA2B,MAAM,wBAAwB,CAAC;AAKtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAM7E,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,YAAY,CAAsB;IAC1C,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,YAAY,CAAkB;IACtC,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,kBAAkB,CAAC,CAAiG;IAC5H,OAAO,CAAC,mBAAmB,CAAC,CAAkC;IAC9D,OAAO,CAAC,sBAAsB,CAAC,CAAgC;IAC/D,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAsB;IAGxD,OAAO,CAAC,iBAAiB,CAAyC;IAClE,OAAO,CAAC,mBAAmB,CAAuB;IAClD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAK;IAC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E,MAAM,GACrB,IAAI;IA+BP;;OAEG;IACH,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAKzC;;OAEG;IACH,YAAY,IAAI,GAAG;IAOnB;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IA6GhC;;OAEG;IACH,OAAO,CAAC,WAAW;IAWnB;;;OAGG;IACH,OAAO,CAAC,YAAY;IAkBpB;;OAEG;IACH,qBAAqB,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAIrI;;OAEG;IACH,qBAAqB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI;IAItE;;OAEG;IACH,OAAO,CAAC,eAAe;IA6CvB;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAiBhC;;;OAGG;IACH,OAAO,CAAC,6BAA6B;IA+HrC;;;;;;OAMG;IACH,OAAO,CAAC,wBAAwB;IAqDhC;;OAEG;IACH,QAAQ,IAAI,GAAG;IAIf;;OAEG;IACH,OAAO,IAAI,IAAI;CAShB"}
@@ -13,7 +13,6 @@ import { InterruptPriority } from './interrupts/InterruptManager.js';
13
13
  import { getTerminalColumns } from './layout.js';
14
14
  import { theme, icons, boxChars } from './theme.js';
15
15
  import { UIUpdateCoordinator } from './orchestration/UIUpdateCoordinator.js';
16
- import { compactRenderer } from './compactRenderer.js';
17
16
  import { inPlaceUpdater } from './inPlaceUpdater.js';
18
17
  export class ShellUIAdapter {
19
18
  uiController;
@@ -33,6 +32,7 @@ export class ShellUIAdapter {
33
32
  toolWarnings = new Map();
34
33
  exploreProgressRegions = new Map();
35
34
  exploreProgressLines = 6;
35
+ toolUsageCounts = new Map();
36
36
  constructor(writeStream, display, config = {}, updateCoordinator) {
37
37
  this.display = display;
38
38
  this.config = {
@@ -88,6 +88,7 @@ export class ShellUIAdapter {
88
88
  createToolObserver() {
89
89
  return {
90
90
  onToolStart: (call) => {
91
+ this.recordToolUsage(call.name);
91
92
  // Track operation for compact rendering
92
93
  const operation = {
93
94
  id: call.id,
@@ -98,12 +99,9 @@ export class ShellUIAdapter {
98
99
  startedAt: Date.now(),
99
100
  };
100
101
  this.pendingOperations.set(call.id, operation);
101
- // Show initial display for tools with streaming/progressive output
102
- // Skip for quick tools to avoid duplicate displays (⏺ then ✓)
103
- const showsProgressiveOutput = this.shouldShowToolStart(call.name);
104
- if (showsProgressiveOutput) {
105
- this.displayToolCallStart(call);
106
- }
102
+ // Erosolar-CLI style: Show tool call start for ALL tools
103
+ // This provides transparency about which tools are being used
104
+ this.displayToolCallStart(call);
107
105
  // Update status bar to show active tool
108
106
  if (this._toolStatusCallback) {
109
107
  const actionDesc = this.getToolActionDescription(call);
@@ -173,7 +171,7 @@ export class ShellUIAdapter {
173
171
  this.displayCompactResult(call, output, true);
174
172
  }
175
173
  else {
176
- // Claude Code style: Display tool result with ⎿ prefix
174
+ // Erosolar-CLI style: Display tool result with ⎿ prefix
177
175
  this.displayToolResultSummary(call, output, true);
178
176
  }
179
177
  // Surface any captured preflight warnings in a structured block
@@ -202,7 +200,7 @@ export class ShellUIAdapter {
202
200
  this.displayCompactResult(call, message, false);
203
201
  }
204
202
  else {
205
- // Claude Code style: Display error with ⎿ prefix (error color)
203
+ // Erosolar-CLI style: Display error with ⎿ prefix (error color)
206
204
  this.displayToolResultSummary(call, message, false);
207
205
  }
208
206
  this.flushToolWarnings(call.id, call.name);
@@ -224,11 +222,8 @@ export class ShellUIAdapter {
224
222
  completedAt: Date.now(),
225
223
  };
226
224
  this.completedOperations.push(operation);
227
- // Show compact cached result
228
- if (this.compactDisplayMode) {
229
- const badge = compactRenderer.formatToolBadge(operation);
230
- this.display.stream(`${badge}\n`);
231
- }
225
+ // Erosolar-CLI style: Show tool call with (cached) indicator
226
+ this.displayToolCallStart(call, true);
232
227
  this.flushToolWarnings(call.id, call.name);
233
228
  this.uiController.onToolStart(call);
234
229
  this.uiController.onToolComplete(call.id, 'cache-hit');
@@ -247,6 +242,53 @@ export class ShellUIAdapter {
247
242
  ]);
248
243
  return compactTools.has(toolName);
249
244
  }
245
+ /**
246
+ * Track tool usage for per-request summaries.
247
+ */
248
+ recordToolUsage(toolName) {
249
+ const name = toolName.trim();
250
+ if (!name)
251
+ return;
252
+ const current = this.toolUsageCounts.get(name) ?? 0;
253
+ this.toolUsageCounts.set(name, current + 1);
254
+ }
255
+ resetToolUsageSummary() {
256
+ this.toolUsageCounts.clear();
257
+ }
258
+ /**
259
+ * Render a compact "tools used" line mirroring Claude Code.
260
+ * Shows the top two tools and how many more were used.
261
+ */
262
+ showToolUsageSummary() {
263
+ const summary = this.formatToolUsageSummary();
264
+ if (!summary) {
265
+ return;
266
+ }
267
+ this.display.stream(`\n${summary}\n`);
268
+ }
269
+ formatToolUsageSummary() {
270
+ if (this.toolUsageCounts.size === 0) {
271
+ return null;
272
+ }
273
+ const entries = Array.from(this.toolUsageCounts.entries()).sort((a, b) => {
274
+ if (b[1] === a[1]) {
275
+ return a[0].localeCompare(b[0]);
276
+ }
277
+ return b[1] - a[1];
278
+ });
279
+ const totalCalls = entries.reduce((sum, [, count]) => sum + count, 0);
280
+ const top = entries.slice(0, 2);
281
+ const remaining = entries.slice(2);
282
+ const formattedTop = top.map(([name, count]) => {
283
+ const countLabel = count > 1 ? theme.ui.muted(` ×${count}`) : '';
284
+ return `${theme.tool(name)}${countLabel}`;
285
+ });
286
+ const remainderLabel = remaining.length
287
+ ? theme.ui.muted(` +${remaining.length} more`)
288
+ : '';
289
+ const totalLabel = theme.ui.muted(` • ${totalCalls} call${totalCalls === 1 ? '' : 's'}`);
290
+ return `${theme.info(icons.action)} Tools used: ${formattedTop.join(theme.ui.muted(', '))}${remainderLabel}${totalLabel}`;
291
+ }
250
292
  /**
251
293
  * Normalize preflight warnings for consistent display.
252
294
  */
@@ -382,39 +424,13 @@ export class ShellUIAdapter {
382
424
  }
383
425
  }
384
426
  /**
385
- * Display compact single-line result
427
+ * Display compact single-line result (Erosolar-CLI style)
428
+ * Just shows the plain output without badges or prefixes
386
429
  */
387
430
  displayCompactResult(call, output, success) {
388
- const op = {
389
- id: call.id,
390
- name: call.name,
391
- status: success ? 'success' : 'error',
392
- summary: this.extractResultSummary(call, output),
393
- startedAt: Date.now(),
394
- };
395
- const badge = compactRenderer.formatToolBadge(op);
396
- // Add newline after result for visual separation
397
- this.display.stream(`${badge}\n\n`);
398
- }
399
- /**
400
- * Determine if a tool should show initial ⏺ display
401
- * Returns true for tools with streaming/progressive output
402
- * Returns false for quick single-result tools to avoid duplicate displays
403
- */
404
- shouldShowToolStart(toolName) {
405
- // Tools that show streaming or progressive output - show start indicator
406
- const streamingTools = new Set([
407
- 'Task', // Spawns agents with streaming output
408
- 'Bash', // Shows live command output
409
- 'Explore', // Lists files progressively
410
- 'explore', // Local explore tool (codebase index)
411
- 'Plan', // Planning agent with progressive output
412
- 'Grep', // May return many results
413
- 'Glob', // May return many files
414
- 'WebSearch', // Shows search progress
415
- 'WebFetch', // Shows fetch progress
416
- ]);
417
- return streamingTools.has(toolName);
431
+ // Erosolar-CLI shows plain output without badges for compact tools
432
+ // Just stream the output directly
433
+ this.display.stream(`${output}\n\n`);
418
434
  }
419
435
  handleExploreProgress(call, progress) {
420
436
  const regionId = this.getExploreRegionId(call.id);
@@ -482,7 +498,7 @@ export class ShellUIAdapter {
482
498
  return [header, ...contentLines, footer];
483
499
  }
484
500
  /**
485
- * Display tool call start with Claude Code style prefix
501
+ * Display tool call start with Erosolar-CLI style prefix
486
502
  * - ✢ for Task/agent tools (active task indicator)
487
503
  * - ⏺ for other tools
488
504
  * Routes through display module to work with scroll regions
@@ -506,13 +522,13 @@ export class ShellUIAdapter {
506
522
  displayName = theme.tool(subagentType.charAt(0).toUpperCase() + subagentType.slice(1));
507
523
  }
508
524
  }
509
- // Claude Code style: bullet + optional task marker + ToolName(args)
525
+ // Erosolar-CLI style: bullet + optional task marker + ToolName(args)
510
526
  const line = `${bullet}${taskMarker ? taskMarker : ''} ${displayName}${argsStr}${cacheHint}`;
511
527
  // Stream with spacing to keep it as a distinct event
512
- this.display.stream(`\n${line}\n\n`);
528
+ this.display.stream(`\n${line}\n`);
513
529
  }
514
530
  /**
515
- * Format tool arguments inline for display (Claude Code style)
531
+ * Format tool arguments inline for display (Erosolar-CLI style)
516
532
  * Format: ToolName(arg1: "value1", arg2: "value2")
517
533
  */
518
534
  formatToolArgsInline(toolName, args) {
@@ -621,9 +637,8 @@ export class ShellUIAdapter {
621
637
  }
622
638
  case 'TodoWrite':
623
639
  case 'todo_write': {
624
- const todos = args['todos'];
625
- if (Array.isArray(todos))
626
- parts.push(`${todos.length} items`);
640
+ // Erosolar-CLI shows parameter names for complex types
641
+ parts.push('todos');
627
642
  break;
628
643
  }
629
644
  default: {
@@ -653,6 +668,7 @@ export class ShellUIAdapter {
653
668
  */
654
669
  startProcessing(message = 'Working on your request') {
655
670
  this.isProcessing = true;
671
+ this.resetToolUsageSummary();
656
672
  this.uiController.startProcessing();
657
673
  this.uiController.setBaseStatus(message, 'info');
658
674
  }
@@ -662,6 +678,7 @@ export class ShellUIAdapter {
662
678
  endProcessing(message = 'Ready for prompts') {
663
679
  this.isProcessing = false;
664
680
  this.uiController.endProcessing();
681
+ this.showToolUsageSummary();
665
682
  this.uiController.setBaseStatus(message, 'success');
666
683
  }
667
684
  /**
@@ -735,7 +752,7 @@ export class ShellUIAdapter {
735
752
  };
736
753
  }
737
754
  /**
738
- * Get action description for tool execution (Claude Code style)
755
+ * Get action description for tool execution (Erosolar-CLI style)
739
756
  * Returns a human-readable description of what the tool is doing
740
757
  * Includes the actual file path, command, or search target when available
741
758
  */
@@ -940,7 +957,7 @@ export class ShellUIAdapter {
940
957
  };
941
958
  }
942
959
  /**
943
- * Display tool result summary using Claude Code style.
960
+ * Display tool result summary using Erosolar-CLI style.
944
961
  * Format: ⎿ Summary text
945
962
  * Routes through display module to work with scroll regions
946
963
  */
@@ -949,7 +966,7 @@ export class ShellUIAdapter {
949
966
  // Get compact summary for the result
950
967
  const summary = this.formatClaudeCodeResultSummary(call.name, args, output, success);
951
968
  if (summary) {
952
- // Claude Code style: ⎿ Summary (indented under tool call)
969
+ // Erosolar-CLI style: ⎿ Summary (indented under tool call)
953
970
  const prefix = success
954
971
  ? theme.success(icons.subaction)
955
972
  : theme.error(icons.subaction);
@@ -958,7 +975,7 @@ export class ShellUIAdapter {
958
975
  }
959
976
  }
960
977
  /**
961
- * Format tool result summary in Claude Code style
978
+ * Format tool result summary in Erosolar-CLI style
962
979
  * Returns compact summary like "Found 4 files" or "Read 50 lines"
963
980
  */
964
981
  formatClaudeCodeResultSummary(toolName, args, output, success) {