erosolar-cli 1.7.31 → 1.7.32
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/shell/composableMessage.d.ts +1 -1
- package/dist/shell/composableMessage.js +2 -2
- package/dist/shell/composableMessage.js.map +1 -1
- package/dist/shell/enhancedInteractiveShell.d.ts +90 -0
- package/dist/shell/enhancedInteractiveShell.d.ts.map +1 -0
- package/dist/shell/enhancedInteractiveShell.js +248 -0
- package/dist/shell/enhancedInteractiveShell.js.map +1 -0
- package/dist/shell/interactiveShell.d.ts +6 -3
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +26 -46
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/multiLinePasteManager.d.ts +106 -0
- package/dist/shell/multiLinePasteManager.d.ts.map +1 -0
- package/dist/shell/multiLinePasteManager.js +308 -0
- package/dist/shell/multiLinePasteManager.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MultiLinePasteManager - Enhanced multi-line paste handling with improved UX
|
|
3
|
+
*
|
|
4
|
+
* Features:
|
|
5
|
+
* - Short block description during input: "[Pasted: 15 lines]"
|
|
6
|
+
* - Full content sent to AI on submission
|
|
7
|
+
* - Graceful handling of large pastes
|
|
8
|
+
* - Visual feedback for paste operations
|
|
9
|
+
* - Configurable preview length
|
|
10
|
+
*/
|
|
11
|
+
export interface MultiLinePasteResult {
|
|
12
|
+
handled: boolean;
|
|
13
|
+
result?: string;
|
|
14
|
+
isPending?: boolean;
|
|
15
|
+
lineCount?: number;
|
|
16
|
+
preview?: string;
|
|
17
|
+
fullContent?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface MultiLinePasteConfig {
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
/** Maximum characters for preview display */
|
|
22
|
+
maxPreviewLength: number;
|
|
23
|
+
/** Time threshold (ms) for multi-line detection */
|
|
24
|
+
pasteThresholdMs: number;
|
|
25
|
+
/** Enable debug logging */
|
|
26
|
+
debug: boolean;
|
|
27
|
+
/** Show visual indicators for paste operations */
|
|
28
|
+
showVisualIndicators: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface PasteState {
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
inPaste: boolean;
|
|
33
|
+
pasteBuffer: string[];
|
|
34
|
+
multiLineBuffer: string[];
|
|
35
|
+
multiLineMode: boolean;
|
|
36
|
+
lastInputTime: number;
|
|
37
|
+
rawPasteBuffer: string;
|
|
38
|
+
capturingRaw: boolean;
|
|
39
|
+
pasteJustCaptured: boolean;
|
|
40
|
+
pasteJustCapturedLineCount: number;
|
|
41
|
+
}
|
|
42
|
+
export declare class MultiLinePasteManager {
|
|
43
|
+
private config;
|
|
44
|
+
private state;
|
|
45
|
+
constructor(config?: Partial<MultiLinePasteConfig>);
|
|
46
|
+
/**
|
|
47
|
+
* Process input and detect multi-line pastes
|
|
48
|
+
*/
|
|
49
|
+
process(input: string): MultiLinePasteResult;
|
|
50
|
+
/**
|
|
51
|
+
* Handle bracketed paste mode (ANSI escape sequences)
|
|
52
|
+
*/
|
|
53
|
+
private handleBracketedPaste;
|
|
54
|
+
/**
|
|
55
|
+
* Handle multi-line detection via timing
|
|
56
|
+
*/
|
|
57
|
+
private handleMultiLineDetection;
|
|
58
|
+
/**
|
|
59
|
+
* Get result for bracketed paste
|
|
60
|
+
*/
|
|
61
|
+
private getBracketedPasteResult;
|
|
62
|
+
/**
|
|
63
|
+
* Generate a short preview description of the paste
|
|
64
|
+
*/
|
|
65
|
+
private generatePreview;
|
|
66
|
+
/**
|
|
67
|
+
* Finalize any pending paste operation
|
|
68
|
+
*/
|
|
69
|
+
finalize(): MultiLinePasteResult | null;
|
|
70
|
+
/**
|
|
71
|
+
* Check if currently processing a paste
|
|
72
|
+
*/
|
|
73
|
+
isInPaste(): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Get current paste buffer
|
|
76
|
+
*/
|
|
77
|
+
getPasteBuffer(): string[];
|
|
78
|
+
/**
|
|
79
|
+
* Reset paste state
|
|
80
|
+
*/
|
|
81
|
+
reset(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Enable/disable paste handling
|
|
84
|
+
*/
|
|
85
|
+
setEnabled(enabled: boolean): void;
|
|
86
|
+
/**
|
|
87
|
+
* Update configuration
|
|
88
|
+
*/
|
|
89
|
+
updateConfig(config: Partial<MultiLinePasteConfig>): void;
|
|
90
|
+
/**
|
|
91
|
+
* Get current state for debugging
|
|
92
|
+
*/
|
|
93
|
+
getState(): PasteState;
|
|
94
|
+
/**
|
|
95
|
+
* Get current configuration
|
|
96
|
+
*/
|
|
97
|
+
getConfig(): MultiLinePasteConfig;
|
|
98
|
+
/**
|
|
99
|
+
* Validate state consistency
|
|
100
|
+
*/
|
|
101
|
+
validateState(): {
|
|
102
|
+
valid: boolean;
|
|
103
|
+
issues: string[];
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=multiLinePasteManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiLinePasteManager.d.ts","sourceRoot":"","sources":["../../src/shell/multiLinePasteManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,6CAA6C;IAC7C,gBAAgB,EAAE,MAAM,CAAC;IACzB,mDAAmD;IACnD,gBAAgB,EAAE,MAAM,CAAC;IACzB,2BAA2B;IAC3B,KAAK,EAAE,OAAO,CAA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AAM,EAAE,CAAA;KAAE;CAoBtD"}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MultiLinePasteManager - Enhanced multi-line paste handling with improved UX
|
|
3
|
+
*
|
|
4
|
+
* Features:
|
|
5
|
+
* - Short block description during input: "[Pasted: 15 lines]"
|
|
6
|
+
* - Full content sent to AI on submission
|
|
7
|
+
* - Graceful handling of large pastes
|
|
8
|
+
* - Visual feedback for paste operations
|
|
9
|
+
* - Configurable preview length
|
|
10
|
+
*/
|
|
11
|
+
const BRACKETED_PASTE_START = '\u001b[200~';
|
|
12
|
+
const BRACKETED_PASTE_END = '\u001b[201~';
|
|
13
|
+
export class MultiLinePasteManager {
|
|
14
|
+
config;
|
|
15
|
+
state;
|
|
16
|
+
constructor(config = {}) {
|
|
17
|
+
this.config = {
|
|
18
|
+
enabled: true,
|
|
19
|
+
maxPreviewLength: 80,
|
|
20
|
+
pasteThresholdMs: 50,
|
|
21
|
+
debug: false,
|
|
22
|
+
showVisualIndicators: true,
|
|
23
|
+
...config
|
|
24
|
+
};
|
|
25
|
+
this.state = {
|
|
26
|
+
enabled: this.config.enabled,
|
|
27
|
+
inPaste: false,
|
|
28
|
+
pasteBuffer: [],
|
|
29
|
+
multiLineBuffer: [],
|
|
30
|
+
multiLineMode: false,
|
|
31
|
+
lastInputTime: 0,
|
|
32
|
+
rawPasteBuffer: '',
|
|
33
|
+
capturingRaw: false,
|
|
34
|
+
pasteJustCaptured: false,
|
|
35
|
+
pasteJustCapturedLineCount: 0
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Process input and detect multi-line pastes
|
|
40
|
+
*/
|
|
41
|
+
process(input) {
|
|
42
|
+
if (!this.state.enabled) {
|
|
43
|
+
return { handled: false };
|
|
44
|
+
}
|
|
45
|
+
const currentTime = Date.now();
|
|
46
|
+
const timeSinceLastInput = currentTime - this.state.lastInputTime;
|
|
47
|
+
this.state.lastInputTime = currentTime;
|
|
48
|
+
// Handle bracketed paste mode
|
|
49
|
+
if (this.handleBracketedPaste(input)) {
|
|
50
|
+
return this.getBracketedPasteResult();
|
|
51
|
+
}
|
|
52
|
+
// Handle multi-line detection via timing
|
|
53
|
+
return this.handleMultiLineDetection(input, timeSinceLastInput);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Handle bracketed paste mode (ANSI escape sequences)
|
|
57
|
+
*/
|
|
58
|
+
handleBracketedPaste(input) {
|
|
59
|
+
if (input.includes(BRACKETED_PASTE_START)) {
|
|
60
|
+
this.state.inPaste = true;
|
|
61
|
+
this.state.pasteBuffer = [];
|
|
62
|
+
const startIndex = input.indexOf(BRACKETED_PASTE_START);
|
|
63
|
+
const contentAfterStart = input.slice(startIndex + BRACKETED_PASTE_START.length);
|
|
64
|
+
if (contentAfterStart.includes(BRACKETED_PASTE_END)) {
|
|
65
|
+
// Complete paste in single input
|
|
66
|
+
const endIndex = contentAfterStart.indexOf(BRACKETED_PASTE_END);
|
|
67
|
+
const pasteContent = contentAfterStart.slice(0, endIndex);
|
|
68
|
+
this.state.pasteBuffer = pasteContent.split('\n');
|
|
69
|
+
this.state.inPaste = false;
|
|
70
|
+
this.state.pasteJustCaptured = true;
|
|
71
|
+
this.state.pasteJustCapturedLineCount = this.state.pasteBuffer.length;
|
|
72
|
+
if (this.config.debug) {
|
|
73
|
+
console.log(`[MultiLinePaste] Complete bracketed paste: ${this.state.pasteBuffer.length} lines`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
// Start of multi-part paste
|
|
78
|
+
this.state.pasteBuffer = contentAfterStart.split('\n');
|
|
79
|
+
}
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
if (this.state.inPaste && input.includes(BRACKETED_PASTE_END)) {
|
|
83
|
+
// End of multi-part paste
|
|
84
|
+
const endIndex = input.indexOf(BRACKETED_PASTE_END);
|
|
85
|
+
const contentBeforeEnd = input.slice(0, endIndex);
|
|
86
|
+
this.state.pasteBuffer.push(...contentBeforeEnd.split('\n'));
|
|
87
|
+
this.state.inPaste = false;
|
|
88
|
+
this.state.pasteJustCaptured = true;
|
|
89
|
+
this.state.pasteJustCapturedLineCount = this.state.pasteBuffer.length;
|
|
90
|
+
if (this.config.debug) {
|
|
91
|
+
console.log(`[MultiLinePaste] Completed multi-part paste: ${this.state.pasteBuffer.length} lines`);
|
|
92
|
+
}
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
if (this.state.inPaste) {
|
|
96
|
+
// Continue accumulating paste content
|
|
97
|
+
this.state.pasteBuffer.push(...input.split('\n'));
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Handle multi-line detection via timing
|
|
104
|
+
*/
|
|
105
|
+
handleMultiLineDetection(input, timeSinceLastInput) {
|
|
106
|
+
const lines = input.split('\n');
|
|
107
|
+
const isRapidInput = timeSinceLastInput < this.config.pasteThresholdMs;
|
|
108
|
+
if (lines.length > 1 && isRapidInput) {
|
|
109
|
+
// Likely a multi-line paste
|
|
110
|
+
if (!this.state.multiLineMode) {
|
|
111
|
+
this.state.multiLineMode = true;
|
|
112
|
+
this.state.multiLineBuffer = [];
|
|
113
|
+
}
|
|
114
|
+
this.state.multiLineBuffer.push(...lines);
|
|
115
|
+
if (this.config.debug) {
|
|
116
|
+
console.log(`[MultiLinePaste] Multi-line paste detected: ${this.state.multiLineBuffer.length} lines`);
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
handled: true,
|
|
120
|
+
isPending: true,
|
|
121
|
+
lineCount: this.state.multiLineBuffer.length,
|
|
122
|
+
preview: this.generatePreview(this.state.multiLineBuffer.join('\n'), this.state.multiLineBuffer.length)
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
if (this.state.multiLineMode) {
|
|
126
|
+
if (isRapidInput) {
|
|
127
|
+
// Continue accumulating
|
|
128
|
+
this.state.multiLineBuffer.push(...lines);
|
|
129
|
+
return {
|
|
130
|
+
handled: true,
|
|
131
|
+
isPending: true,
|
|
132
|
+
lineCount: this.state.multiLineBuffer.length,
|
|
133
|
+
preview: this.generatePreview(this.state.multiLineBuffer.join('\n'), this.state.multiLineBuffer.length)
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
// End of paste
|
|
138
|
+
const result = this.state.multiLineBuffer.join('\n');
|
|
139
|
+
const lineCount = this.state.multiLineBuffer.length;
|
|
140
|
+
this.state.multiLineMode = false;
|
|
141
|
+
this.state.multiLineBuffer = [];
|
|
142
|
+
if (this.config.debug) {
|
|
143
|
+
console.log(`[MultiLinePaste] Multi-line paste completed: ${lineCount} lines`);
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
handled: true,
|
|
147
|
+
result,
|
|
148
|
+
lineCount,
|
|
149
|
+
preview: this.generatePreview(result, lineCount),
|
|
150
|
+
fullContent: result
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return { handled: false };
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Get result for bracketed paste
|
|
158
|
+
*/
|
|
159
|
+
getBracketedPasteResult() {
|
|
160
|
+
if (this.state.inPaste) {
|
|
161
|
+
return {
|
|
162
|
+
handled: true,
|
|
163
|
+
isPending: true,
|
|
164
|
+
lineCount: this.state.pasteBuffer.length,
|
|
165
|
+
preview: this.generatePreview(this.state.pasteBuffer.join('\n'), this.state.pasteBuffer.length)
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
if (this.state.pasteJustCaptured) {
|
|
169
|
+
const result = this.state.pasteBuffer.join('\n');
|
|
170
|
+
const lineCount = this.state.pasteJustCapturedLineCount;
|
|
171
|
+
this.state.pasteJustCaptured = false;
|
|
172
|
+
this.state.pasteJustCapturedLineCount = 0;
|
|
173
|
+
return {
|
|
174
|
+
handled: true,
|
|
175
|
+
result,
|
|
176
|
+
lineCount,
|
|
177
|
+
preview: this.generatePreview(result, lineCount),
|
|
178
|
+
fullContent: result
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
return { handled: false };
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Generate a short preview description of the paste
|
|
185
|
+
*/
|
|
186
|
+
generatePreview(content, lineCount) {
|
|
187
|
+
if (!content.trim()) {
|
|
188
|
+
return `[Empty paste: ${lineCount} lines]`;
|
|
189
|
+
}
|
|
190
|
+
const lines = content.split('\n').map(l => l.trim()).filter(Boolean);
|
|
191
|
+
if (lines.length === 0) {
|
|
192
|
+
return `[Empty paste: ${lineCount} lines]`;
|
|
193
|
+
}
|
|
194
|
+
const firstLine = lines[0] || '';
|
|
195
|
+
const maxLength = this.config.maxPreviewLength - 15; // Reserve space for line count
|
|
196
|
+
let preview = firstLine;
|
|
197
|
+
if (preview && preview.length > maxLength) {
|
|
198
|
+
preview = preview.slice(0, maxLength - 3) + '...';
|
|
199
|
+
}
|
|
200
|
+
const visualIndicator = this.config.showVisualIndicators ? '📋 ' : '';
|
|
201
|
+
return `${visualIndicator}${preview} [${lineCount} lines]`;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Finalize any pending paste operation
|
|
205
|
+
*/
|
|
206
|
+
finalize() {
|
|
207
|
+
if (this.state.multiLineMode && this.state.multiLineBuffer.length > 0) {
|
|
208
|
+
const result = this.state.multiLineBuffer.join('\n');
|
|
209
|
+
const lineCount = this.state.multiLineBuffer.length;
|
|
210
|
+
this.state.multiLineMode = false;
|
|
211
|
+
this.state.multiLineBuffer = [];
|
|
212
|
+
return {
|
|
213
|
+
handled: true,
|
|
214
|
+
result,
|
|
215
|
+
lineCount,
|
|
216
|
+
preview: this.generatePreview(result, lineCount),
|
|
217
|
+
fullContent: result
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
if (this.state.inPaste && this.state.pasteBuffer.length > 0) {
|
|
221
|
+
const result = this.state.pasteBuffer.join('\n');
|
|
222
|
+
const lineCount = this.state.pasteBuffer.length;
|
|
223
|
+
this.state.inPaste = false;
|
|
224
|
+
this.state.pasteBuffer = [];
|
|
225
|
+
return {
|
|
226
|
+
handled: true,
|
|
227
|
+
result,
|
|
228
|
+
lineCount,
|
|
229
|
+
preview: this.generatePreview(result, lineCount),
|
|
230
|
+
fullContent: result
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Check if currently processing a paste
|
|
237
|
+
*/
|
|
238
|
+
isInPaste() {
|
|
239
|
+
return this.state.inPaste || this.state.multiLineMode;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Get current paste buffer
|
|
243
|
+
*/
|
|
244
|
+
getPasteBuffer() {
|
|
245
|
+
return this.state.inPaste ? [...this.state.pasteBuffer] : [...this.state.multiLineBuffer];
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Reset paste state
|
|
249
|
+
*/
|
|
250
|
+
reset() {
|
|
251
|
+
this.state.inPaste = false;
|
|
252
|
+
this.state.pasteBuffer = [];
|
|
253
|
+
this.state.multiLineMode = false;
|
|
254
|
+
this.state.multiLineBuffer = [];
|
|
255
|
+
this.state.rawPasteBuffer = '';
|
|
256
|
+
this.state.capturingRaw = false;
|
|
257
|
+
this.state.pasteJustCaptured = false;
|
|
258
|
+
this.state.pasteJustCapturedLineCount = 0;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Enable/disable paste handling
|
|
262
|
+
*/
|
|
263
|
+
setEnabled(enabled) {
|
|
264
|
+
this.state.enabled = enabled;
|
|
265
|
+
if (!enabled) {
|
|
266
|
+
this.reset();
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Update configuration
|
|
271
|
+
*/
|
|
272
|
+
updateConfig(config) {
|
|
273
|
+
this.config = { ...this.config, ...config };
|
|
274
|
+
this.state.enabled = this.config.enabled;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Get current state for debugging
|
|
278
|
+
*/
|
|
279
|
+
getState() {
|
|
280
|
+
return { ...this.state };
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Get current configuration
|
|
284
|
+
*/
|
|
285
|
+
getConfig() {
|
|
286
|
+
return { ...this.config };
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Validate state consistency
|
|
290
|
+
*/
|
|
291
|
+
validateState() {
|
|
292
|
+
const issues = [];
|
|
293
|
+
if (this.state.inPaste && this.state.pasteBuffer.length === 0) {
|
|
294
|
+
issues.push('In paste mode but buffer is empty');
|
|
295
|
+
}
|
|
296
|
+
if (this.state.multiLineMode && this.state.multiLineBuffer.length === 0) {
|
|
297
|
+
issues.push('In multi-line mode but buffer is empty');
|
|
298
|
+
}
|
|
299
|
+
if (this.state.inPaste && this.state.multiLineMode) {
|
|
300
|
+
issues.push('Both paste and multi-line modes active simultaneously');
|
|
301
|
+
}
|
|
302
|
+
return {
|
|
303
|
+
valid: issues.length === 0,
|
|
304
|
+
issues
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
//# sourceMappingURL=multiLinePasteManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiLinePasteManager.js","sourceRoot":"","sources":["../../src/shell/multiLinePasteManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAoCH,MAAM,qBAAqB,GAAG,aAAa,CAAC;AAC5C,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAE1C,MAAM,OAAO,qBAAqB;IACxB,MAAM,CAAuB;IAC7B,KAAK,CAAa;IAE1B,YAAY,SAAwC,EAAE;QACpD,IAAI,CAAC,MAAM,GAAG;YACZ,OAAO,EAAE,IAAI;YACb,gBAAgB,EAAE,EAAE;YACpB,gBAAgB,EAAE,EAAE;YACpB,KAAK,EAAE,KAAK;YACZ,oBAAoB,EAAE,IAAI;YAC1B,GAAG,MA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5B,CAAC;IAED;;OAEG;IACH,aAAa;QACX,MAAM,MAAM,GAAa,EAAE,CAAC;QAE5B,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9D,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxE,MAAM,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;QACxD,CAAC;QAED,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;YACnD,MAAM,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;QACvE,CAAC;QAED,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;YAC1B,MAAM;SACP,CAAC;IACJ,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "erosolar-cli",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.32",
|
|
4
4
|
"description": "Unified AI agent framework for the command line - Multi-provider support with schema-driven tools, code intelligence, and transparent reasoning",
|
|
5
5
|
"main": "dist/bin/erosolar-optimized.js",
|
|
6
6
|
"type": "module",
|