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.
- package/dist/capabilities/enhancedGitCapability.js +3 -3
- package/dist/capabilities/enhancedGitCapability.js.map +1 -1
- package/dist/capabilities/learnCapability.d.ts +1 -1
- package/dist/capabilities/learnCapability.d.ts.map +1 -1
- package/dist/capabilities/learnCapability.js +1 -1
- package/dist/capabilities/learnCapability.js.map +1 -1
- package/dist/core/checkpoint.d.ts +1 -1
- package/dist/core/checkpoint.js +1 -1
- package/dist/core/costTracker.d.ts +1 -1
- package/dist/core/costTracker.js +1 -1
- package/dist/core/hooks.d.ts +1 -1
- package/dist/core/hooks.js +1 -1
- package/dist/core/memorySystem.d.ts +2 -2
- package/dist/core/memorySystem.js +2 -2
- package/dist/core/outputStyles.d.ts +2 -2
- package/dist/core/outputStyles.js +2 -2
- package/dist/core/validationRunner.d.ts +1 -1
- package/dist/core/validationRunner.js +1 -1
- package/dist/shell/interactiveShell.d.ts +6 -1
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +129 -92
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/systemPrompt.d.ts.map +1 -1
- package/dist/shell/systemPrompt.js +13 -33
- package/dist/shell/systemPrompt.js.map +1 -1
- package/dist/shell/terminalInputAdapter.d.ts +75 -83
- package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
- package/dist/shell/terminalInputAdapter.js +159 -220
- package/dist/shell/terminalInputAdapter.js.map +1 -1
- package/dist/shell/vimMode.d.ts +1 -1
- package/dist/shell/vimMode.js +1 -1
- package/dist/tools/buildTools.d.ts +1 -1
- package/dist/tools/buildTools.js +1 -1
- package/dist/tools/diffUtils.d.ts +2 -2
- package/dist/tools/diffUtils.js +2 -2
- package/dist/tools/editTools.js +4 -4
- package/dist/tools/editTools.js.map +1 -1
- package/dist/tools/localExplore.d.ts +3 -3
- package/dist/tools/localExplore.js +3 -3
- package/dist/tools/skillTools.js +2 -2
- package/dist/tools/skillTools.js.map +1 -1
- package/dist/tools/validationTools.js +1 -1
- package/dist/ui/DisplayEventQueue.d.ts +99 -0
- package/dist/ui/DisplayEventQueue.d.ts.map +1 -0
- package/dist/ui/DisplayEventQueue.js +167 -0
- package/dist/ui/DisplayEventQueue.js.map +1 -0
- package/dist/ui/SequentialRenderer.d.ts +69 -0
- package/dist/ui/SequentialRenderer.d.ts.map +1 -0
- package/dist/ui/SequentialRenderer.js +137 -0
- package/dist/ui/SequentialRenderer.js.map +1 -0
- package/dist/ui/ShellUIAdapter.d.ts +19 -12
- package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
- package/dist/ui/ShellUIAdapter.js +73 -56
- package/dist/ui/ShellUIAdapter.js.map +1 -1
- package/dist/ui/UnifiedUIRenderer.d.ts +184 -0
- package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -0
- package/dist/ui/UnifiedUIRenderer.js +567 -0
- package/dist/ui/UnifiedUIRenderer.js.map +1 -0
- package/dist/ui/display.d.ts +100 -173
- package/dist/ui/display.d.ts.map +1 -1
- package/dist/ui/display.js +359 -926
- package/dist/ui/display.js.map +1 -1
- package/dist/ui/errorFormatter.d.ts +1 -1
- package/dist/ui/errorFormatter.js +1 -1
- package/dist/ui/shortcutsHelp.d.ts +6 -6
- package/dist/ui/shortcutsHelp.js +6 -6
- package/dist/ui/streamingFormatter.d.ts +2 -10
- package/dist/ui/streamingFormatter.d.ts.map +1 -1
- package/dist/ui/streamingFormatter.js +9 -59
- package/dist/ui/streamingFormatter.js.map +1 -1
- package/dist/ui/textHighlighter.d.ts +8 -8
- package/dist/ui/textHighlighter.js +9 -9
- package/dist/ui/textHighlighter.js.map +1 -1
- package/dist/ui/theme.d.ts +2 -2
- package/dist/ui/theme.js +4 -4
- package/dist/ui/theme.js.map +1 -1
- package/dist/ui/toolDisplay.d.ts +8 -8
- package/dist/ui/toolDisplay.js +8 -8
- package/package.json +1 -1
- package/dist/shell/terminalInput.d.ts +0 -619
- package/dist/shell/terminalInput.d.ts.map +0 -1
- package/dist/shell/terminalInput.js +0 -2699
- package/dist/shell/terminalInput.js.map +0 -1
|
@@ -1,404 +1,343 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TerminalInputAdapter -
|
|
2
|
+
* TerminalInputAdapter - Compatibility bridge to UnifiedUIRenderer
|
|
3
3
|
*
|
|
4
|
-
* This adapter
|
|
5
|
-
*
|
|
4
|
+
* This adapter provides backward compatibility with the old TerminalInput API
|
|
5
|
+
* while delegating all actual work to the new UnifiedUIRenderer.
|
|
6
|
+
*
|
|
7
|
+
* This allows gradual migration without breaking existing code.
|
|
6
8
|
*/
|
|
7
|
-
import
|
|
8
|
-
import { TerminalInput } from './terminalInput.js';
|
|
9
|
+
import { UnifiedUIRenderer } from '../ui/UnifiedUIRenderer.js';
|
|
9
10
|
/**
|
|
10
|
-
* Adapter that
|
|
11
|
+
* Adapter that bridges old TerminalInput API to new UnifiedUIRenderer
|
|
11
12
|
*/
|
|
12
13
|
export class TerminalInputAdapter {
|
|
13
14
|
inStream;
|
|
14
|
-
|
|
15
|
+
renderer;
|
|
15
16
|
callbacks;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
-
originalEmit = null;
|
|
17
|
+
editMode = 'display-edits';
|
|
18
|
+
scrollbackBuffer = [];
|
|
20
19
|
constructor(inStream, outStream, callbacks) {
|
|
21
20
|
this.inStream = inStream;
|
|
22
21
|
this.callbacks = callbacks;
|
|
23
|
-
this.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
// Wire up events
|
|
29
|
-
this.input.on('submit', (text) => this.callbacks.onSubmit(text));
|
|
30
|
-
this.input.on('queue', (text) => this.callbacks.onQueue(text));
|
|
31
|
-
this.input.on('interrupt', () => this.callbacks.onInterrupt());
|
|
32
|
-
this.input.on('change', (text) => this.callbacks.onChange?.(text));
|
|
33
|
-
this.input.on('mode-change', (mode) => this.callbacks.onEditModeChange?.(mode));
|
|
34
|
-
this.input.on('toggleVerify', () => this.callbacks.onToggleVerify?.());
|
|
35
|
-
this.input.on('toggleAutoContinue', () => this.callbacks.onToggleAutoContinue?.());
|
|
36
|
-
this.input.on('toggleThinking', () => this.callbacks.onToggleThinking?.());
|
|
37
|
-
this.input.on('toggleEditMode', () => {
|
|
38
|
-
const mode = this.input.getEditMode?.() || 'display-edits';
|
|
39
|
-
this.callbacks.onEditModeChange?.(mode);
|
|
40
|
-
});
|
|
41
|
-
this.input.on('clearContext', () => this.callbacks.onClearContext?.());
|
|
22
|
+
this.renderer = new UnifiedUIRenderer(outStream, inStream);
|
|
23
|
+
// Wire up renderer events to callbacks
|
|
24
|
+
this.renderer.on('submit', (text) => this.callbacks.onSubmit(text));
|
|
25
|
+
this.renderer.on('queue', (text) => this.callbacks.onQueue(text));
|
|
26
|
+
this.renderer.on('interrupt', () => this.callbacks.onInterrupt());
|
|
42
27
|
}
|
|
43
28
|
/**
|
|
44
|
-
* Start capturing input
|
|
29
|
+
* Start capturing input
|
|
45
30
|
*/
|
|
46
31
|
start() {
|
|
47
|
-
this.
|
|
48
|
-
// Mouse tracking DISABLED to preserve native text selection
|
|
49
|
-
// Use PgUp/PgDn for scrollback navigation instead of mouse wheel
|
|
50
|
-
// this.input.enableMouseTracking();
|
|
51
|
-
// Set up raw mode
|
|
52
|
-
if (this.inStream.isTTY) {
|
|
53
|
-
this.inStream.setRawMode(true);
|
|
54
|
-
}
|
|
55
|
-
// Resume the input stream - stdin is paused by default and won't emit
|
|
56
|
-
// keypress events until resumed
|
|
57
|
-
this.inStream.resume();
|
|
58
|
-
// Intercept raw data for bracketed paste detection
|
|
59
|
-
this.setupRawDataInterception();
|
|
60
|
-
// Set up keypress handling
|
|
61
|
-
this.setupKeypressHandler();
|
|
62
|
-
// Note: No auto-render here - caller controls when to render
|
|
32
|
+
this.renderer.initialize();
|
|
63
33
|
}
|
|
64
34
|
/**
|
|
65
35
|
* Stop capturing input
|
|
66
36
|
*/
|
|
67
37
|
stop() {
|
|
68
|
-
this.
|
|
69
|
-
// Only disable if it was enabled
|
|
70
|
-
// this.input.disableMouseTracking();
|
|
71
|
-
// Remove handlers
|
|
72
|
-
if (this.rawDataHandler) {
|
|
73
|
-
this.restoreRawDataInterception();
|
|
74
|
-
}
|
|
75
|
-
if (this.keypressHandler && this.inStream) {
|
|
76
|
-
this.inStream.off('keypress', this.keypressHandler);
|
|
77
|
-
this.keypressHandler = null;
|
|
78
|
-
}
|
|
79
|
-
// Pause the input stream
|
|
80
|
-
this.inStream.pause();
|
|
81
|
-
// Restore raw mode
|
|
82
|
-
if (this.inStream.isTTY) {
|
|
83
|
-
this.inStream.setRawMode(false);
|
|
84
|
-
}
|
|
38
|
+
this.renderer.cleanup();
|
|
85
39
|
}
|
|
86
40
|
/**
|
|
87
|
-
* Set streaming mode
|
|
41
|
+
* Set streaming mode
|
|
88
42
|
*/
|
|
89
43
|
setStreaming(streaming) {
|
|
90
|
-
this.
|
|
44
|
+
this.renderer.setMode(streaming ? 'streaming' : 'idle');
|
|
91
45
|
}
|
|
92
46
|
/**
|
|
93
|
-
* Pin top rows (
|
|
47
|
+
* Legacy: Pin top rows (no-op with new renderer)
|
|
94
48
|
*/
|
|
95
|
-
setPinnedHeaderLines(
|
|
96
|
-
|
|
49
|
+
setPinnedHeaderLines(_count) {
|
|
50
|
+
// No-op - new renderer doesn't use pinned headers
|
|
97
51
|
}
|
|
98
52
|
/**
|
|
99
53
|
* Get current buffer content
|
|
100
54
|
*/
|
|
101
55
|
getBuffer() {
|
|
102
|
-
return this.
|
|
56
|
+
return this.renderer.getBuffer();
|
|
103
57
|
}
|
|
104
58
|
/**
|
|
105
59
|
* Set buffer content
|
|
106
60
|
*/
|
|
107
61
|
setBuffer(text, cursorPos) {
|
|
108
|
-
this.
|
|
62
|
+
this.renderer.setBuffer(text, cursorPos);
|
|
109
63
|
}
|
|
110
64
|
/**
|
|
111
65
|
* Clear the buffer
|
|
112
66
|
*/
|
|
113
67
|
clear() {
|
|
114
|
-
this.
|
|
68
|
+
this.renderer.clearBuffer();
|
|
115
69
|
}
|
|
116
70
|
/**
|
|
117
|
-
* Update context usage
|
|
71
|
+
* Update context usage
|
|
118
72
|
*/
|
|
119
|
-
setContextUsage(percentage,
|
|
120
|
-
|
|
73
|
+
setContextUsage(percentage, _autoCompactThreshold) {
|
|
74
|
+
if (percentage !== null) {
|
|
75
|
+
this.renderer.updateStatusMeta({ contextPercent: percentage });
|
|
76
|
+
}
|
|
121
77
|
}
|
|
122
78
|
/**
|
|
123
|
-
* Surface mode
|
|
79
|
+
* Surface mode toggles
|
|
124
80
|
*/
|
|
125
81
|
setModeToggles(options) {
|
|
126
|
-
|
|
82
|
+
// Store for potential future use
|
|
83
|
+
// The renderer handles these through shortcuts
|
|
127
84
|
}
|
|
128
85
|
/**
|
|
129
|
-
* Update
|
|
86
|
+
* Update status message
|
|
130
87
|
*/
|
|
131
88
|
setStatusMessage(message) {
|
|
132
|
-
this.
|
|
89
|
+
this.renderer.updateStatus(message);
|
|
133
90
|
}
|
|
134
91
|
/**
|
|
135
|
-
* Set
|
|
136
|
-
* Both streaming label and override can be displayed simultaneously.
|
|
92
|
+
* Set override status (warnings, errors)
|
|
137
93
|
*/
|
|
138
94
|
setOverrideStatus(message) {
|
|
139
|
-
|
|
95
|
+
if (message) {
|
|
96
|
+
this.renderer.updateStatus(message);
|
|
97
|
+
}
|
|
140
98
|
}
|
|
141
99
|
/**
|
|
142
|
-
* Set
|
|
143
|
-
* Can be shown alongside override status messages.
|
|
100
|
+
* Set streaming label
|
|
144
101
|
*/
|
|
145
102
|
setStreamingLabel(label) {
|
|
146
|
-
|
|
103
|
+
if (label) {
|
|
104
|
+
this.renderer.updateStatus(label);
|
|
105
|
+
}
|
|
147
106
|
}
|
|
148
107
|
/**
|
|
149
|
-
* Surface meta
|
|
108
|
+
* Surface meta status
|
|
150
109
|
*/
|
|
151
110
|
setMetaStatus(meta) {
|
|
152
|
-
|
|
111
|
+
// Update renderer status metadata
|
|
112
|
+
const statusMeta = {};
|
|
113
|
+
if (meta.tokensUsed != null && meta.tokenLimit != null) {
|
|
114
|
+
const percent = meta.tokenLimit > 0
|
|
115
|
+
? Math.round((meta.tokensUsed / meta.tokenLimit) * 100)
|
|
116
|
+
: 0;
|
|
117
|
+
statusMeta.contextPercent = percent;
|
|
118
|
+
}
|
|
119
|
+
this.renderer.updateStatusMeta(statusMeta);
|
|
153
120
|
}
|
|
154
121
|
/**
|
|
155
|
-
* Clear all status
|
|
122
|
+
* Clear all status
|
|
156
123
|
*/
|
|
157
124
|
clearAllStatus() {
|
|
158
|
-
this.
|
|
125
|
+
this.renderer.updateStatus(null);
|
|
159
126
|
}
|
|
160
127
|
/**
|
|
161
|
-
*
|
|
128
|
+
* Set model context
|
|
162
129
|
*/
|
|
163
130
|
setModelContext(options) {
|
|
164
|
-
this.
|
|
131
|
+
this.renderer.updateStatusMeta({
|
|
132
|
+
model: options.model || undefined,
|
|
133
|
+
provider: options.provider || undefined,
|
|
134
|
+
});
|
|
165
135
|
}
|
|
166
136
|
/**
|
|
167
|
-
* Set available slash commands
|
|
168
|
-
* When user types "/" these commands are shown for selection.
|
|
137
|
+
* Set available slash commands
|
|
169
138
|
*/
|
|
170
139
|
setAvailableCommands(commands) {
|
|
171
|
-
this.
|
|
140
|
+
this.renderer.setAvailableCommands(commands);
|
|
172
141
|
}
|
|
173
142
|
/**
|
|
174
|
-
* Set
|
|
143
|
+
* Set edit mode
|
|
175
144
|
*/
|
|
176
145
|
setEditMode(mode) {
|
|
177
|
-
this.
|
|
146
|
+
this.editMode = mode;
|
|
178
147
|
}
|
|
179
148
|
/**
|
|
180
|
-
*
|
|
149
|
+
* Apply edit mode (alias)
|
|
150
|
+
*/
|
|
151
|
+
applyEditMode(mode) {
|
|
152
|
+
this.setEditMode(mode);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Get edit mode
|
|
181
156
|
*/
|
|
182
157
|
getEditMode() {
|
|
183
|
-
return this.
|
|
158
|
+
return this.editMode;
|
|
184
159
|
}
|
|
185
160
|
/**
|
|
186
|
-
* Get queued inputs
|
|
161
|
+
* Get queued inputs (legacy - renderer handles this internally)
|
|
187
162
|
*/
|
|
188
163
|
getQueue() {
|
|
189
|
-
return
|
|
164
|
+
return [];
|
|
190
165
|
}
|
|
191
166
|
/**
|
|
192
|
-
* Dequeue
|
|
167
|
+
* Dequeue (legacy - no-op)
|
|
193
168
|
*/
|
|
194
169
|
dequeue() {
|
|
195
|
-
return
|
|
170
|
+
return undefined;
|
|
196
171
|
}
|
|
197
172
|
/**
|
|
198
|
-
* Force
|
|
173
|
+
* Force render
|
|
199
174
|
*/
|
|
200
175
|
render() {
|
|
201
|
-
this.
|
|
176
|
+
this.renderer.render();
|
|
202
177
|
}
|
|
203
178
|
/**
|
|
204
|
-
* Force
|
|
179
|
+
* Force render (alias)
|
|
205
180
|
*/
|
|
206
181
|
forceRender() {
|
|
207
|
-
this.
|
|
182
|
+
this.renderer.render();
|
|
208
183
|
}
|
|
209
184
|
/**
|
|
210
|
-
* Stream content
|
|
211
|
-
* Automatically enables scroll region on first call.
|
|
185
|
+
* Stream content (renderer handles this via Display now)
|
|
212
186
|
*/
|
|
213
|
-
streamContent(
|
|
214
|
-
|
|
187
|
+
streamContent(_content) {
|
|
188
|
+
// Content streaming is handled by Display -> renderer.addEvent()
|
|
215
189
|
}
|
|
216
190
|
/**
|
|
217
|
-
* Enable scroll region (
|
|
218
|
-
* Chat box is pinned below scroll region.
|
|
191
|
+
* Enable scroll region (legacy - no-op)
|
|
219
192
|
*/
|
|
220
|
-
enableScrollRegion(
|
|
221
|
-
|
|
193
|
+
enableScrollRegion(_options) {
|
|
194
|
+
// No-op - natural scrolling
|
|
222
195
|
}
|
|
223
196
|
/**
|
|
224
|
-
*
|
|
225
|
-
* Write content directly into the scroll region.
|
|
197
|
+
* Legacy: Write to scroll region
|
|
226
198
|
*/
|
|
227
|
-
writeToScrollRegion(
|
|
228
|
-
|
|
199
|
+
writeToScrollRegion(_content) {
|
|
200
|
+
// No-op - use Display.stream() instead
|
|
229
201
|
}
|
|
230
202
|
/**
|
|
231
|
-
*
|
|
203
|
+
* Check if scroll region active (always false)
|
|
232
204
|
*/
|
|
233
205
|
isScrollRegionActive() {
|
|
234
|
-
return
|
|
206
|
+
return false;
|
|
235
207
|
}
|
|
236
208
|
/**
|
|
237
|
-
* Enter alternate screen
|
|
209
|
+
* Enter alternate screen (no-op)
|
|
238
210
|
*/
|
|
239
211
|
enterAlternateScreen() {
|
|
240
|
-
|
|
212
|
+
// No-op - using native scrollback
|
|
241
213
|
}
|
|
242
214
|
/**
|
|
243
|
-
* Exit alternate screen
|
|
215
|
+
* Exit alternate screen (no-op)
|
|
244
216
|
*/
|
|
245
217
|
exitAlternateScreen() {
|
|
246
|
-
|
|
218
|
+
// No-op
|
|
247
219
|
}
|
|
248
220
|
/**
|
|
249
|
-
* Clear
|
|
250
|
-
* This removes all content including the launching command.
|
|
221
|
+
* Clear screen
|
|
251
222
|
*/
|
|
252
223
|
clearScreen() {
|
|
253
|
-
this
|
|
224
|
+
// Renderer handles this
|
|
254
225
|
}
|
|
255
226
|
/**
|
|
256
|
-
* Enter streaming scroll region
|
|
257
|
-
* Call once at the start of streaming.
|
|
227
|
+
* Enter streaming scroll region (no-op)
|
|
258
228
|
*/
|
|
259
|
-
enterStreamingScrollRegion(
|
|
260
|
-
this.
|
|
229
|
+
enterStreamingScrollRegion(_options) {
|
|
230
|
+
this.renderer.setMode('streaming');
|
|
261
231
|
}
|
|
262
232
|
/**
|
|
263
|
-
* Exit streaming scroll region
|
|
264
|
-
* Call once at the end of streaming.
|
|
233
|
+
* Exit streaming scroll region
|
|
265
234
|
*/
|
|
266
|
-
exitStreamingScrollRegion(
|
|
267
|
-
this.
|
|
235
|
+
exitStreamingScrollRegion(_options) {
|
|
236
|
+
this.renderer.setMode('idle');
|
|
268
237
|
}
|
|
269
238
|
/**
|
|
270
|
-
* Get scrollback buffer
|
|
239
|
+
* Get scrollback buffer
|
|
271
240
|
*/
|
|
272
241
|
getScrollbackBuffer() {
|
|
273
|
-
return this.
|
|
242
|
+
return this.scrollbackBuffer;
|
|
274
243
|
}
|
|
275
244
|
/**
|
|
276
|
-
* Load scrollback buffer
|
|
245
|
+
* Load scrollback buffer
|
|
277
246
|
*/
|
|
278
247
|
loadScrollbackBuffer(lines) {
|
|
279
|
-
this.
|
|
248
|
+
this.scrollbackBuffer = lines;
|
|
280
249
|
}
|
|
281
250
|
/**
|
|
282
|
-
* Clear scrollback
|
|
251
|
+
* Clear scrollback
|
|
283
252
|
*/
|
|
284
253
|
clearScrollbackBuffer() {
|
|
285
|
-
this.
|
|
254
|
+
this.scrollbackBuffer = [];
|
|
286
255
|
}
|
|
287
256
|
/**
|
|
288
|
-
* Check if alternate screen
|
|
257
|
+
* Check if alternate screen active (always false)
|
|
289
258
|
*/
|
|
290
259
|
isAlternateScreenActive() {
|
|
291
|
-
return
|
|
260
|
+
return false;
|
|
292
261
|
}
|
|
293
262
|
/**
|
|
294
|
-
* Get
|
|
263
|
+
* Get scrollback snapshot
|
|
295
264
|
*/
|
|
296
265
|
getScrollbackSnapshot() {
|
|
297
|
-
return this.
|
|
266
|
+
return this.scrollbackBuffer;
|
|
298
267
|
}
|
|
299
268
|
/**
|
|
300
|
-
* Reset content position
|
|
269
|
+
* Reset content position (no-op)
|
|
301
270
|
*/
|
|
302
271
|
resetContentPosition() {
|
|
303
|
-
|
|
272
|
+
// No-op
|
|
304
273
|
}
|
|
305
274
|
/**
|
|
306
|
-
* Set
|
|
275
|
+
* Set content row (no-op)
|
|
307
276
|
*/
|
|
308
|
-
setContentRow(
|
|
309
|
-
|
|
277
|
+
setContentRow(_row) {
|
|
278
|
+
// No-op
|
|
310
279
|
}
|
|
311
280
|
/**
|
|
312
|
-
* Get
|
|
281
|
+
* Get content row
|
|
313
282
|
*/
|
|
314
283
|
getContentRow() {
|
|
315
|
-
return
|
|
284
|
+
return 0;
|
|
316
285
|
}
|
|
317
286
|
/**
|
|
318
|
-
* Handle
|
|
287
|
+
* Handle resize
|
|
319
288
|
*/
|
|
320
289
|
handleResize() {
|
|
321
|
-
this.
|
|
290
|
+
this.renderer.render();
|
|
322
291
|
}
|
|
323
292
|
/**
|
|
324
|
-
* Dispose
|
|
293
|
+
* Dispose
|
|
325
294
|
*/
|
|
326
295
|
dispose() {
|
|
327
|
-
this.
|
|
328
|
-
this.input.dispose();
|
|
296
|
+
this.renderer.cleanup();
|
|
329
297
|
}
|
|
330
298
|
/**
|
|
331
|
-
* Get
|
|
299
|
+
* Get underlying renderer (replaces getTerminalInput)
|
|
332
300
|
*/
|
|
333
301
|
getTerminalInput() {
|
|
334
|
-
return
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
const str = typeof data === 'string' ? data : data.toString();
|
|
357
|
-
const result = self.input.processRawData(str);
|
|
358
|
-
if (result.consumed) {
|
|
359
|
-
// Data was consumed by paste handler
|
|
360
|
-
if (result.passthrough) {
|
|
361
|
-
// Pass through remaining data
|
|
362
|
-
return origEmit(event, result.passthrough);
|
|
363
|
-
}
|
|
364
|
-
return true;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
return origEmit(event, ...args);
|
|
302
|
+
return {
|
|
303
|
+
getUiSnapshot: () => ({
|
|
304
|
+
buffer: this.renderer.getBuffer(),
|
|
305
|
+
cursor: this.renderer.getBuffer().length,
|
|
306
|
+
suggestions: [],
|
|
307
|
+
statusMessage: null,
|
|
308
|
+
overrideStatusMessage: null,
|
|
309
|
+
streamingLabel: null,
|
|
310
|
+
statusSummary: null,
|
|
311
|
+
meta: {},
|
|
312
|
+
modeToggles: {},
|
|
313
|
+
modelContext: {},
|
|
314
|
+
render: {
|
|
315
|
+
inputLines: [this.renderer.getBuffer()],
|
|
316
|
+
cursorLine: 0,
|
|
317
|
+
cursorCol: this.renderer.getBuffer().length,
|
|
318
|
+
promptChar: '> ',
|
|
319
|
+
continuationChar: '│ ',
|
|
320
|
+
metaLines: [],
|
|
321
|
+
controlLines: [],
|
|
322
|
+
},
|
|
323
|
+
}),
|
|
368
324
|
};
|
|
369
325
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
326
|
+
/**
|
|
327
|
+
* Get UI snapshot
|
|
328
|
+
*/
|
|
329
|
+
getUiSnapshot() {
|
|
330
|
+
return this.getTerminalInput().getUiSnapshot();
|
|
375
331
|
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
const keyInfo = {
|
|
382
|
-
name: key?.name,
|
|
383
|
-
ctrl: key?.ctrl,
|
|
384
|
-
meta: key?.meta,
|
|
385
|
-
shift: key?.shift,
|
|
386
|
-
sequence: key?.sequence,
|
|
387
|
-
};
|
|
388
|
-
// Notify about Ctrl+C before TerminalInput handles the key (so buffer state is accurate)
|
|
389
|
-
if (keyInfo.ctrl && keyInfo.name === 'c' && this.callbacks.onCtrlC) {
|
|
390
|
-
this.callbacks.onCtrlC({
|
|
391
|
-
hadBuffer: this.input.getBuffer().length > 0,
|
|
392
|
-
});
|
|
393
|
-
}
|
|
394
|
-
this.input.handleKeypress(str, keyInfo);
|
|
395
|
-
};
|
|
396
|
-
// Use prependListener to handle before readline
|
|
397
|
-
this.inStream.prependListener('keypress', this.keypressHandler);
|
|
332
|
+
/**
|
|
333
|
+
* Register output interceptor (no-op - renderer handles this)
|
|
334
|
+
*/
|
|
335
|
+
registerOutputInterceptor(_display) {
|
|
336
|
+
// No-op - Display already connected to renderer
|
|
398
337
|
}
|
|
399
338
|
}
|
|
400
339
|
/**
|
|
401
|
-
* Create a
|
|
340
|
+
* Create a terminal input adapter
|
|
402
341
|
*/
|
|
403
342
|
export function createTerminalInput(callbacks, inStream = process.stdin, outStream = process.stdout) {
|
|
404
343
|
return new TerminalInputAdapter(inStream, outStream, callbacks);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminalInputAdapter.js","sourceRoot":"","sources":["../../src/shell/terminalInputAdapter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"terminalInputAdapter.js","sourceRoot":"","sources":["../../src/shell/terminalInputAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,iBAAiB,EAA0B,MAAM,4BAA4B,CAAC;AA8BvF;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAOZ;IANF,QAAQ,CAAoB;IAC5B,SAAS,CAAwB;IAC1C,QAAQ,GAAkB,eAAe,CAAC;IAC1C,gBAAgB,GAAa,EAAE,CAAC;IAExC,YACmB,QAA2B,EAC5C,SAA6B,EAC7B,SAAgC;QAFf,aAAQ,GAAR,QAAQ,CAAmB;QAI5C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAiB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAE3D,uCAAuC;QACvC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5E,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1E,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,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,EAAE,IAAI;oBACtB,SAAS,EAAE,EAAE;oBACb,YAAY,EAAE,EAAE;iBACjB;aACF,CAAC;SACH,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC,aAAa,EAAE,CAAC;IACjD,CAAC;IAED;;OAEG;IACH,yBAAyB,CAAC,QAAa;QACrC,gDAAgD;IAClD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,SAAgC,EAChC,WAA8B,OAAO,CAAC,KAAK,EAC3C,YAAgC,OAAO,CAAC,MAAM;IAE9C,OAAO,IAAI,oBAAoB,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAClE,CAAC"}
|
package/dist/shell/vimMode.d.ts
CHANGED
package/dist/shell/vimMode.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Build and Test Tools with AI-Powered Error Analysis
|
|
3
3
|
*
|
|
4
4
|
* Provides run_build, run_tests, and check_package_info tools that automatically
|
|
5
|
-
* analyze errors and suggest fixes, following
|
|
5
|
+
* analyze errors and suggest fixes, following Erosolar-CLI's approach.
|
|
6
6
|
*/
|
|
7
7
|
import type { ToolDefinition } from '../core/toolRuntime.js';
|
|
8
8
|
export declare function createBuildTools(workingDir: string): ToolDefinition[];
|
package/dist/tools/buildTools.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Build and Test Tools with AI-Powered Error Analysis
|
|
3
3
|
*
|
|
4
4
|
* Provides run_build, run_tests, and check_package_info tools that automatically
|
|
5
|
-
* analyze errors and suggest fixes, following
|
|
5
|
+
* analyze errors and suggest fixes, following Erosolar-CLI's approach.
|
|
6
6
|
*/
|
|
7
7
|
import { exec } from 'node:child_process';
|
|
8
8
|
import { existsSync, readFileSync } from 'node:fs';
|