erosolar-cli 1.7.194 → 1.7.196
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/agent.d.ts +6 -0
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/agent.js +10 -1
- package/dist/core/agent.js.map +1 -1
- package/dist/core/errors/errorUtils.d.ts +87 -0
- package/dist/core/errors/errorUtils.d.ts.map +1 -0
- package/dist/core/errors/errorUtils.js +158 -0
- package/dist/core/errors/errorUtils.js.map +1 -0
- package/dist/core/resultVerification.js.map +1 -1
- package/dist/core/toolValidation.d.ts +117 -0
- package/dist/core/toolValidation.d.ts.map +1 -0
- package/dist/core/toolValidation.js +282 -0
- package/dist/core/toolValidation.js.map +1 -0
- package/dist/core/types/utilityTypes.d.ts +192 -0
- package/dist/core/types/utilityTypes.d.ts.map +1 -0
- package/dist/core/types/utilityTypes.js +272 -0
- package/dist/core/types/utilityTypes.js.map +1 -0
- package/dist/shell/interactiveShell.d.ts +9 -0
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +69 -1
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/systemPrompt.d.ts.map +1 -1
- package/dist/shell/systemPrompt.js +5 -0
- package/dist/shell/systemPrompt.js.map +1 -1
- package/dist/shell/terminalInput.d.ts +1 -0
- package/dist/shell/terminalInput.d.ts.map +1 -1
- package/dist/shell/terminalInput.js +9 -2
- package/dist/shell/terminalInput.js.map +1 -1
- package/dist/shell/terminalInputAdapter.d.ts +4 -0
- package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
- package/dist/shell/terminalInputAdapter.js +6 -0
- package/dist/shell/terminalInputAdapter.js.map +1 -1
- package/dist/tools/planningTools.d.ts +1 -0
- package/dist/tools/planningTools.d.ts.map +1 -1
- package/dist/tools/planningTools.js +48 -0
- package/dist/tools/planningTools.js.map +1 -1
- package/dist/ui/display.d.ts +5 -49
- package/dist/ui/display.d.ts.map +1 -1
- package/dist/ui/display.js +36 -335
- package/dist/ui/display.js.map +1 -1
- package/dist/ui/toolDisplay.d.ts.map +1 -1
- package/dist/ui/toolDisplay.js +17 -0
- package/dist/ui/toolDisplay.js.map +1 -1
- package/dist/utils/planFormatter.d.ts +34 -0
- package/dist/utils/planFormatter.d.ts.map +1 -0
- package/dist/utils/planFormatter.js +140 -0
- package/dist/utils/planFormatter.js.map +1 -0
- package/package.json +2 -2
- package/dist/shell/bracketedPasteManager.d.ts +0 -128
- package/dist/shell/bracketedPasteManager.d.ts.map +0 -1
- package/dist/shell/bracketedPasteManager.enhanced.d.ts +0 -2
- package/dist/shell/bracketedPasteManager.enhanced.d.ts.map +0 -1
- package/dist/shell/bracketedPasteManager.enhanced.js +0 -4
- package/dist/shell/bracketedPasteManager.enhanced.js.map +0 -1
- package/dist/shell/bracketedPasteManager.js +0 -372
- package/dist/shell/bracketedPasteManager.js.map +0 -1
- package/dist/shell/chatBox.d.ts +0 -228
- package/dist/shell/chatBox.d.ts.map +0 -1
- package/dist/shell/chatBox.js +0 -811
- package/dist/shell/chatBox.js.map +0 -1
- package/dist/shell/unifiedChatBox.d.ts +0 -194
- package/dist/shell/unifiedChatBox.d.ts.map +0 -1
- package/dist/shell/unifiedChatBox.js +0 -585
- package/dist/shell/unifiedChatBox.js.map +0 -1
- package/dist/ui/persistentPrompt.d.ts +0 -545
- package/dist/ui/persistentPrompt.d.ts.map +0 -1
- package/dist/ui/persistentPrompt.js +0 -1529
- package/dist/ui/persistentPrompt.js.map +0 -1
|
@@ -1,585 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UnifiedChatBox - Claude Code style unified input at bottom of terminal
|
|
3
|
-
*
|
|
4
|
-
* This implements a persistent prompt approach:
|
|
5
|
-
*
|
|
6
|
-
* 1. Scroll Region for Output
|
|
7
|
-
* - During streaming, a scroll region is set up excluding the bottom 2 lines
|
|
8
|
-
* - Streaming output flows naturally within the scroll region
|
|
9
|
-
* - The bottom area is protected and shows the persistent prompt
|
|
10
|
-
*
|
|
11
|
-
* 2. Persistent Prompt at Bottom
|
|
12
|
-
* - The ">" prompt is ALWAYS visible at the bottom of the terminal
|
|
13
|
-
* - During idle: readline shows prompt normally
|
|
14
|
-
* - During streaming: scroll region protects bottom, prompt stays visible
|
|
15
|
-
*
|
|
16
|
-
* 3. Queue-Based Input During Streaming
|
|
17
|
-
* User types during streaming → Input stored in queue → Processed after streaming ends
|
|
18
|
-
* The user can see their typed input in the persistent prompt area
|
|
19
|
-
*
|
|
20
|
-
* 4. Unified Experience
|
|
21
|
-
* The same prompt appearance on launch AND during streaming
|
|
22
|
-
* - Separator line: ───────────────────
|
|
23
|
-
* - Input prompt: > (with typed text visible)
|
|
24
|
-
*/
|
|
25
|
-
import * as readline from 'node:readline';
|
|
26
|
-
import { EventEmitter } from 'node:events';
|
|
27
|
-
import { theme } from '../ui/theme.js';
|
|
28
|
-
import { getStreamingOutputManager } from './streamingOutputManager.js';
|
|
29
|
-
/**
|
|
30
|
-
* UnifiedChatBox - Exactly like Claude Code
|
|
31
|
-
*
|
|
32
|
-
* During idle: readline shows prompt at current cursor position (naturally at bottom)
|
|
33
|
-
* During streaming: output flows naturally, typed input goes to invisible queue
|
|
34
|
-
* After streaming: new prompt appears at bottom naturally
|
|
35
|
-
*/
|
|
36
|
-
export class UnifiedChatBox extends EventEmitter {
|
|
37
|
-
rl = null;
|
|
38
|
-
writeStream;
|
|
39
|
-
readStream;
|
|
40
|
-
state = {
|
|
41
|
-
isStreaming: false,
|
|
42
|
-
inputBuffer: '',
|
|
43
|
-
cursorPosition: 0,
|
|
44
|
-
queuedInputs: [],
|
|
45
|
-
};
|
|
46
|
-
inputIdCounter = 0;
|
|
47
|
-
keypressHandler = null;
|
|
48
|
-
originalStdoutWrite = null;
|
|
49
|
-
outputSuppressed = false;
|
|
50
|
-
// Configuration
|
|
51
|
-
maxQueueSize = 100;
|
|
52
|
-
maxInputLength = 10000;
|
|
53
|
-
promptText = '> ';
|
|
54
|
-
// Buffered streaming mode - keeps cursor at prompt during AI response
|
|
55
|
-
persistentPromptEnabled = true; // Uses buffered output mode (cursor stays at prompt)
|
|
56
|
-
constructor(writeStream = process.stdout, readStream = process.stdin) {
|
|
57
|
-
super();
|
|
58
|
-
this.writeStream = writeStream;
|
|
59
|
-
this.readStream = readStream;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Initialize with an existing readline interface
|
|
63
|
-
*/
|
|
64
|
-
attachToReadline(rl) {
|
|
65
|
-
this.rl = rl;
|
|
66
|
-
this.setupKeypressCapture();
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Set the prompt text
|
|
70
|
-
*/
|
|
71
|
-
setPrompt(text) {
|
|
72
|
-
this.promptText = text;
|
|
73
|
-
if (this.rl) {
|
|
74
|
-
this.rl.setPrompt(text);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Get current prompt text
|
|
79
|
-
*/
|
|
80
|
-
getPrompt() {
|
|
81
|
-
return this.promptText;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Start streaming mode with persistent prompt at bottom
|
|
85
|
-
*
|
|
86
|
-
* Key design: Use BUFFERED mode instead of scroll regions
|
|
87
|
-
* - Enable buffered mode on StreamingOutputManager
|
|
88
|
-
* - Streaming output is collected, NOT written to stdout
|
|
89
|
-
* - Cursor stays at the prompt area (no movement during streaming)
|
|
90
|
-
* - When streaming ends, buffered output is written all at once
|
|
91
|
-
* - This keeps the prompt always visible during AI response
|
|
92
|
-
*/
|
|
93
|
-
startStreaming() {
|
|
94
|
-
if (this.state.isStreaming) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
this.state.isStreaming = true;
|
|
98
|
-
this.state.inputBuffer = '';
|
|
99
|
-
this.state.cursorPosition = 0;
|
|
100
|
-
// Enable buffered mode - output collected, cursor stays at prompt
|
|
101
|
-
if (this.persistentPromptEnabled) {
|
|
102
|
-
const outputManager = getStreamingOutputManager();
|
|
103
|
-
outputManager.setBufferedMode(true);
|
|
104
|
-
}
|
|
105
|
-
// Suppress readline echo - characters typed go to queue, not screen
|
|
106
|
-
this.suppressReadlineEcho();
|
|
107
|
-
this.emit('streaming-start');
|
|
108
|
-
}
|
|
109
|
-
// Note: Scroll region methods removed - using buffered output mode instead
|
|
110
|
-
// The buffered mode approach is simpler and more reliable:
|
|
111
|
-
// - StreamingOutputManager collects chunks in memory
|
|
112
|
-
// - Cursor stays at the prompt (no movement during streaming)
|
|
113
|
-
// - When streaming ends, all output is written at once
|
|
114
|
-
/**
|
|
115
|
-
* Refresh the persistent prompt (no-op in buffered mode)
|
|
116
|
-
* In buffered mode, the prompt stays visible because cursor doesn't move
|
|
117
|
-
*/
|
|
118
|
-
refreshPersistentPrompt() {
|
|
119
|
-
// In buffered mode, cursor stays at prompt - no refresh needed
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* End streaming mode - disable buffered mode and restore normal behavior
|
|
123
|
-
*
|
|
124
|
-
* What happens:
|
|
125
|
-
* - Disable buffered mode (StreamingOutputManager.endStream() writes the buffer)
|
|
126
|
-
* - Restore readline echo
|
|
127
|
-
* - Return queue summary for caller to process
|
|
128
|
-
* - Caller should then show a fresh prompt (naturally at bottom)
|
|
129
|
-
*/
|
|
130
|
-
endStreaming() {
|
|
131
|
-
// Disable buffered mode
|
|
132
|
-
// Note: The StreamingOutputManager.endStream() is called elsewhere and will
|
|
133
|
-
// write the buffered content. We just need to disable the mode for next time.
|
|
134
|
-
if (this.persistentPromptEnabled) {
|
|
135
|
-
const outputManager = getStreamingOutputManager();
|
|
136
|
-
outputManager.setBufferedMode(false);
|
|
137
|
-
}
|
|
138
|
-
// Restore readline echo
|
|
139
|
-
this.restoreReadlineEcho();
|
|
140
|
-
const summary = {
|
|
141
|
-
queuedCount: this.state.queuedInputs.length,
|
|
142
|
-
queueSummary: this.getQueueSummary(),
|
|
143
|
-
};
|
|
144
|
-
this.state.isStreaming = false;
|
|
145
|
-
this.emit('streaming-end', summary);
|
|
146
|
-
return summary;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Check if currently streaming
|
|
150
|
-
*/
|
|
151
|
-
isStreaming() {
|
|
152
|
-
return this.state.isStreaming;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Set up keypress capture for invisible input during streaming
|
|
156
|
-
*/
|
|
157
|
-
setupKeypressCapture() {
|
|
158
|
-
if (!this.readStream || !this.readStream.isTTY) {
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
// Enable keypress events if not already enabled
|
|
162
|
-
if (this.readStream.listenerCount('keypress') === 0 && this.rl) {
|
|
163
|
-
readline.emitKeypressEvents(this.readStream, this.rl);
|
|
164
|
-
}
|
|
165
|
-
// Ensure raw mode for keypress events
|
|
166
|
-
if (this.readStream.setRawMode && !this.readStream.isRaw) {
|
|
167
|
-
this.readStream.setRawMode(true);
|
|
168
|
-
}
|
|
169
|
-
this.keypressHandler = (str, key) => {
|
|
170
|
-
// Only capture when streaming
|
|
171
|
-
if (!this.state.isStreaming) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
this.handleKeypress(str, key);
|
|
175
|
-
};
|
|
176
|
-
this.readStream.prependListener('keypress', this.keypressHandler);
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Handle keypress during streaming - queue input invisibly
|
|
180
|
-
*/
|
|
181
|
-
handleKeypress(str, key) {
|
|
182
|
-
if (!key) {
|
|
183
|
-
// Regular character
|
|
184
|
-
if (str && str.length > 0) {
|
|
185
|
-
this.appendToBuffer(str);
|
|
186
|
-
}
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
// Ctrl+C - queue interrupt
|
|
190
|
-
if (key.ctrl && key.name === 'c') {
|
|
191
|
-
this.queueInterrupt();
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
// Enter - queue the current buffer
|
|
195
|
-
if (key.name === 'return' || key.name === 'enter') {
|
|
196
|
-
this.submitBuffer();
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
// Backspace
|
|
200
|
-
if (key.name === 'backspace') {
|
|
201
|
-
this.handleBackspace();
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
// Delete
|
|
205
|
-
if (key.name === 'delete') {
|
|
206
|
-
this.handleDelete();
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
// Arrow keys for cursor movement
|
|
210
|
-
if (key.name === 'left') {
|
|
211
|
-
this.state.cursorPosition = Math.max(0, this.state.cursorPosition - 1);
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
if (key.name === 'right') {
|
|
215
|
-
this.state.cursorPosition = Math.min(this.state.inputBuffer.length, this.state.cursorPosition + 1);
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
// Home/End
|
|
219
|
-
if (key.name === 'home' || (key.ctrl && key.name === 'a')) {
|
|
220
|
-
this.state.cursorPosition = 0;
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
if (key.name === 'end' || (key.ctrl && key.name === 'e')) {
|
|
224
|
-
this.state.cursorPosition = this.state.inputBuffer.length;
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
// Ctrl+U - clear line
|
|
228
|
-
if (key.ctrl && key.name === 'u') {
|
|
229
|
-
this.state.inputBuffer = this.state.inputBuffer.slice(this.state.cursorPosition);
|
|
230
|
-
this.state.cursorPosition = 0;
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
// Ctrl+K - delete to end
|
|
234
|
-
if (key.ctrl && key.name === 'k') {
|
|
235
|
-
this.state.inputBuffer = this.state.inputBuffer.slice(0, this.state.cursorPosition);
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
// Ctrl+W - delete word
|
|
239
|
-
if (key.ctrl && key.name === 'w') {
|
|
240
|
-
this.handleDeleteWord();
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
// Ignore other control sequences
|
|
244
|
-
if (key.ctrl || key.meta) {
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
// Regular character with key info
|
|
248
|
-
if (str && str.length > 0) {
|
|
249
|
-
this.appendToBuffer(str);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Append character(s) to the invisible buffer
|
|
254
|
-
*/
|
|
255
|
-
appendToBuffer(chars) {
|
|
256
|
-
if (this.state.inputBuffer.length >= this.maxInputLength) {
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
const available = this.maxInputLength - this.state.inputBuffer.length;
|
|
260
|
-
const toAdd = chars.slice(0, available);
|
|
261
|
-
this.state.inputBuffer =
|
|
262
|
-
this.state.inputBuffer.slice(0, this.state.cursorPosition) +
|
|
263
|
-
toAdd +
|
|
264
|
-
this.state.inputBuffer.slice(this.state.cursorPosition);
|
|
265
|
-
this.state.cursorPosition += toAdd.length;
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Handle backspace in buffer
|
|
269
|
-
*/
|
|
270
|
-
handleBackspace() {
|
|
271
|
-
if (this.state.cursorPosition === 0) {
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
this.state.inputBuffer =
|
|
275
|
-
this.state.inputBuffer.slice(0, this.state.cursorPosition - 1) +
|
|
276
|
-
this.state.inputBuffer.slice(this.state.cursorPosition);
|
|
277
|
-
this.state.cursorPosition = Math.max(0, this.state.cursorPosition - 1);
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Handle delete key in buffer
|
|
281
|
-
*/
|
|
282
|
-
handleDelete() {
|
|
283
|
-
if (this.state.cursorPosition >= this.state.inputBuffer.length) {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
this.state.inputBuffer =
|
|
287
|
-
this.state.inputBuffer.slice(0, this.state.cursorPosition) +
|
|
288
|
-
this.state.inputBuffer.slice(this.state.cursorPosition + 1);
|
|
289
|
-
}
|
|
290
|
-
/**
|
|
291
|
-
* Handle Ctrl+W - delete word before cursor
|
|
292
|
-
*/
|
|
293
|
-
handleDeleteWord() {
|
|
294
|
-
if (this.state.cursorPosition === 0) {
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
let pos = this.state.cursorPosition;
|
|
298
|
-
// Skip spaces
|
|
299
|
-
while (pos > 0 && this.state.inputBuffer[pos - 1] === ' ') {
|
|
300
|
-
pos--;
|
|
301
|
-
}
|
|
302
|
-
// Skip word
|
|
303
|
-
while (pos > 0 && this.state.inputBuffer[pos - 1] !== ' ') {
|
|
304
|
-
pos--;
|
|
305
|
-
}
|
|
306
|
-
this.state.inputBuffer =
|
|
307
|
-
this.state.inputBuffer.slice(0, pos) +
|
|
308
|
-
this.state.inputBuffer.slice(this.state.cursorPosition);
|
|
309
|
-
this.state.cursorPosition = pos;
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* Submit current buffer to queue
|
|
313
|
-
*/
|
|
314
|
-
submitBuffer() {
|
|
315
|
-
const text = this.state.inputBuffer.trim();
|
|
316
|
-
if (!text) {
|
|
317
|
-
return;
|
|
318
|
-
}
|
|
319
|
-
// Check queue limit
|
|
320
|
-
if (this.state.queuedInputs.length >= this.maxQueueSize) {
|
|
321
|
-
// Remove oldest non-command to make room
|
|
322
|
-
const idx = this.state.queuedInputs.findIndex(q => q.type !== 'command');
|
|
323
|
-
if (idx >= 0) {
|
|
324
|
-
this.state.queuedInputs.splice(idx, 1);
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
return; // Queue full
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
const input = {
|
|
331
|
-
id: `input-${++this.inputIdCounter}`,
|
|
332
|
-
text,
|
|
333
|
-
timestamp: Date.now(),
|
|
334
|
-
type: text.startsWith('/') ? 'command' : 'message',
|
|
335
|
-
};
|
|
336
|
-
this.state.queuedInputs.push(input);
|
|
337
|
-
this.state.inputBuffer = '';
|
|
338
|
-
this.state.cursorPosition = 0;
|
|
339
|
-
this.emit('input-queued', input);
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* Queue an interrupt
|
|
343
|
-
*/
|
|
344
|
-
queueInterrupt() {
|
|
345
|
-
const input = {
|
|
346
|
-
id: `input-${++this.inputIdCounter}`,
|
|
347
|
-
text: '',
|
|
348
|
-
timestamp: Date.now(),
|
|
349
|
-
type: 'interrupt',
|
|
350
|
-
};
|
|
351
|
-
// Interrupt goes to front of queue
|
|
352
|
-
this.state.queuedInputs.unshift(input);
|
|
353
|
-
this.state.inputBuffer = '';
|
|
354
|
-
this.state.cursorPosition = 0;
|
|
355
|
-
this.emit('input-queued', input);
|
|
356
|
-
this.emit('interrupt');
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* Suppress readline echo during streaming
|
|
360
|
-
* Characters typed will be captured but not displayed
|
|
361
|
-
*/
|
|
362
|
-
suppressReadlineEcho() {
|
|
363
|
-
if (this.outputSuppressed || !this.writeStream.isTTY) {
|
|
364
|
-
return;
|
|
365
|
-
}
|
|
366
|
-
this.originalStdoutWrite = this.writeStream.write.bind(this.writeStream);
|
|
367
|
-
const self = this;
|
|
368
|
-
// Replace stdout.write to filter readline echo
|
|
369
|
-
this.writeStream.write = function (chunk, encodingOrCallback, callback) {
|
|
370
|
-
if (!self.originalStdoutWrite) {
|
|
371
|
-
return true;
|
|
372
|
-
}
|
|
373
|
-
const str = typeof chunk === 'string' ? chunk : chunk.toString();
|
|
374
|
-
// During streaming, filter out readline echo patterns:
|
|
375
|
-
// - Single printable characters (user typing)
|
|
376
|
-
// - Backspace sequences
|
|
377
|
-
// - Cursor movement sequences
|
|
378
|
-
// - Short control sequences
|
|
379
|
-
// But allow through:
|
|
380
|
-
// - Multi-character content (actual AI output)
|
|
381
|
-
// - Newlines and formatting
|
|
382
|
-
// Single printable char - likely user typing, suppress
|
|
383
|
-
if (str.length === 1 && str.charCodeAt(0) >= 32 && str.charCodeAt(0) < 127) {
|
|
384
|
-
if (typeof encodingOrCallback === 'function') {
|
|
385
|
-
encodingOrCallback(null);
|
|
386
|
-
}
|
|
387
|
-
else if (callback) {
|
|
388
|
-
callback(null);
|
|
389
|
-
}
|
|
390
|
-
return true;
|
|
391
|
-
}
|
|
392
|
-
// Backspace sequences
|
|
393
|
-
if (str === '\b \b' || str === '\x1b[D \x1b[D' || str === '\b' || str === '\x7f') {
|
|
394
|
-
if (typeof encodingOrCallback === 'function') {
|
|
395
|
-
encodingOrCallback(null);
|
|
396
|
-
}
|
|
397
|
-
else if (callback) {
|
|
398
|
-
callback(null);
|
|
399
|
-
}
|
|
400
|
-
return true;
|
|
401
|
-
}
|
|
402
|
-
// Cursor movement sequences
|
|
403
|
-
if (/^\x1b\[\d*[ABCD]$/.test(str)) {
|
|
404
|
-
if (typeof encodingOrCallback === 'function') {
|
|
405
|
-
encodingOrCallback(null);
|
|
406
|
-
}
|
|
407
|
-
else if (callback) {
|
|
408
|
-
callback(null);
|
|
409
|
-
}
|
|
410
|
-
return true;
|
|
411
|
-
}
|
|
412
|
-
// Short control sequences from readline
|
|
413
|
-
if (str.length <= 3 && /^[\x1b\[\]\d;GKJ]+$/.test(str)) {
|
|
414
|
-
if (typeof encodingOrCallback === 'function') {
|
|
415
|
-
encodingOrCallback(null);
|
|
416
|
-
}
|
|
417
|
-
else if (callback) {
|
|
418
|
-
callback(null);
|
|
419
|
-
}
|
|
420
|
-
return true;
|
|
421
|
-
}
|
|
422
|
-
// Prompt redraw patterns
|
|
423
|
-
if (/^\r/.test(str) && str.length < 20 && /^[\r\x1b\[\dGK> ]+$/.test(str)) {
|
|
424
|
-
if (typeof encodingOrCallback === 'function') {
|
|
425
|
-
encodingOrCallback(null);
|
|
426
|
-
}
|
|
427
|
-
else if (callback) {
|
|
428
|
-
callback(null);
|
|
429
|
-
}
|
|
430
|
-
return true;
|
|
431
|
-
}
|
|
432
|
-
// Clear line + prompt patterns
|
|
433
|
-
if (/^\x1b\[\d*[GK]/.test(str) && str.length < 15) {
|
|
434
|
-
if (typeof encodingOrCallback === 'function') {
|
|
435
|
-
encodingOrCallback(null);
|
|
436
|
-
}
|
|
437
|
-
else if (callback) {
|
|
438
|
-
callback(null);
|
|
439
|
-
}
|
|
440
|
-
return true;
|
|
441
|
-
}
|
|
442
|
-
// Allow everything else through (actual AI output)
|
|
443
|
-
if (typeof encodingOrCallback === 'function') {
|
|
444
|
-
return self.originalStdoutWrite(chunk, encodingOrCallback);
|
|
445
|
-
}
|
|
446
|
-
return self.originalStdoutWrite(chunk, encodingOrCallback, callback);
|
|
447
|
-
};
|
|
448
|
-
this.outputSuppressed = true;
|
|
449
|
-
}
|
|
450
|
-
/**
|
|
451
|
-
* Restore readline echo
|
|
452
|
-
*/
|
|
453
|
-
restoreReadlineEcho() {
|
|
454
|
-
if (!this.outputSuppressed || !this.originalStdoutWrite) {
|
|
455
|
-
return;
|
|
456
|
-
}
|
|
457
|
-
this.writeStream.write = this.originalStdoutWrite;
|
|
458
|
-
this.originalStdoutWrite = null;
|
|
459
|
-
this.outputSuppressed = false;
|
|
460
|
-
}
|
|
461
|
-
/**
|
|
462
|
-
* Check if there are queued inputs
|
|
463
|
-
*/
|
|
464
|
-
hasQueuedInput() {
|
|
465
|
-
return this.state.queuedInputs.length > 0;
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* Get next queued input
|
|
469
|
-
*/
|
|
470
|
-
dequeue() {
|
|
471
|
-
return this.state.queuedInputs.shift();
|
|
472
|
-
}
|
|
473
|
-
/**
|
|
474
|
-
* Get all queued inputs
|
|
475
|
-
*/
|
|
476
|
-
getQueue() {
|
|
477
|
-
return [...this.state.queuedInputs];
|
|
478
|
-
}
|
|
479
|
-
/**
|
|
480
|
-
* Clear queue
|
|
481
|
-
*/
|
|
482
|
-
clearQueue() {
|
|
483
|
-
this.state.queuedInputs = [];
|
|
484
|
-
}
|
|
485
|
-
/**
|
|
486
|
-
* Get queue summary for display
|
|
487
|
-
*/
|
|
488
|
-
getQueueSummary() {
|
|
489
|
-
const count = this.state.queuedInputs.length;
|
|
490
|
-
if (count === 0) {
|
|
491
|
-
return '';
|
|
492
|
-
}
|
|
493
|
-
const commands = this.state.queuedInputs.filter(q => q.type === 'command').length;
|
|
494
|
-
const messages = this.state.queuedInputs.filter(q => q.type === 'message').length;
|
|
495
|
-
const interrupts = this.state.queuedInputs.filter(q => q.type === 'interrupt').length;
|
|
496
|
-
const parts = [];
|
|
497
|
-
if (interrupts > 0) {
|
|
498
|
-
parts.push(`${interrupts} interrupt${interrupts === 1 ? '' : 's'}`);
|
|
499
|
-
}
|
|
500
|
-
if (commands > 0) {
|
|
501
|
-
parts.push(`${commands} command${commands === 1 ? '' : 's'}`);
|
|
502
|
-
}
|
|
503
|
-
if (messages > 0) {
|
|
504
|
-
parts.push(`${messages} message${messages === 1 ? '' : 's'}`);
|
|
505
|
-
}
|
|
506
|
-
return parts.join(', ') + ' queued';
|
|
507
|
-
}
|
|
508
|
-
/**
|
|
509
|
-
* Get current input buffer (for display if needed)
|
|
510
|
-
*/
|
|
511
|
-
getInputBuffer() {
|
|
512
|
-
return this.state.inputBuffer;
|
|
513
|
-
}
|
|
514
|
-
/**
|
|
515
|
-
* Get current state
|
|
516
|
-
*/
|
|
517
|
-
getState() {
|
|
518
|
-
return {
|
|
519
|
-
...this.state,
|
|
520
|
-
queuedInputs: [...this.state.queuedInputs],
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
/**
|
|
524
|
-
* Show queue indicator if there are queued items
|
|
525
|
-
*/
|
|
526
|
-
showQueueIndicator() {
|
|
527
|
-
const count = this.state.queuedInputs.length;
|
|
528
|
-
if (count === 0) {
|
|
529
|
-
return;
|
|
530
|
-
}
|
|
531
|
-
const summary = this.getQueueSummary();
|
|
532
|
-
this.writeStream.write(theme.ui.muted(`\n📝 ${summary}\n`));
|
|
533
|
-
}
|
|
534
|
-
/**
|
|
535
|
-
* Enable or disable the persistent prompt feature
|
|
536
|
-
* When disabled, the prompt behaves like the original (no scroll region)
|
|
537
|
-
*/
|
|
538
|
-
setPersistentPromptEnabled(enabled) {
|
|
539
|
-
this.persistentPromptEnabled = enabled;
|
|
540
|
-
}
|
|
541
|
-
/**
|
|
542
|
-
* Check if persistent prompt is enabled
|
|
543
|
-
*/
|
|
544
|
-
isPersistentPromptEnabled() {
|
|
545
|
-
return this.persistentPromptEnabled;
|
|
546
|
-
}
|
|
547
|
-
/**
|
|
548
|
-
* Dispose and cleanup
|
|
549
|
-
*/
|
|
550
|
-
dispose() {
|
|
551
|
-
// Disable buffered mode if it was enabled
|
|
552
|
-
if (this.persistentPromptEnabled) {
|
|
553
|
-
const outputManager = getStreamingOutputManager();
|
|
554
|
-
outputManager.setBufferedMode(false);
|
|
555
|
-
}
|
|
556
|
-
// Restore echo if suppressed
|
|
557
|
-
this.restoreReadlineEcho();
|
|
558
|
-
// Remove keypress handler
|
|
559
|
-
if (this.keypressHandler && this.readStream) {
|
|
560
|
-
this.readStream.off('keypress', this.keypressHandler);
|
|
561
|
-
this.keypressHandler = null;
|
|
562
|
-
}
|
|
563
|
-
// Clear state
|
|
564
|
-
this.state.queuedInputs = [];
|
|
565
|
-
this.state.inputBuffer = '';
|
|
566
|
-
this.rl = null;
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
/**
|
|
570
|
-
* Singleton instance
|
|
571
|
-
*/
|
|
572
|
-
let globalInstance = null;
|
|
573
|
-
export function getUnifiedChatBox() {
|
|
574
|
-
if (!globalInstance) {
|
|
575
|
-
globalInstance = new UnifiedChatBox();
|
|
576
|
-
}
|
|
577
|
-
return globalInstance;
|
|
578
|
-
}
|
|
579
|
-
export function resetUnifiedChatBox() {
|
|
580
|
-
if (globalInstance) {
|
|
581
|
-
globalInstance.dispose();
|
|
582
|
-
}
|
|
583
|
-
globalInstance = null;
|
|
584
|
-
}
|
|
585
|
-
//# sourceMappingURL=unifiedChatBox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unifiedChatBox.js","sourceRoot":"","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