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,372 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bracketed paste manager for handling terminal paste operations.
|
|
3
|
-
*
|
|
4
|
-
* This class handles the bracketed paste mode in terminals, which allows
|
|
5
|
-
* pasted text to be distinguished from typed input. This is particularly
|
|
6
|
-
* useful for handling multi-line pastes and preventing unwanted execution
|
|
7
|
-
* of commands during paste operations.
|
|
8
|
-
*/
|
|
9
|
-
export class BracketedPasteManager {
|
|
10
|
-
enabled;
|
|
11
|
-
inPaste = false;
|
|
12
|
-
pasteBuffer = [];
|
|
13
|
-
/** Tracks accumulated multi-line input even without bracketed paste support */
|
|
14
|
-
multiLineBuffer = [];
|
|
15
|
-
multiLineMode = false;
|
|
16
|
-
/** Raw data buffer for capturing complete bracketed paste content */
|
|
17
|
-
rawPasteBuffer = '';
|
|
18
|
-
/** Callback for when raw paste is complete */
|
|
19
|
-
onRawPasteComplete = null;
|
|
20
|
-
/** Whether we're currently capturing raw data */
|
|
21
|
-
capturingRaw = false;
|
|
22
|
-
/** Flag set when paste was just captured - used to ignore readline line events */
|
|
23
|
-
pasteJustCaptured = false;
|
|
24
|
-
/** Number of lines in the paste that was just captured */
|
|
25
|
-
pasteJustCapturedLineCount = 0;
|
|
26
|
-
static START_MARKER = '\u001b[200~';
|
|
27
|
-
static END_MARKER = '\u001b[201~';
|
|
28
|
-
constructor(enabled) {
|
|
29
|
-
this.enabled = enabled;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Process raw data from stdin before readline handles it.
|
|
33
|
-
* This intercepts bracketed paste content and captures it in full.
|
|
34
|
-
* Returns true if the data was consumed (should not be passed to readline).
|
|
35
|
-
*/
|
|
36
|
-
processRawData(data) {
|
|
37
|
-
if (!this.enabled) {
|
|
38
|
-
return { consumed: false };
|
|
39
|
-
}
|
|
40
|
-
const startIdx = data.indexOf(BracketedPasteManager.START_MARKER);
|
|
41
|
-
const endIdx = data.indexOf(BracketedPasteManager.END_MARKER);
|
|
42
|
-
// Case 1: Not in paste mode and no start marker - pass through
|
|
43
|
-
if (!this.capturingRaw && startIdx === -1) {
|
|
44
|
-
return { consumed: false };
|
|
45
|
-
}
|
|
46
|
-
// Case 2: Found start marker - begin capturing
|
|
47
|
-
if (!this.capturingRaw && startIdx !== -1) {
|
|
48
|
-
this.capturingRaw = true;
|
|
49
|
-
const beforeStart = data.substring(0, startIdx);
|
|
50
|
-
const afterStart = data.substring(startIdx + BracketedPasteManager.START_MARKER.length);
|
|
51
|
-
// Check if end marker is in same chunk
|
|
52
|
-
const endInAfter = afterStart.indexOf(BracketedPasteManager.END_MARKER);
|
|
53
|
-
if (endInAfter !== -1) {
|
|
54
|
-
// Complete paste in single chunk
|
|
55
|
-
const pasteContent = afterStart.substring(0, endInAfter);
|
|
56
|
-
const afterEnd = afterStart.substring(endInAfter + BracketedPasteManager.END_MARKER.length);
|
|
57
|
-
this.capturingRaw = false;
|
|
58
|
-
this.rawPasteBuffer = '';
|
|
59
|
-
// Mark that paste was just captured - readline will emit line events we need to ignore
|
|
60
|
-
const lineCount = pasteContent.split('\n').length;
|
|
61
|
-
this.pasteJustCaptured = true;
|
|
62
|
-
this.pasteJustCapturedLineCount = lineCount;
|
|
63
|
-
// Emit the complete paste
|
|
64
|
-
if (this.onRawPasteComplete) {
|
|
65
|
-
this.onRawPasteComplete(pasteContent);
|
|
66
|
-
}
|
|
67
|
-
// Return any content before/after markers to be passed through
|
|
68
|
-
const passThrough = beforeStart + afterEnd;
|
|
69
|
-
return { consumed: true, passThrough: passThrough || undefined };
|
|
70
|
-
}
|
|
71
|
-
// Start marker found but no end marker yet
|
|
72
|
-
this.rawPasteBuffer = afterStart;
|
|
73
|
-
// Pass through anything before the start marker
|
|
74
|
-
return { consumed: true, passThrough: beforeStart || undefined };
|
|
75
|
-
}
|
|
76
|
-
// Case 3: Currently capturing and found end marker
|
|
77
|
-
if (this.capturingRaw && endIdx !== -1) {
|
|
78
|
-
const beforeEnd = data.substring(0, endIdx);
|
|
79
|
-
const afterEnd = data.substring(endIdx + BracketedPasteManager.END_MARKER.length);
|
|
80
|
-
const pasteContent = this.rawPasteBuffer + beforeEnd;
|
|
81
|
-
this.capturingRaw = false;
|
|
82
|
-
this.rawPasteBuffer = '';
|
|
83
|
-
// Mark that paste was just captured - readline will emit line events we need to ignore
|
|
84
|
-
const lineCount = pasteContent.split('\n').length;
|
|
85
|
-
this.pasteJustCaptured = true;
|
|
86
|
-
this.pasteJustCapturedLineCount = lineCount;
|
|
87
|
-
// Emit the complete paste
|
|
88
|
-
if (this.onRawPasteComplete) {
|
|
89
|
-
this.onRawPasteComplete(pasteContent);
|
|
90
|
-
}
|
|
91
|
-
// Pass through anything after end marker
|
|
92
|
-
return { consumed: true, passThrough: afterEnd || undefined };
|
|
93
|
-
}
|
|
94
|
-
// Case 4: Currently capturing, no end marker - accumulate
|
|
95
|
-
if (this.capturingRaw) {
|
|
96
|
-
this.rawPasteBuffer += data;
|
|
97
|
-
return { consumed: true };
|
|
98
|
-
}
|
|
99
|
-
return { consumed: false };
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Set callback for when a complete paste is captured via raw data processing
|
|
103
|
-
*/
|
|
104
|
-
setRawPasteCallback(callback) {
|
|
105
|
-
this.onRawPasteComplete = callback;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Check if currently capturing raw paste data
|
|
109
|
-
*/
|
|
110
|
-
isCapturingRaw() {
|
|
111
|
-
return this.capturingRaw;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Check if paste was just captured and needs to ignore readline line events.
|
|
115
|
-
* This returns true if paste was captured, and decrements the line counter.
|
|
116
|
-
* When counter reaches 0, future calls return false.
|
|
117
|
-
*/
|
|
118
|
-
shouldIgnoreLineEvent() {
|
|
119
|
-
if (this.pasteJustCaptured && this.pasteJustCapturedLineCount > 0) {
|
|
120
|
-
this.pasteJustCapturedLineCount--;
|
|
121
|
-
if (this.pasteJustCapturedLineCount === 0) {
|
|
122
|
-
this.pasteJustCaptured = false;
|
|
123
|
-
}
|
|
124
|
-
return true;
|
|
125
|
-
}
|
|
126
|
-
return false;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Clear the paste-just-captured flag (call when user explicitly submits)
|
|
130
|
-
*/
|
|
131
|
-
clearPasteJustCaptured() {
|
|
132
|
-
this.pasteJustCaptured = false;
|
|
133
|
-
this.pasteJustCapturedLineCount = 0;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Get current raw buffer size (for display)
|
|
137
|
-
*/
|
|
138
|
-
getRawBufferLineCount() {
|
|
139
|
-
if (!this.rawPasteBuffer)
|
|
140
|
-
return 0;
|
|
141
|
-
return this.rawPasteBuffer.split('\n').length;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Get preview of raw buffer content
|
|
145
|
-
*/
|
|
146
|
-
getRawBufferPreview() {
|
|
147
|
-
if (!this.rawPasteBuffer)
|
|
148
|
-
return '';
|
|
149
|
-
const lines = this.rawPasteBuffer.split('\n');
|
|
150
|
-
return this.getPreview(lines);
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Process input text, handling bracketed paste sequences
|
|
154
|
-
*/
|
|
155
|
-
process(input) {
|
|
156
|
-
if (!this.enabled) {
|
|
157
|
-
return this.processWithoutBracketed(input);
|
|
158
|
-
}
|
|
159
|
-
// NOTE: The raw data interception is disabled (it didn't work reliably).
|
|
160
|
-
// We no longer check pasteJustCaptured or capturingRaw here since
|
|
161
|
-
// all paste handling is done through this line-based process() method.
|
|
162
|
-
const startMarker = '\u001b[200~';
|
|
163
|
-
const endMarker = '\u001b[201~';
|
|
164
|
-
// NOTE: Safety check for stuck paste state has been removed.
|
|
165
|
-
// The safety check caused issues where valid multi-line paste content
|
|
166
|
-
// (lines without escape sequences) would be incorrectly treated as "regular typed input".
|
|
167
|
-
// Instead, paste state is reset via the reset() method when appropriate
|
|
168
|
-
// (e.g., when user explicitly submits or cancels).
|
|
169
|
-
// If we're already in a paste, look for end marker
|
|
170
|
-
if (this.inPaste) {
|
|
171
|
-
const endIndex = input.indexOf(endMarker);
|
|
172
|
-
if (endIndex !== -1) {
|
|
173
|
-
// End of paste found
|
|
174
|
-
const beforeEnd = input.substring(0, endIndex);
|
|
175
|
-
const afterEnd = input.substring(endIndex + endMarker.length);
|
|
176
|
-
this.pasteBuffer.push(beforeEnd);
|
|
177
|
-
// Join chunks directly without adding newlines - chunks already contain their original newlines
|
|
178
|
-
const result = this.pasteBuffer.join('');
|
|
179
|
-
// Count actual lines in the result
|
|
180
|
-
const resultLines = result.split('\n');
|
|
181
|
-
const lineCount = resultLines.length;
|
|
182
|
-
const preview = this.getPreview(resultLines);
|
|
183
|
-
// Reset state
|
|
184
|
-
this.inPaste = false;
|
|
185
|
-
this.pasteBuffer = [];
|
|
186
|
-
// If there's text after the end marker, process it normally
|
|
187
|
-
if (afterEnd) {
|
|
188
|
-
const afterResult = this.process(afterEnd);
|
|
189
|
-
if (afterResult.handled && afterResult.result !== undefined) {
|
|
190
|
-
return {
|
|
191
|
-
handled: true,
|
|
192
|
-
result: result + afterResult.result,
|
|
193
|
-
lineCount,
|
|
194
|
-
preview,
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
return {
|
|
198
|
-
handled: true,
|
|
199
|
-
result: result + afterEnd,
|
|
200
|
-
lineCount,
|
|
201
|
-
preview,
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
return {
|
|
205
|
-
handled: true,
|
|
206
|
-
result,
|
|
207
|
-
lineCount,
|
|
208
|
-
preview,
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
// Still in paste, no end marker found
|
|
213
|
-
this.pasteBuffer.push(input);
|
|
214
|
-
return {
|
|
215
|
-
handled: true,
|
|
216
|
-
isPending: true,
|
|
217
|
-
lineCount: this.pasteBuffer.length,
|
|
218
|
-
preview: this.getPreview(this.pasteBuffer),
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
// Not in paste, look for start marker
|
|
223
|
-
const startIndex = input.indexOf(startMarker);
|
|
224
|
-
if (startIndex !== -1) {
|
|
225
|
-
// Start of paste found
|
|
226
|
-
const beforeStart = input.substring(0, startIndex);
|
|
227
|
-
const afterStart = input.substring(startIndex + startMarker.length);
|
|
228
|
-
// Start paste mode
|
|
229
|
-
this.inPaste = true;
|
|
230
|
-
this.pasteBuffer = [];
|
|
231
|
-
// Process the text after the start marker
|
|
232
|
-
if (afterStart) {
|
|
233
|
-
const afterResult = this.process(afterStart);
|
|
234
|
-
if (afterResult.handled && afterResult.result !== undefined) {
|
|
235
|
-
return {
|
|
236
|
-
handled: true,
|
|
237
|
-
result: beforeStart + afterResult.result,
|
|
238
|
-
lineCount: afterResult.lineCount,
|
|
239
|
-
preview: afterResult.preview,
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
// Still pending
|
|
243
|
-
return {
|
|
244
|
-
handled: true,
|
|
245
|
-
result: beforeStart,
|
|
246
|
-
isPending: this.inPaste,
|
|
247
|
-
lineCount: this.pasteBuffer.length,
|
|
248
|
-
preview: this.getPreview(this.pasteBuffer),
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
return {
|
|
252
|
-
handled: true,
|
|
253
|
-
result: beforeStart,
|
|
254
|
-
isPending: true,
|
|
255
|
-
lineCount: 0,
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
// No paste markers found
|
|
259
|
-
return { handled: false };
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Process input when bracketed paste is not enabled.
|
|
263
|
-
*
|
|
264
|
-
* IMPORTANT: We no longer use timing heuristics for paste detection.
|
|
265
|
-
* The timing-based approach caused issues where fast typing was incorrectly
|
|
266
|
-
* detected as paste, causing follow-up prompts to be held indefinitely.
|
|
267
|
-
*
|
|
268
|
-
* Instead, we only detect pastes that contain embedded newlines (which
|
|
269
|
-
* is how terminal emulators typically deliver pasted multi-line content).
|
|
270
|
-
*/
|
|
271
|
-
processWithoutBracketed(input) {
|
|
272
|
-
// Only detect actual multi-line pastes (content with embedded newlines)
|
|
273
|
-
// Single-line input is always passed through immediately
|
|
274
|
-
if (input.includes('\n')) {
|
|
275
|
-
const lines = input.split('\n');
|
|
276
|
-
return {
|
|
277
|
-
handled: true,
|
|
278
|
-
result: input,
|
|
279
|
-
lineCount: lines.length,
|
|
280
|
-
preview: this.getPreview(lines),
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
// Single-line input - not a paste, pass through immediately
|
|
284
|
-
return { handled: false };
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Generate a preview string for multi-line content
|
|
288
|
-
*/
|
|
289
|
-
getPreview(lines) {
|
|
290
|
-
if (lines.length === 0) {
|
|
291
|
-
return '';
|
|
292
|
-
}
|
|
293
|
-
const firstLine = lines[0] || '';
|
|
294
|
-
const truncatedFirst = firstLine.length > 50
|
|
295
|
-
? `${firstLine.slice(0, 47)}...`
|
|
296
|
-
: firstLine;
|
|
297
|
-
if (lines.length === 1) {
|
|
298
|
-
return truncatedFirst;
|
|
299
|
-
}
|
|
300
|
-
return `${truncatedFirst} [+${lines.length - 1} more lines]`;
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* Get current multi-line state for display purposes
|
|
304
|
-
*/
|
|
305
|
-
getMultiLineState() {
|
|
306
|
-
const buffer = this.inPaste ? this.pasteBuffer :
|
|
307
|
-
this.multiLineMode ? this.multiLineBuffer : null;
|
|
308
|
-
if (!buffer || buffer.length === 0) {
|
|
309
|
-
return null;
|
|
310
|
-
}
|
|
311
|
-
const firstLine = buffer[0] || '';
|
|
312
|
-
const lastLine = buffer[buffer.length - 1] || '';
|
|
313
|
-
return {
|
|
314
|
-
content: buffer.join('\n'),
|
|
315
|
-
lineCount: buffer.length,
|
|
316
|
-
firstLinePreview: firstLine.length > 40 ? `${firstLine.slice(0, 37)}...` : firstLine,
|
|
317
|
-
lastLinePreview: lastLine.length > 40 ? `${lastLine.slice(0, 37)}...` : lastLine,
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
/**
|
|
321
|
-
* Format a multi-line paste as a collapsed block for display
|
|
322
|
-
*/
|
|
323
|
-
static formatCollapsedBlock(content, maxPreviewLength = 60) {
|
|
324
|
-
const lines = content.split('\n');
|
|
325
|
-
if (lines.length <= 1) {
|
|
326
|
-
return content;
|
|
327
|
-
}
|
|
328
|
-
const firstLine = (lines[0] || '').trim();
|
|
329
|
-
const truncatedFirst = firstLine.length > maxPreviewLength
|
|
330
|
-
? `${firstLine.slice(0, maxPreviewLength - 3)}...`
|
|
331
|
-
: firstLine;
|
|
332
|
-
return `📋 ${truncatedFirst} [${lines.length} lines]`;
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* Check if currently processing a paste
|
|
336
|
-
*/
|
|
337
|
-
isInPaste() {
|
|
338
|
-
return this.inPaste || this.multiLineMode;
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* Get the current paste buffer
|
|
342
|
-
*/
|
|
343
|
-
getPasteBuffer() {
|
|
344
|
-
return this.inPaste ? [...this.pasteBuffer] : [...this.multiLineBuffer];
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* Finalize any pending multi-line input
|
|
348
|
-
*/
|
|
349
|
-
finalize() {
|
|
350
|
-
if (this.multiLineMode && this.multiLineBuffer.length > 1) {
|
|
351
|
-
const result = this.multiLineBuffer.join('\n');
|
|
352
|
-
this.multiLineBuffer = [];
|
|
353
|
-
this.multiLineMode = false;
|
|
354
|
-
return result;
|
|
355
|
-
}
|
|
356
|
-
return null;
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* Reset the paste state
|
|
360
|
-
*/
|
|
361
|
-
reset() {
|
|
362
|
-
this.inPaste = false;
|
|
363
|
-
this.pasteBuffer = [];
|
|
364
|
-
this.multiLineMode = false;
|
|
365
|
-
this.multiLineBuffer = [];
|
|
366
|
-
this.rawPasteBuffer = '';
|
|
367
|
-
this.capturingRaw = false;
|
|
368
|
-
this.pasteJustCaptured = false;
|
|
369
|
-
this.pasteJustCapturedLineCount = 0;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
//# sourceMappingURL=bracketedPasteManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bracketedPasteManager.js","sourceRoot":"","sources":["../../src/shell/bracketedPasteManager.ts"],"names":[],"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,KAAK,CAAC;QAC3B,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;QAC/B,IAAI,CAAC,0BAA0B,GAAG,CAAC,CAAC;IACtC,CAAC"}
|
package/dist/shell/chatBox.d.ts
DELETED
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ChatBox - Claude Code style input box at the bottom of terminal
|
|
3
|
-
*
|
|
4
|
-
* This is the ONLY place the cursor can ever be. Features:
|
|
5
|
-
* - Multi-line text input
|
|
6
|
-
* - Cursor navigation (arrows, home, end, word jump)
|
|
7
|
-
* - Line wrapping for long lines
|
|
8
|
-
* - Scrolling for content exceeding visible height
|
|
9
|
-
* - Always visible at bottom of terminal
|
|
10
|
-
* - Scroll region management for output area above
|
|
11
|
-
*/
|
|
12
|
-
import { EventEmitter } from 'node:events';
|
|
13
|
-
export interface ChatBoxConfig {
|
|
14
|
-
/** Number of visible lines in the chat box (default: 3) */
|
|
15
|
-
visibleLines?: number;
|
|
16
|
-
/** Maximum number of lines allowed (default: 100) */
|
|
17
|
-
maxLines?: number;
|
|
18
|
-
/** Prompt string (default: '> ') */
|
|
19
|
-
prompt?: string;
|
|
20
|
-
/** Whether to show line numbers (default: false) */
|
|
21
|
-
showLineNumbers?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export interface ChatBoxState {
|
|
24
|
-
/** The text content as array of lines */
|
|
25
|
-
lines: string[];
|
|
26
|
-
/** Cursor row (0-indexed, within lines array) */
|
|
27
|
-
cursorRow: number;
|
|
28
|
-
/** Cursor column (0-indexed, within current line) */
|
|
29
|
-
cursorCol: number;
|
|
30
|
-
/** Scroll offset (first visible line index) */
|
|
31
|
-
scrollOffset: number;
|
|
32
|
-
/** Whether the box is active/focused */
|
|
33
|
-
isActive: boolean;
|
|
34
|
-
}
|
|
35
|
-
export interface ChatBoxEvents {
|
|
36
|
-
'submit': (text: string) => void;
|
|
37
|
-
'change': (text: string) => void;
|
|
38
|
-
'cancel': () => void;
|
|
39
|
-
'interrupt': () => void;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* ChatBox - A multi-line text input widget fixed at the bottom of the terminal
|
|
43
|
-
*/
|
|
44
|
-
export declare class ChatBox extends EventEmitter {
|
|
45
|
-
private readonly config;
|
|
46
|
-
private readonly writeStream;
|
|
47
|
-
private readonly readStream;
|
|
48
|
-
private state;
|
|
49
|
-
private keypressHandler;
|
|
50
|
-
private resizeHandler;
|
|
51
|
-
private scrollRegionActive;
|
|
52
|
-
private originalStdoutWrite;
|
|
53
|
-
private outputIntercepted;
|
|
54
|
-
constructor(config?: ChatBoxConfig, writeStream?: NodeJS.WriteStream, readStream?: NodeJS.ReadStream);
|
|
55
|
-
/**
|
|
56
|
-
* Get terminal dimensions
|
|
57
|
-
*/
|
|
58
|
-
private getTerminalSize;
|
|
59
|
-
/**
|
|
60
|
-
* Safely get a line from the buffer, returning empty string if undefined
|
|
61
|
-
*/
|
|
62
|
-
private getLine;
|
|
63
|
-
/**
|
|
64
|
-
* Safely set a line in the buffer
|
|
65
|
-
*/
|
|
66
|
-
private setLine;
|
|
67
|
-
/**
|
|
68
|
-
* Calculate the row where the chat box starts (from terminal top)
|
|
69
|
-
*/
|
|
70
|
-
private getChatBoxStartRow;
|
|
71
|
-
/**
|
|
72
|
-
* Set up scroll region to protect the chat box area at bottom.
|
|
73
|
-
* All output written to stdout will scroll within the region above the chat box.
|
|
74
|
-
*/
|
|
75
|
-
setupScrollRegion(): void;
|
|
76
|
-
/**
|
|
77
|
-
* Reset scroll region to full terminal
|
|
78
|
-
*/
|
|
79
|
-
resetScrollRegion(): void;
|
|
80
|
-
/**
|
|
81
|
-
* Intercept stdout to position output correctly in scroll region
|
|
82
|
-
*/
|
|
83
|
-
private interceptOutput;
|
|
84
|
-
/**
|
|
85
|
-
* Restore original stdout.write
|
|
86
|
-
*/
|
|
87
|
-
private restoreOutput;
|
|
88
|
-
/**
|
|
89
|
-
* Write to the output area (above the chat box)
|
|
90
|
-
* This is the proper way for other code to output while chat box is active
|
|
91
|
-
*/
|
|
92
|
-
writeToOutput(text: string): void;
|
|
93
|
-
/**
|
|
94
|
-
* Activate the chat box - start listening for input
|
|
95
|
-
*/
|
|
96
|
-
activate(): void;
|
|
97
|
-
/**
|
|
98
|
-
* Clear screen and set up the chat box at bottom
|
|
99
|
-
*/
|
|
100
|
-
private clearAndSetup;
|
|
101
|
-
/**
|
|
102
|
-
* Deactivate the chat box - stop listening for input
|
|
103
|
-
*/
|
|
104
|
-
deactivate(): void;
|
|
105
|
-
/**
|
|
106
|
-
* Handle keypress events
|
|
107
|
-
*/
|
|
108
|
-
private handleKeypress;
|
|
109
|
-
/**
|
|
110
|
-
* Insert text at cursor position
|
|
111
|
-
*/
|
|
112
|
-
private insertText;
|
|
113
|
-
/**
|
|
114
|
-
* Insert a newline at cursor position
|
|
115
|
-
*/
|
|
116
|
-
private insertNewline;
|
|
117
|
-
/**
|
|
118
|
-
* Delete character before cursor
|
|
119
|
-
*/
|
|
120
|
-
private deleteBackward;
|
|
121
|
-
/**
|
|
122
|
-
* Delete character after cursor
|
|
123
|
-
*/
|
|
124
|
-
private deleteForward;
|
|
125
|
-
/**
|
|
126
|
-
* Delete word backward
|
|
127
|
-
*/
|
|
128
|
-
private deleteWordBackward;
|
|
129
|
-
/**
|
|
130
|
-
* Kill (delete) to end of line
|
|
131
|
-
*/
|
|
132
|
-
private killToEndOfLine;
|
|
133
|
-
/**
|
|
134
|
-
* Kill (delete) to start of line
|
|
135
|
-
*/
|
|
136
|
-
private killToStartOfLine;
|
|
137
|
-
/**
|
|
138
|
-
* Move cursor left
|
|
139
|
-
*/
|
|
140
|
-
private cursorLeft;
|
|
141
|
-
/**
|
|
142
|
-
* Move cursor right
|
|
143
|
-
*/
|
|
144
|
-
private cursorRight;
|
|
145
|
-
/**
|
|
146
|
-
* Move cursor up
|
|
147
|
-
*/
|
|
148
|
-
private cursorUp;
|
|
149
|
-
/**
|
|
150
|
-
* Move cursor down
|
|
151
|
-
*/
|
|
152
|
-
private cursorDown;
|
|
153
|
-
/**
|
|
154
|
-
* Move cursor to start of line
|
|
155
|
-
*/
|
|
156
|
-
private cursorToLineStart;
|
|
157
|
-
/**
|
|
158
|
-
* Move cursor to end of line
|
|
159
|
-
*/
|
|
160
|
-
private cursorToLineEnd;
|
|
161
|
-
/**
|
|
162
|
-
* Move cursor one word left
|
|
163
|
-
*/
|
|
164
|
-
private cursorWordLeft;
|
|
165
|
-
/**
|
|
166
|
-
* Move cursor one word right
|
|
167
|
-
*/
|
|
168
|
-
private cursorWordRight;
|
|
169
|
-
/**
|
|
170
|
-
* Page up
|
|
171
|
-
*/
|
|
172
|
-
private pageUp;
|
|
173
|
-
/**
|
|
174
|
-
* Page down
|
|
175
|
-
*/
|
|
176
|
-
private pageDown;
|
|
177
|
-
/**
|
|
178
|
-
* Scroll up (without moving cursor)
|
|
179
|
-
*/
|
|
180
|
-
private scrollUp;
|
|
181
|
-
/**
|
|
182
|
-
* Scroll down (without moving cursor)
|
|
183
|
-
*/
|
|
184
|
-
private scrollDown;
|
|
185
|
-
/**
|
|
186
|
-
* Ensure cursor is visible (adjust scroll if needed)
|
|
187
|
-
*/
|
|
188
|
-
private ensureCursorVisible;
|
|
189
|
-
/**
|
|
190
|
-
* Submit the current content
|
|
191
|
-
*/
|
|
192
|
-
private submit;
|
|
193
|
-
/**
|
|
194
|
-
* Get the full text content
|
|
195
|
-
*/
|
|
196
|
-
getText(): string;
|
|
197
|
-
/**
|
|
198
|
-
* Set the text content
|
|
199
|
-
*/
|
|
200
|
-
setText(text: string): void;
|
|
201
|
-
/**
|
|
202
|
-
* Clear the content
|
|
203
|
-
*/
|
|
204
|
-
clear(): void;
|
|
205
|
-
/**
|
|
206
|
-
* Render the chat box
|
|
207
|
-
*/
|
|
208
|
-
render(): void;
|
|
209
|
-
/**
|
|
210
|
-
* Clear the chat box area from screen
|
|
211
|
-
*/
|
|
212
|
-
clearScreen(): void;
|
|
213
|
-
/**
|
|
214
|
-
* Dispose and cleanup
|
|
215
|
-
*/
|
|
216
|
-
dispose(): void;
|
|
217
|
-
/**
|
|
218
|
-
* Check if the chat box is currently active
|
|
219
|
-
*/
|
|
220
|
-
isActive(): boolean;
|
|
221
|
-
/**
|
|
222
|
-
* Get current line count
|
|
223
|
-
*/
|
|
224
|
-
getLineCount(): number;
|
|
225
|
-
}
|
|
226
|
-
export declare function getChatBox(config?: ChatBoxConfig): ChatBox;
|
|
227
|
-
export declare function resetChatBox(): void;
|
|
228
|
-
//# sourceMappingURL=chatBox.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chatBox.d.ts","sourceRoot":"","sources":["../../src/shell/chatBox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAwB3C,MAAM,WAAW,aAAa;IAC5B,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IAC3B,yCAAyC;IACzC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAA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