erosolar-cli 1.7.429 → 1.7.431
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/preferences.d.ts +3 -1
- package/dist/core/preferences.d.ts.map +1 -1
- package/dist/core/preferences.js +4 -2
- package/dist/core/preferences.js.map +1 -1
- package/dist/core/validationRunner.d.ts +1 -1
- package/dist/core/validationRunner.js +1 -1
- package/dist/shell/interactiveShell.d.ts +5 -1
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +120 -88
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/systemPrompt.d.ts.map +1 -1
- package/dist/shell/systemPrompt.js +14 -34
- package/dist/shell/systemPrompt.js.map +1 -1
- package/dist/shell/terminalInputAdapter.d.ts +77 -85
- package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
- package/dist/shell/terminalInputAdapter.js +163 -223
- 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 +18 -6
- package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
- package/dist/ui/ShellUIAdapter.js +65 -14
- package/dist/ui/ShellUIAdapter.js.map +1 -1
- package/dist/ui/UnifiedUIRenderer.d.ts +188 -0
- package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -0
- package/dist/ui/UnifiedUIRenderer.js +581 -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 +364 -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 -5
- package/dist/ui/streamingFormatter.d.ts.map +1 -1
- package/dist/ui/streamingFormatter.js +9 -33
- 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,406 +1,346 @@
|
|
|
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
|
-
|
|
19
|
-
originalEmit = null;
|
|
20
|
-
constructor(inStream, outStream, callbacks) {
|
|
17
|
+
editMode = 'display-edits';
|
|
18
|
+
scrollbackBuffer = [];
|
|
19
|
+
constructor(inStream, outStream, callbacks, existingRenderer) {
|
|
21
20
|
this.inStream = inStream;
|
|
22
21
|
this.callbacks = callbacks;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
+
// Use existing renderer if provided, otherwise create new one
|
|
23
|
+
this.renderer = existingRenderer ?? new UnifiedUIRenderer(outStream, inStream);
|
|
24
|
+
// Wire up renderer events to callbacks
|
|
25
|
+
this.renderer.on('submit', (text) => this.callbacks.onSubmit(text));
|
|
26
|
+
this.renderer.on('queue', (text) => this.callbacks.onQueue(text));
|
|
27
|
+
this.renderer.on('interrupt', () => this.callbacks.onInterrupt());
|
|
42
28
|
}
|
|
43
29
|
/**
|
|
44
|
-
* Start capturing input
|
|
30
|
+
* Start capturing input
|
|
45
31
|
*/
|
|
46
32
|
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
|
|
33
|
+
this.renderer.initialize();
|
|
63
34
|
}
|
|
64
35
|
/**
|
|
65
36
|
* Stop capturing input
|
|
66
37
|
*/
|
|
67
38
|
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
|
-
}
|
|
39
|
+
this.renderer.cleanup();
|
|
85
40
|
}
|
|
86
41
|
/**
|
|
87
|
-
* Set streaming mode
|
|
42
|
+
* Set streaming mode
|
|
88
43
|
*/
|
|
89
44
|
setStreaming(streaming) {
|
|
90
|
-
this.
|
|
45
|
+
this.renderer.setMode(streaming ? 'streaming' : 'idle');
|
|
91
46
|
}
|
|
92
47
|
/**
|
|
93
|
-
* Pin top rows (
|
|
48
|
+
* Legacy: Pin top rows (no-op with new renderer)
|
|
94
49
|
*/
|
|
95
|
-
setPinnedHeaderLines(
|
|
96
|
-
|
|
50
|
+
setPinnedHeaderLines(_count) {
|
|
51
|
+
// No-op - new renderer doesn't use pinned headers
|
|
97
52
|
}
|
|
98
53
|
/**
|
|
99
54
|
* Get current buffer content
|
|
100
55
|
*/
|
|
101
56
|
getBuffer() {
|
|
102
|
-
return this.
|
|
57
|
+
return this.renderer.getBuffer();
|
|
103
58
|
}
|
|
104
59
|
/**
|
|
105
60
|
* Set buffer content
|
|
106
61
|
*/
|
|
107
62
|
setBuffer(text, cursorPos) {
|
|
108
|
-
this.
|
|
63
|
+
this.renderer.setBuffer(text, cursorPos);
|
|
109
64
|
}
|
|
110
65
|
/**
|
|
111
66
|
* Clear the buffer
|
|
112
67
|
*/
|
|
113
68
|
clear() {
|
|
114
|
-
this.
|
|
69
|
+
this.renderer.clearBuffer();
|
|
115
70
|
}
|
|
116
71
|
/**
|
|
117
|
-
* Update context usage
|
|
72
|
+
* Update context usage
|
|
118
73
|
*/
|
|
119
|
-
setContextUsage(percentage,
|
|
120
|
-
|
|
74
|
+
setContextUsage(percentage, _autoCompactThreshold) {
|
|
75
|
+
if (percentage !== null) {
|
|
76
|
+
this.renderer.updateStatusMeta({ contextPercent: percentage });
|
|
77
|
+
}
|
|
121
78
|
}
|
|
122
79
|
/**
|
|
123
|
-
* Surface mode
|
|
80
|
+
* Surface mode toggles
|
|
124
81
|
*/
|
|
125
82
|
setModeToggles(options) {
|
|
126
|
-
|
|
83
|
+
// Store for potential future use
|
|
84
|
+
// The renderer handles these through shortcuts
|
|
127
85
|
}
|
|
128
86
|
/**
|
|
129
|
-
* Update
|
|
87
|
+
* Update status message
|
|
130
88
|
*/
|
|
131
89
|
setStatusMessage(message) {
|
|
132
|
-
this.
|
|
90
|
+
this.renderer.updateStatus(message);
|
|
133
91
|
}
|
|
134
92
|
/**
|
|
135
|
-
* Set
|
|
136
|
-
* Both streaming label and override can be displayed simultaneously.
|
|
93
|
+
* Set override status (warnings, errors)
|
|
137
94
|
*/
|
|
138
95
|
setOverrideStatus(message) {
|
|
139
|
-
|
|
96
|
+
if (message) {
|
|
97
|
+
this.renderer.updateStatus(message);
|
|
98
|
+
}
|
|
140
99
|
}
|
|
141
100
|
/**
|
|
142
|
-
* Set
|
|
143
|
-
* Can be shown alongside override status messages.
|
|
101
|
+
* Set streaming label
|
|
144
102
|
*/
|
|
145
103
|
setStreamingLabel(label) {
|
|
146
|
-
|
|
104
|
+
if (label) {
|
|
105
|
+
this.renderer.updateStatus(label);
|
|
106
|
+
}
|
|
147
107
|
}
|
|
148
108
|
/**
|
|
149
|
-
* Surface meta
|
|
109
|
+
* Surface meta status
|
|
150
110
|
*/
|
|
151
111
|
setMetaStatus(meta) {
|
|
152
|
-
|
|
112
|
+
// Update renderer status metadata
|
|
113
|
+
const statusMeta = {};
|
|
114
|
+
if (meta.tokensUsed != null && meta.tokenLimit != null) {
|
|
115
|
+
const percent = meta.tokenLimit > 0
|
|
116
|
+
? Math.round((meta.tokensUsed / meta.tokenLimit) * 100)
|
|
117
|
+
: 0;
|
|
118
|
+
statusMeta.contextPercent = percent;
|
|
119
|
+
}
|
|
120
|
+
this.renderer.updateStatusMeta(statusMeta);
|
|
153
121
|
}
|
|
154
122
|
/**
|
|
155
|
-
* Clear all status
|
|
123
|
+
* Clear all status
|
|
156
124
|
*/
|
|
157
125
|
clearAllStatus() {
|
|
158
|
-
this.
|
|
126
|
+
this.renderer.updateStatus(null);
|
|
159
127
|
}
|
|
160
128
|
/**
|
|
161
|
-
*
|
|
129
|
+
* Set model context
|
|
162
130
|
*/
|
|
163
131
|
setModelContext(options) {
|
|
164
|
-
this.
|
|
132
|
+
this.renderer.updateStatusMeta({
|
|
133
|
+
model: options.model || undefined,
|
|
134
|
+
provider: options.provider || undefined,
|
|
135
|
+
});
|
|
165
136
|
}
|
|
166
137
|
/**
|
|
167
|
-
* Set available slash commands
|
|
168
|
-
* When user types "/" these commands are shown for selection.
|
|
138
|
+
* Set available slash commands
|
|
169
139
|
*/
|
|
170
140
|
setAvailableCommands(commands) {
|
|
171
|
-
this.
|
|
141
|
+
this.renderer.setAvailableCommands(commands);
|
|
172
142
|
}
|
|
173
143
|
/**
|
|
174
|
-
* Set
|
|
144
|
+
* Set edit mode
|
|
175
145
|
*/
|
|
176
146
|
setEditMode(mode) {
|
|
177
|
-
this.
|
|
147
|
+
this.editMode = mode;
|
|
178
148
|
}
|
|
179
149
|
/**
|
|
180
|
-
*
|
|
150
|
+
* Apply edit mode (alias)
|
|
151
|
+
*/
|
|
152
|
+
applyEditMode(mode) {
|
|
153
|
+
this.setEditMode(mode);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Get edit mode
|
|
181
157
|
*/
|
|
182
158
|
getEditMode() {
|
|
183
|
-
return this.
|
|
159
|
+
return this.editMode;
|
|
184
160
|
}
|
|
185
161
|
/**
|
|
186
|
-
* Get queued inputs
|
|
162
|
+
* Get queued inputs (legacy - renderer handles this internally)
|
|
187
163
|
*/
|
|
188
164
|
getQueue() {
|
|
189
|
-
return
|
|
165
|
+
return [];
|
|
190
166
|
}
|
|
191
167
|
/**
|
|
192
|
-
* Dequeue
|
|
168
|
+
* Dequeue (legacy - no-op)
|
|
193
169
|
*/
|
|
194
170
|
dequeue() {
|
|
195
|
-
return
|
|
171
|
+
return undefined;
|
|
196
172
|
}
|
|
197
173
|
/**
|
|
198
|
-
* Force
|
|
174
|
+
* Force render
|
|
199
175
|
*/
|
|
200
176
|
render() {
|
|
201
|
-
this.
|
|
177
|
+
this.renderer.render();
|
|
202
178
|
}
|
|
203
179
|
/**
|
|
204
|
-
* Force
|
|
180
|
+
* Force render (alias)
|
|
205
181
|
*/
|
|
206
182
|
forceRender() {
|
|
207
|
-
this.
|
|
183
|
+
this.renderer.render();
|
|
208
184
|
}
|
|
209
185
|
/**
|
|
210
|
-
* Stream content
|
|
211
|
-
* Automatically enables scroll region on first call.
|
|
186
|
+
* Stream content (renderer handles this via Display now)
|
|
212
187
|
*/
|
|
213
|
-
streamContent(
|
|
214
|
-
|
|
188
|
+
streamContent(_content) {
|
|
189
|
+
// Content streaming is handled by Display -> renderer.addEvent()
|
|
215
190
|
}
|
|
216
191
|
/**
|
|
217
|
-
* Enable scroll region (
|
|
218
|
-
* Chat box is pinned below scroll region.
|
|
192
|
+
* Enable scroll region (legacy - no-op)
|
|
219
193
|
*/
|
|
220
|
-
enableScrollRegion(
|
|
221
|
-
|
|
194
|
+
enableScrollRegion(_options) {
|
|
195
|
+
// No-op - natural scrolling
|
|
222
196
|
}
|
|
223
197
|
/**
|
|
224
|
-
*
|
|
225
|
-
* Write content directly into the scroll region.
|
|
198
|
+
* Legacy: Write to scroll region
|
|
226
199
|
*/
|
|
227
|
-
writeToScrollRegion(
|
|
228
|
-
|
|
200
|
+
writeToScrollRegion(_content) {
|
|
201
|
+
// No-op - use Display.stream() instead
|
|
229
202
|
}
|
|
230
203
|
/**
|
|
231
|
-
*
|
|
204
|
+
* Check if scroll region active (always false)
|
|
232
205
|
*/
|
|
233
206
|
isScrollRegionActive() {
|
|
234
|
-
return
|
|
207
|
+
return false;
|
|
235
208
|
}
|
|
236
209
|
/**
|
|
237
|
-
* Enter alternate screen
|
|
210
|
+
* Enter alternate screen (no-op)
|
|
238
211
|
*/
|
|
239
212
|
enterAlternateScreen() {
|
|
240
|
-
|
|
213
|
+
// No-op - using native scrollback
|
|
241
214
|
}
|
|
242
215
|
/**
|
|
243
|
-
* Exit alternate screen
|
|
216
|
+
* Exit alternate screen (no-op)
|
|
244
217
|
*/
|
|
245
218
|
exitAlternateScreen() {
|
|
246
|
-
|
|
219
|
+
// No-op
|
|
247
220
|
}
|
|
248
221
|
/**
|
|
249
|
-
* Clear
|
|
250
|
-
* This removes all content including the launching command.
|
|
222
|
+
* Clear screen
|
|
251
223
|
*/
|
|
252
224
|
clearScreen() {
|
|
253
|
-
this
|
|
225
|
+
// Renderer handles this
|
|
254
226
|
}
|
|
255
227
|
/**
|
|
256
|
-
* Enter streaming scroll region
|
|
257
|
-
* Call once at the start of streaming.
|
|
228
|
+
* Enter streaming scroll region (no-op)
|
|
258
229
|
*/
|
|
259
|
-
enterStreamingScrollRegion(
|
|
260
|
-
this.
|
|
230
|
+
enterStreamingScrollRegion(_options) {
|
|
231
|
+
this.renderer.setMode('streaming');
|
|
261
232
|
}
|
|
262
233
|
/**
|
|
263
|
-
* Exit streaming scroll region
|
|
264
|
-
* Call once at the end of streaming.
|
|
234
|
+
* Exit streaming scroll region
|
|
265
235
|
*/
|
|
266
|
-
exitStreamingScrollRegion(
|
|
267
|
-
this.
|
|
236
|
+
exitStreamingScrollRegion(_options) {
|
|
237
|
+
this.renderer.setMode('idle');
|
|
268
238
|
}
|
|
269
239
|
/**
|
|
270
|
-
* Get scrollback buffer
|
|
240
|
+
* Get scrollback buffer
|
|
271
241
|
*/
|
|
272
242
|
getScrollbackBuffer() {
|
|
273
|
-
return this.
|
|
243
|
+
return this.scrollbackBuffer;
|
|
274
244
|
}
|
|
275
245
|
/**
|
|
276
|
-
* Load scrollback buffer
|
|
246
|
+
* Load scrollback buffer
|
|
277
247
|
*/
|
|
278
248
|
loadScrollbackBuffer(lines) {
|
|
279
|
-
this.
|
|
249
|
+
this.scrollbackBuffer = lines;
|
|
280
250
|
}
|
|
281
251
|
/**
|
|
282
|
-
* Clear scrollback
|
|
252
|
+
* Clear scrollback
|
|
283
253
|
*/
|
|
284
254
|
clearScrollbackBuffer() {
|
|
285
|
-
this.
|
|
255
|
+
this.scrollbackBuffer = [];
|
|
286
256
|
}
|
|
287
257
|
/**
|
|
288
|
-
* Check if alternate screen
|
|
258
|
+
* Check if alternate screen active (always false)
|
|
289
259
|
*/
|
|
290
260
|
isAlternateScreenActive() {
|
|
291
|
-
return
|
|
261
|
+
return false;
|
|
292
262
|
}
|
|
293
263
|
/**
|
|
294
|
-
* Get
|
|
264
|
+
* Get scrollback snapshot
|
|
295
265
|
*/
|
|
296
266
|
getScrollbackSnapshot() {
|
|
297
|
-
return this.
|
|
267
|
+
return this.scrollbackBuffer;
|
|
298
268
|
}
|
|
299
269
|
/**
|
|
300
|
-
* Reset content position
|
|
270
|
+
* Reset content position (no-op)
|
|
301
271
|
*/
|
|
302
272
|
resetContentPosition() {
|
|
303
|
-
|
|
273
|
+
// No-op
|
|
304
274
|
}
|
|
305
275
|
/**
|
|
306
|
-
* Set
|
|
276
|
+
* Set content row (no-op)
|
|
307
277
|
*/
|
|
308
|
-
setContentRow(
|
|
309
|
-
|
|
278
|
+
setContentRow(_row) {
|
|
279
|
+
// No-op
|
|
310
280
|
}
|
|
311
281
|
/**
|
|
312
|
-
* Get
|
|
282
|
+
* Get content row
|
|
313
283
|
*/
|
|
314
284
|
getContentRow() {
|
|
315
|
-
return
|
|
285
|
+
return 0;
|
|
316
286
|
}
|
|
317
287
|
/**
|
|
318
|
-
* Handle
|
|
288
|
+
* Handle resize
|
|
319
289
|
*/
|
|
320
290
|
handleResize() {
|
|
321
|
-
this.
|
|
291
|
+
this.renderer.render();
|
|
322
292
|
}
|
|
323
293
|
/**
|
|
324
|
-
* Dispose
|
|
294
|
+
* Dispose
|
|
325
295
|
*/
|
|
326
296
|
dispose() {
|
|
327
|
-
this.
|
|
328
|
-
this.input.dispose();
|
|
297
|
+
this.renderer.cleanup();
|
|
329
298
|
}
|
|
330
299
|
/**
|
|
331
|
-
* Get
|
|
300
|
+
* Get underlying renderer (replaces getTerminalInput)
|
|
332
301
|
*/
|
|
333
302
|
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);
|
|
303
|
+
return {
|
|
304
|
+
getUiSnapshot: () => ({
|
|
305
|
+
buffer: this.renderer.getBuffer(),
|
|
306
|
+
cursor: this.renderer.getBuffer().length,
|
|
307
|
+
suggestions: [],
|
|
308
|
+
statusMessage: null,
|
|
309
|
+
overrideStatusMessage: null,
|
|
310
|
+
streamingLabel: null,
|
|
311
|
+
statusSummary: null,
|
|
312
|
+
meta: {},
|
|
313
|
+
modeToggles: {},
|
|
314
|
+
modelContext: {},
|
|
315
|
+
render: {
|
|
316
|
+
inputLines: [this.renderer.getBuffer()],
|
|
317
|
+
cursorLine: 0,
|
|
318
|
+
cursorCol: this.renderer.getBuffer().length,
|
|
319
|
+
promptChar: '> ',
|
|
320
|
+
continuationChar: '│ ',
|
|
321
|
+
metaLines: [],
|
|
322
|
+
controlLines: [],
|
|
323
|
+
},
|
|
324
|
+
}),
|
|
368
325
|
};
|
|
369
326
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
327
|
+
/**
|
|
328
|
+
* Get UI snapshot
|
|
329
|
+
*/
|
|
330
|
+
getUiSnapshot() {
|
|
331
|
+
return this.getTerminalInput().getUiSnapshot();
|
|
375
332
|
}
|
|
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);
|
|
333
|
+
/**
|
|
334
|
+
* Register output interceptor (no-op - renderer handles this)
|
|
335
|
+
*/
|
|
336
|
+
registerOutputInterceptor(_display) {
|
|
337
|
+
// No-op - Display already connected to renderer
|
|
398
338
|
}
|
|
399
339
|
}
|
|
400
340
|
/**
|
|
401
|
-
* Create a
|
|
341
|
+
* Create a terminal input adapter
|
|
402
342
|
*/
|
|
403
|
-
export function createTerminalInput(callbacks, inStream = process.stdin, outStream = process.stdout) {
|
|
404
|
-
return new TerminalInputAdapter(inStream, outStream, callbacks);
|
|
343
|
+
export function createTerminalInput(callbacks, inStream = process.stdin, outStream = process.stdout, existingRenderer) {
|
|
344
|
+
return new TerminalInputAdapter(inStream, outStream, callbacks, existingRenderer);
|
|
405
345
|
}
|
|
406
346
|
//# sourceMappingURL=terminalInputAdapter.js.map
|
|
@@ -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,EAChC,gBAAoC;QAHnB,aAAQ,GAAR,QAAQ,CAAmB;QAK5C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,8DAA8D;QAC9D,IAAI,CAAC,QAAQ,GAAG,gBAAgB,IAAI,IAAI,iBAAiB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC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B,qBAAqB,EAAE,IAAI;gBAC3B,cAAc,EAAE,IAAI;gBACpB,aAAa,EAAE,IAAI;gBACnB,IAAI,EAAE,EAAE;gBACR,WAAW,EAAE,EAAE;gBACf,YAAY,EAAE,EAAE;gBAChB,MAAM,EAAE;oBACN,UAAU,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;oBACvC,UAAU,EAAE,CAAC;oBACb,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,MAAM;oBAC3C,UAAU,EAAE,IAAI;oBAChB,gBAAgB,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,EAC9C,gBAAoC;IAEpC,OAAO,IAAI,oBAAoB,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;AACpF,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';
|