centaurus-cli 2.9.4 → 2.9.6
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/cli-adapter.d.ts +29 -4
- package/dist/cli-adapter.d.ts.map +1 -1
- package/dist/cli-adapter.js +700 -121
- package/dist/cli-adapter.js.map +1 -1
- package/dist/config/slash-commands.d.ts.map +1 -1
- package/dist/config/slash-commands.js +7 -0
- package/dist/config/slash-commands.js.map +1 -1
- package/dist/context/context-manager.d.ts +10 -0
- package/dist/context/context-manager.d.ts.map +1 -1
- package/dist/context/context-manager.js +17 -0
- package/dist/context/context-manager.js.map +1 -1
- package/dist/context/handlers/docker-handler.d.ts +7 -1
- package/dist/context/handlers/docker-handler.d.ts.map +1 -1
- package/dist/context/handlers/docker-handler.js +89 -16
- package/dist/context/handlers/docker-handler.js.map +1 -1
- package/dist/context/handlers/ssh-handler.d.ts +47 -1
- package/dist/context/handlers/ssh-handler.d.ts.map +1 -1
- package/dist/context/handlers/ssh-handler.js +546 -73
- package/dist/context/handlers/ssh-handler.js.map +1 -1
- package/dist/context/handlers/wsl-handler.d.ts +5 -1
- package/dist/context/handlers/wsl-handler.d.ts.map +1 -1
- package/dist/context/handlers/wsl-handler.js +24 -6
- package/dist/context/handlers/wsl-handler.js.map +1 -1
- package/dist/context/subshell-handler.d.ts +8 -2
- package/dist/context/subshell-handler.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/services/checkpoint-manager.d.ts +162 -0
- package/dist/services/checkpoint-manager.d.ts.map +1 -0
- package/dist/services/checkpoint-manager.js +926 -0
- package/dist/services/checkpoint-manager.js.map +1 -0
- package/dist/services/local-chat-storage.d.ts +3 -1
- package/dist/services/local-chat-storage.d.ts.map +1 -1
- package/dist/services/local-chat-storage.js +8 -3
- package/dist/services/local-chat-storage.js.map +1 -1
- package/dist/tools/background-command.d.ts.map +1 -1
- package/dist/tools/background-command.js +132 -24
- package/dist/tools/background-command.js.map +1 -1
- package/dist/tools/command.d.ts.map +1 -1
- package/dist/tools/command.js +106 -42
- package/dist/tools/command.js.map +1 -1
- package/dist/tools/create-image.d.ts.map +1 -1
- package/dist/tools/create-image.js +43 -18
- package/dist/tools/create-image.js.map +1 -1
- package/dist/tools/file-ops.d.ts.map +1 -1
- package/dist/tools/file-ops.js +12 -12
- package/dist/tools/file-ops.js.map +1 -1
- package/dist/tools/get-diff.d.ts +9 -45
- package/dist/tools/get-diff.d.ts.map +1 -1
- package/dist/tools/get-diff.js +288 -171
- package/dist/tools/get-diff.js.map +1 -1
- package/dist/tools/grep-search.d.ts +1 -1
- package/dist/tools/grep-search.d.ts.map +1 -1
- package/dist/tools/grep-search.js +80 -1
- package/dist/tools/grep-search.js.map +1 -1
- package/dist/tools/types.d.ts +3 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/ui/components/App.d.ts +8 -0
- package/dist/ui/components/App.d.ts.map +1 -1
- package/dist/ui/components/App.js +256 -66
- package/dist/ui/components/App.js.map +1 -1
- package/dist/ui/components/Breadcrumbs.d.ts.map +1 -1
- package/dist/ui/components/Breadcrumbs.js +22 -2
- package/dist/ui/components/Breadcrumbs.js.map +1 -1
- package/dist/ui/components/ConfirmPrompt.d.ts +2 -0
- package/dist/ui/components/ConfirmPrompt.d.ts.map +1 -1
- package/dist/ui/components/ConfirmPrompt.js +8 -3
- package/dist/ui/components/ConfirmPrompt.js.map +1 -1
- package/dist/ui/components/InputBox.d.ts +6 -0
- package/dist/ui/components/InputBox.d.ts.map +1 -1
- package/dist/ui/components/InputBox.js +188 -23
- package/dist/ui/components/InputBox.js.map +1 -1
- package/dist/ui/components/InteractiveShell.d.ts +2 -0
- package/dist/ui/components/InteractiveShell.d.ts.map +1 -1
- package/dist/ui/components/InteractiveShell.js +88 -26
- package/dist/ui/components/InteractiveShell.js.map +1 -1
- package/dist/ui/components/KeyboardHelp.d.ts.map +1 -1
- package/dist/ui/components/KeyboardHelp.js +14 -6
- package/dist/ui/components/KeyboardHelp.js.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.d.ts.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.js +35 -16
- package/dist/ui/components/ToolExecutionMessage.js.map +1 -1
- package/dist/utils/ansi-encoder.d.ts +5 -0
- package/dist/utils/ansi-encoder.d.ts.map +1 -1
- package/dist/utils/ansi-encoder.js +12 -5
- package/dist/utils/ansi-encoder.js.map +1 -1
- package/dist/utils/editor-utils.d.ts +14 -0
- package/dist/utils/editor-utils.d.ts.map +1 -1
- package/dist/utils/editor-utils.js +172 -0
- package/dist/utils/editor-utils.js.map +1 -1
- package/dist/utils/input-classifier.d.ts.map +1 -1
- package/dist/utils/input-classifier.js +2 -1
- package/dist/utils/input-classifier.js.map +1 -1
- package/dist/utils/terminal-output.d.ts +3 -1
- package/dist/utils/terminal-output.d.ts.map +1 -1
- package/dist/utils/terminal-output.js +235 -195
- package/dist/utils/terminal-output.js.map +1 -1
- package/package.json +3 -1
|
@@ -7,71 +7,6 @@
|
|
|
7
7
|
* This module provides functions to correctly process such output so that only the
|
|
8
8
|
* final rendered state is preserved (not intermediate states that should be overwritten).
|
|
9
9
|
*/
|
|
10
|
-
/**
|
|
11
|
-
* Process backspace and carriage return characters to simulate terminal buffer behavior.
|
|
12
|
-
*
|
|
13
|
-
* This is critical for proper display of progress bars and spinners:
|
|
14
|
-
* - \x08 (backspace) moves cursor left
|
|
15
|
-
* - \r (carriage return) moves cursor to start of line (overwrites from beginning)
|
|
16
|
-
* - \n (newline) moves to next line
|
|
17
|
-
*
|
|
18
|
-
* @param input - String containing control characters
|
|
19
|
-
* @returns String with control characters applied (simulating terminal display)
|
|
20
|
-
*/
|
|
21
|
-
function processBackspaces(input) {
|
|
22
|
-
if (!input.includes('\x08') && !input.includes('\r'))
|
|
23
|
-
return input;
|
|
24
|
-
// Process the string character by character, simulating a terminal buffer
|
|
25
|
-
const lines = [];
|
|
26
|
-
let currentLine = '';
|
|
27
|
-
let cursorPos = 0;
|
|
28
|
-
for (let i = 0; i < input.length; i++) {
|
|
29
|
-
const char = input[i];
|
|
30
|
-
if (char === '\x08') {
|
|
31
|
-
// Backspace: move cursor left (but not past beginning)
|
|
32
|
-
if (cursorPos > 0) {
|
|
33
|
-
cursorPos--;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
else if (char === '\r') {
|
|
37
|
-
// Carriage return: reset cursor to start of line
|
|
38
|
-
// This simulates progress bars that overwrite the same line
|
|
39
|
-
// DO NOT append \r to output - just reset cursor position
|
|
40
|
-
cursorPos = 0;
|
|
41
|
-
}
|
|
42
|
-
else if (char === '\n') {
|
|
43
|
-
// Newline: finalize current line and start new one
|
|
44
|
-
// Trim to cursor position to remove orphaned content after \r overwrites
|
|
45
|
-
if (cursorPos < currentLine.length) {
|
|
46
|
-
currentLine = currentLine.substring(0, cursorPos);
|
|
47
|
-
}
|
|
48
|
-
lines.push(currentLine);
|
|
49
|
-
currentLine = '';
|
|
50
|
-
cursorPos = 0;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
// Regular character: insert/overwrite at cursor position
|
|
54
|
-
if (cursorPos < currentLine.length) {
|
|
55
|
-
// Overwrite existing character
|
|
56
|
-
currentLine = currentLine.substring(0, cursorPos) + char + currentLine.substring(cursorPos + 1);
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
// Append to line
|
|
60
|
-
currentLine += char;
|
|
61
|
-
}
|
|
62
|
-
cursorPos++;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
// Add any remaining content in the current line
|
|
66
|
-
if (currentLine.length > 0) {
|
|
67
|
-
// Trim to cursor position in case of trailing orphaned content
|
|
68
|
-
if (cursorPos < currentLine.length) {
|
|
69
|
-
currentLine = currentLine.substring(0, cursorPos);
|
|
70
|
-
}
|
|
71
|
-
lines.push(currentLine);
|
|
72
|
-
}
|
|
73
|
-
return lines.join('\n');
|
|
74
|
-
}
|
|
75
10
|
/**
|
|
76
11
|
* Process terminal output to properly handle carriage returns and ANSI sequences.
|
|
77
12
|
*
|
|
@@ -84,188 +19,293 @@ function processBackspaces(input) {
|
|
|
84
19
|
* @param raw - Raw terminal output with potential \r and ANSI sequences
|
|
85
20
|
* @returns Processed output with only the final rendered state
|
|
86
21
|
*/
|
|
87
|
-
export function processTerminalOutput(raw) {
|
|
22
|
+
export function processTerminalOutput(raw, options) {
|
|
88
23
|
if (!raw)
|
|
89
24
|
return '';
|
|
90
|
-
|
|
91
|
-
//
|
|
92
|
-
//
|
|
93
|
-
|
|
94
|
-
const SCREEN_COLS = 200; // Wide enough for most outputs
|
|
95
|
-
// Initialize screen buffer - array of strings representing each row
|
|
25
|
+
const SCREEN_ROWS = 500;
|
|
26
|
+
// const SCREEN_COLS = 200; // Dynamic columns not needed for array-based storage
|
|
27
|
+
// Initialize screen buffer - array of arrays of Cells
|
|
28
|
+
// We use a sparse approach: rows are created as needed
|
|
96
29
|
const screen = [];
|
|
30
|
+
// Ensure initial rows exist
|
|
97
31
|
for (let i = 0; i < SCREEN_ROWS; i++) {
|
|
98
|
-
screen[i] =
|
|
32
|
+
screen[i] = [];
|
|
99
33
|
}
|
|
100
34
|
let cursorRow = 0;
|
|
101
35
|
let cursorCol = 0;
|
|
102
|
-
let maxRowUsed = 0;
|
|
103
|
-
|
|
36
|
+
let maxRowUsed = 0;
|
|
37
|
+
let currentStyle = ''; // Current accumulated ANSI style sequence
|
|
38
|
+
// Pre-processing: Strip only non-SGR sequences that we don't handle
|
|
39
|
+
// We keep \x1b[...m (SGR) for colors
|
|
104
40
|
let input = raw
|
|
105
|
-
// OSC sequences (
|
|
41
|
+
// OSC sequences (\x1b] ... \x07 or \x1b\) - Robustly consume until terminator
|
|
106
42
|
.replace(/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/g, '')
|
|
107
|
-
.
|
|
108
|
-
// Alternate screen buffer - we don't support alternate screens
|
|
109
|
-
.replace(/\x1b\[\?(?:1049|47)[hl]/g, '')
|
|
110
|
-
// Hide/show cursor - purely visual
|
|
111
|
-
.replace(/\x1b\[\?\d+[hl]/g, '')
|
|
112
|
-
// DEC private mode sequences
|
|
113
|
-
.replace(/\x1b\[\?[\d;]+[a-zA-Z]/g, '')
|
|
114
|
-
// Set/reset mode
|
|
115
|
-
.replace(/\x1b\[\d*[hl]/g, '')
|
|
116
|
-
// SGR (colors/styles) - strip for clean text output
|
|
117
|
-
.replace(/\x1b\[[\d;]*m/g, '')
|
|
118
|
-
.replace(/\x1b\[m/g, '')
|
|
119
|
-
// Cursor save/restore - we'll handle positioning manually
|
|
120
|
-
.replace(/\x1b\[[su]/g, '')
|
|
121
|
-
.replace(/\x1b[78]/g, '')
|
|
122
|
-
// Scroll up/down
|
|
123
|
-
.replace(/\x1b\[\d*[ST]/g, '')
|
|
124
|
-
// Character set designations
|
|
43
|
+
// Character set designations (e.g. \x1b(0)
|
|
125
44
|
.replace(/\x1b[()#][0-9A-Za-z]/g, '')
|
|
126
|
-
|
|
127
|
-
// BEL and Form Feed
|
|
45
|
+
// BEL and Form Feed (ignore for layout)
|
|
128
46
|
.replace(/\x07/g, '')
|
|
129
47
|
.replace(/\x0C/g, '')
|
|
130
|
-
// DEL
|
|
48
|
+
// DEL
|
|
131
49
|
.replace(/\x7F/g, '');
|
|
132
|
-
// Now process the input character by character with escape sequence handling
|
|
133
50
|
let i = 0;
|
|
134
51
|
while (i < input.length) {
|
|
135
52
|
// Check for escape sequences
|
|
136
|
-
if (input[i] === '\x1b'
|
|
137
|
-
// CSI sequence
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
params
|
|
143
|
-
j
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
//
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
53
|
+
if (input[i] === '\x1b') {
|
|
54
|
+
// Check for CSI sequence: ESC [
|
|
55
|
+
if (i + 1 < input.length && input[i + 1] === '[') {
|
|
56
|
+
let j = i + 2;
|
|
57
|
+
// 1. Parameter Bytes (0x30-0x3F): 0-9:;<=>?
|
|
58
|
+
// These includes digits, semicolons, and private mode markers like ? and >
|
|
59
|
+
let params = '';
|
|
60
|
+
while (j < input.length && input.charCodeAt(j) >= 0x30 && input.charCodeAt(j) <= 0x3F) {
|
|
61
|
+
params += input[j];
|
|
62
|
+
j++;
|
|
63
|
+
}
|
|
64
|
+
// 2. Intermediate Bytes (0x20-0x2F): !"#$%&'()*+,-./
|
|
65
|
+
while (j < input.length && input.charCodeAt(j) >= 0x20 && input.charCodeAt(j) <= 0x2F) {
|
|
66
|
+
// We consume but ignore intermediates for now as we don't support them
|
|
67
|
+
j++;
|
|
68
|
+
}
|
|
69
|
+
// 3. Final Byte (0x40-0x7E): @A-Z[\]^_`a-z{|}~
|
|
70
|
+
if (j < input.length && input.charCodeAt(j) >= 0x40 && input.charCodeAt(j) <= 0x7E) {
|
|
71
|
+
const cmd = input[j];
|
|
72
|
+
// Parse parameters only if they exist and aren't just private markers
|
|
73
|
+
// We filter out ?, > etc for the numeric splitting to avoid NaN
|
|
74
|
+
// but keep them in 'params' string for detection if needed.
|
|
75
|
+
const cleanParams = params.replace(/[<>=?]/g, '');
|
|
76
|
+
const numbers = cleanParams.split(';').map(s => parseInt(s) || 0);
|
|
77
|
+
// Default to 1 if missing, for most commands (1-based)
|
|
78
|
+
const n = numbers[0] || 1;
|
|
79
|
+
const m = numbers[1] || 1;
|
|
80
|
+
// Handle supported commands
|
|
81
|
+
switch (cmd) {
|
|
82
|
+
case 'm': // SGR - Select Graphic Rendition (Colors)
|
|
83
|
+
if (params === '' || params === '0' || (cleanParams === '0' && numbers.length === 1)) {
|
|
84
|
+
currentStyle = ''; // Reset
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
// Add to current style.
|
|
88
|
+
// Ideally we should be smarter about merging, but appending works.
|
|
89
|
+
if (numbers.includes(0)) {
|
|
90
|
+
// If sequence contains reset (e.g. 0;1;31), we treat it as reset + others.
|
|
91
|
+
// For simplicity, we just take the whole sequence as the new style
|
|
92
|
+
// since it usually starts with 0 if 0 is present.
|
|
93
|
+
currentStyle = `\x1b[${cleanParams}m`;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
currentStyle += `\x1b[${cleanParams}m`;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
case 'H': // CUP - Cursor Position
|
|
101
|
+
case 'f': // HVP - Horizontal and Vertical Position
|
|
102
|
+
// Defaults are 1,1
|
|
103
|
+
cursorRow = Math.max(0, (numbers[0] || 1) - 1);
|
|
104
|
+
cursorCol = Math.max(0, (numbers[1] || 1) - 1);
|
|
105
|
+
break;
|
|
106
|
+
case 'A': // CUU - Cursor Up
|
|
107
|
+
cursorRow = Math.max(0, cursorRow - n);
|
|
108
|
+
break;
|
|
109
|
+
case 'B': // CUD - Cursor Down
|
|
110
|
+
case 'e': // VPR - Vertical Position Relative
|
|
111
|
+
cursorRow = cursorRow + n;
|
|
112
|
+
break;
|
|
113
|
+
case 'C': // CUF - Cursor Forward
|
|
114
|
+
case 'a': // HPR - Horizontal Position Relative
|
|
115
|
+
cursorCol = cursorCol + n;
|
|
116
|
+
break;
|
|
117
|
+
case 'D': // CUB - Cursor Back
|
|
118
|
+
cursorCol = Math.max(0, cursorCol - n);
|
|
119
|
+
break;
|
|
120
|
+
case 'E': // CNL - Cursor Next Line
|
|
121
|
+
cursorRow = cursorRow + n;
|
|
122
|
+
cursorCol = 0;
|
|
123
|
+
break;
|
|
124
|
+
case 'F': // CPL - Cursor Preceding Line
|
|
125
|
+
cursorRow = Math.max(0, cursorRow - n);
|
|
126
|
+
cursorCol = 0;
|
|
127
|
+
break;
|
|
128
|
+
case 'G': // CHA - Cursor Horizontal Absolute
|
|
129
|
+
cursorCol = Math.max(0, n - 1);
|
|
130
|
+
break;
|
|
131
|
+
case 'd': // VPA - Vertical Position Absolute
|
|
132
|
+
cursorRow = Math.max(0, n - 1);
|
|
133
|
+
break;
|
|
134
|
+
case 'K': // EL - Erase in Line
|
|
135
|
+
{
|
|
136
|
+
const mode = numbers[0] || 0;
|
|
137
|
+
if (!screen[cursorRow])
|
|
138
|
+
screen[cursorRow] = [];
|
|
139
|
+
if (mode === 0) { // Cursor to end
|
|
140
|
+
screen[cursorRow].splice(cursorCol);
|
|
141
|
+
}
|
|
142
|
+
else if (mode === 1) { // Start to cursor
|
|
143
|
+
for (let k = 0; k <= cursorCol; k++) {
|
|
144
|
+
if (k < screen[cursorRow].length) {
|
|
145
|
+
screen[cursorRow][k] = { char: ' ', style: '' };
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else if (mode === 2) { // Entire line
|
|
150
|
+
screen[cursorRow] = [];
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
break;
|
|
154
|
+
case 'J': // ED - Erase in Display
|
|
155
|
+
{
|
|
156
|
+
const mode = numbers[0] || 0;
|
|
157
|
+
if (mode === 0) {
|
|
158
|
+
// Erase from cursor to end of display
|
|
159
|
+
if (screen[cursorRow])
|
|
160
|
+
screen[cursorRow].splice(cursorCol);
|
|
161
|
+
for (let r = cursorRow + 1; r <= maxRowUsed; r++) {
|
|
162
|
+
screen[r] = [];
|
|
163
|
+
}
|
|
164
|
+
maxRowUsed = cursorRow;
|
|
165
|
+
}
|
|
166
|
+
else if (mode === 1) {
|
|
167
|
+
// Erase from start of display to cursor
|
|
168
|
+
for (let r = 0; r < cursorRow; r++) {
|
|
169
|
+
screen[r] = [];
|
|
170
|
+
}
|
|
171
|
+
if (screen[cursorRow]) {
|
|
172
|
+
for (let c = 0; c <= cursorCol; c++) {
|
|
173
|
+
if (c < screen[cursorRow].length) {
|
|
174
|
+
screen[cursorRow][c] = { char: ' ', style: '' };
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
else if (mode === 2 || mode === 3) {
|
|
180
|
+
// Erase entire display (2) or erase display + scrollback (3)
|
|
181
|
+
for (let r = 0; r <= maxRowUsed; r++) {
|
|
182
|
+
screen[r] = [];
|
|
183
|
+
}
|
|
184
|
+
maxRowUsed = cursorRow;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
break;
|
|
188
|
+
// P (DCH), @ (ICH), L (IL), M (DL) - Delete/Insert characters/lines
|
|
189
|
+
// These are complex to implement fully for a buffer-based approach without strict bounds.
|
|
190
|
+
// For now we ignore them to avoid corruption, or we could implement simple versions.
|
|
191
|
+
default:
|
|
192
|
+
// Unknown command, we just consume it (which is the fix for the bug!)
|
|
193
|
+
break;
|
|
198
194
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
195
|
+
// Move past the final byte
|
|
196
|
+
i = j + 1;
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
// Malformed CSI, treat as plain text if no final byte found?
|
|
201
|
+
// Or just consume what we found?
|
|
202
|
+
// ECMA-48 says if it doesn't end with 0x40-0x7E it's not a valid CSI?
|
|
203
|
+
// But in practice we should probably just treat ESC as a char if not valid.
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
// Check for simple ESC sequences (ESC X)
|
|
207
|
+
// e.g. ESC 7 (Save Cursor), ESC 8 (Restore Cursor), ESC M (Reverse Index)
|
|
208
|
+
else if (i + 1 < input.length) {
|
|
209
|
+
// Simple 2-char escape
|
|
210
|
+
const next = input[i + 1];
|
|
211
|
+
// If it is [ it is CSI (handled above)
|
|
212
|
+
// If not, we might want to handle some.
|
|
213
|
+
// However, the main bug is CSI parsing.
|
|
214
|
+
// Let's not be too aggressive with consuming other escapes unless we distinguish them.
|
|
215
|
+
// Valid simple escapes are usually 0x30-0x7E.
|
|
203
216
|
}
|
|
204
|
-
i = j + 1; // Move past the sequence
|
|
205
|
-
continue;
|
|
206
217
|
}
|
|
207
|
-
// Handle control characters
|
|
208
218
|
const char = input[i];
|
|
209
219
|
if (char === '\r') {
|
|
210
|
-
// Carriage return - move to start of line
|
|
211
220
|
cursorCol = 0;
|
|
212
221
|
}
|
|
213
222
|
else if (char === '\n') {
|
|
214
|
-
// Newline - move to next line
|
|
215
223
|
cursorRow++;
|
|
216
224
|
cursorCol = 0;
|
|
217
225
|
}
|
|
218
|
-
else if (char === '\x08') {
|
|
219
|
-
|
|
220
|
-
if (cursorCol > 0) {
|
|
226
|
+
else if (char === '\x08') { // Backspace
|
|
227
|
+
if (cursorCol > 0)
|
|
221
228
|
cursorCol--;
|
|
222
|
-
}
|
|
223
229
|
}
|
|
224
230
|
else if (char === '\t') {
|
|
225
|
-
// Tab - move to next tab stop (every 8 columns)
|
|
226
231
|
cursorCol = Math.floor(cursorCol / 8 + 1) * 8;
|
|
227
232
|
}
|
|
228
233
|
else if (char >= ' ' || char === '\x00') {
|
|
229
|
-
// Skip null bytes
|
|
230
234
|
if (char === '\x00') {
|
|
231
235
|
i++;
|
|
232
236
|
continue;
|
|
233
237
|
}
|
|
234
|
-
//
|
|
235
|
-
// Ensure we have enough rows
|
|
238
|
+
// Ensure row exists
|
|
236
239
|
while (cursorRow >= screen.length) {
|
|
237
|
-
screen.push(
|
|
240
|
+
screen.push([]);
|
|
238
241
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
242
|
+
if (!screen[cursorRow])
|
|
243
|
+
screen[cursorRow] = [];
|
|
244
|
+
// Pad with spaces if needed
|
|
245
|
+
while (screen[cursorRow].length < cursorCol) {
|
|
246
|
+
screen[cursorRow].push({ char: ' ', style: '' });
|
|
243
247
|
}
|
|
244
|
-
// Write
|
|
245
|
-
|
|
246
|
-
screen[cursorRow] = currentLine.substring(0, cursorCol) + char + currentLine.substring(cursorCol + 1);
|
|
248
|
+
// Write cell with current style
|
|
249
|
+
screen[cursorRow][cursorCol] = { char: char, style: currentStyle };
|
|
247
250
|
cursorCol++;
|
|
248
|
-
|
|
249
|
-
if (cursorRow > maxRowUsed) {
|
|
251
|
+
if (cursorRow > maxRowUsed)
|
|
250
252
|
maxRowUsed = cursorRow;
|
|
251
|
-
}
|
|
252
253
|
}
|
|
253
|
-
// Skip other control characters (0x01-0x1A except those handled above)
|
|
254
254
|
i++;
|
|
255
255
|
}
|
|
256
|
-
//
|
|
256
|
+
// ... (previous code)
|
|
257
|
+
// Render to string with optimization
|
|
257
258
|
const outputLines = [];
|
|
259
|
+
let lastRenderedStyle = '';
|
|
258
260
|
for (let row = 0; row <= maxRowUsed; row++) {
|
|
259
|
-
|
|
261
|
+
let lineStr = '';
|
|
262
|
+
const rowCells = screen[row] || [];
|
|
263
|
+
// Ensure we process up to cursor column if this is the cursor row
|
|
264
|
+
// This ensures the cursor is drawn even if it's past the end of text
|
|
265
|
+
const effectiveLength = (options?.highlightCursor && row === cursorRow)
|
|
266
|
+
? Math.max(rowCells.length, cursorCol + 1)
|
|
267
|
+
: rowCells.length;
|
|
268
|
+
for (let col = 0; col < effectiveLength; col++) {
|
|
269
|
+
let cell = rowCells[col] || { char: ' ', style: '' };
|
|
270
|
+
// Apply cursor highlighting
|
|
271
|
+
if (options?.highlightCursor && row === cursorRow && col === cursorCol) {
|
|
272
|
+
// Invert colors for cursor
|
|
273
|
+
// Standard ANSI invert is 7
|
|
274
|
+
// We append it to the current style
|
|
275
|
+
// If style is empty, it becomes \x1b[7m
|
|
276
|
+
// If style is \x1b[31m, it becomes \x1b[31m\x1b[7m
|
|
277
|
+
// We create a temporary cell for rendering
|
|
278
|
+
cell = {
|
|
279
|
+
char: cell.char || ' ', // Ensure visible char for cursor block
|
|
280
|
+
style: cell.style + '\x1b[7m'
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
// If style changed, emit ANSI code
|
|
284
|
+
if (cell.style !== lastRenderedStyle) {
|
|
285
|
+
if (cell.style === '') {
|
|
286
|
+
lineStr += '\x1b[0m';
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
lineStr += '\x1b[0m' + cell.style;
|
|
290
|
+
}
|
|
291
|
+
lastRenderedStyle = cell.style;
|
|
292
|
+
}
|
|
293
|
+
lineStr += cell.char;
|
|
294
|
+
}
|
|
295
|
+
// Reset at end of line
|
|
296
|
+
if (lastRenderedStyle !== '') {
|
|
297
|
+
lineStr += '\x1b[0m';
|
|
298
|
+
lastRenderedStyle = '';
|
|
299
|
+
}
|
|
300
|
+
outputLines.push(lineStr);
|
|
260
301
|
}
|
|
261
|
-
// Join lines and clean up
|
|
262
302
|
let result = outputLines.join('\n');
|
|
263
|
-
//
|
|
303
|
+
// Cleanup
|
|
264
304
|
result = result.replace(/\n{3,}/g, '\n\n');
|
|
265
|
-
// Remove leading empty lines
|
|
266
305
|
result = result.replace(/^\n+/, '');
|
|
267
|
-
// Trim trailing whitespace
|
|
268
306
|
result = result.trimEnd();
|
|
307
|
+
// Ensure final reset
|
|
308
|
+
result += '\x1b[0m';
|
|
269
309
|
return result;
|
|
270
310
|
}
|
|
271
311
|
//# sourceMappingURL=terminal-output.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-output.js","sourceRoot":"","sources":["../../src/utils/terminal-output.ts"],"names":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EAAE,uCAAuC;oBAC/D,KAAK,EAAE,IAAI,CAAC,KAAK,GAAG,SAAS;iBAChC,CAAC;YACN,CAAC;YAED,mCAAmC;YACnC,IAAI,IAAI,CAAC,KAAK,KAAK,iBAAiB,EAAE,CAAC;gBACnC,IAAI,IAAI,CAAC,KAAK,KAAK,EAAE,EAAE,CAAC;oBACpB,OAAO,IAAI,SAAS,CAAC;gBACzB,CAAC;qBAAM,CAAC;oBACJ,OAAO,IAAI,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC;gBACtC,CAAC;gBACD,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC;YACnC,CAAC;YACD,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC;QACzB,CAAC;QAED,uBAAuB;QACvB,IAAI,iBAAiB,KAAK,EAAE,EAAE,CAAC;YAC3B,OAAO,IAAI,SAAS,CAAC;YACrB,iBAAiB,GAAG,EAAE,CAAC;QAC3B,CAAC;QAED,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,IAAI,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEpC,UAAU;IACV,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC3C,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACpC,MAAM,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;IAC1B,qBAAqB;IACrB,MAAM,IAAI,SAAS,CAAC;IAEpB,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "centaurus-cli",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.6",
|
|
4
4
|
"description": "A powerful command-line AI coding assistant with Google Gemini support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -45,8 +45,10 @@
|
|
|
45
45
|
"AUTH_FLOW.md"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
+
"@anthropic-ai/sdk": "^0.74.0",
|
|
48
49
|
"@crosscopy/clipboard": "^0.2.8",
|
|
49
50
|
"@homebridge/node-pty-prebuilt-multiarch": "^0.13.1",
|
|
51
|
+
"@huggingface/transformers": "^3.8.1",
|
|
50
52
|
"@modelcontextprotocol/sdk": "^1.24.2",
|
|
51
53
|
"axios": "^1.12.2",
|
|
52
54
|
"boxen": "^8.0.1",
|