erosolar-cli 1.7.151 → 1.7.152
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/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|-------|------------|-------------|
|
|
7
7
|
| **Claude Code** |  | ⭐⭐⭐⭐⭐ |
|
|
8
8
|
| **OpenAI Codex CLI** |  | ⭐⭐⭐⭐ |
|
|
9
|
-
| **Erosolar CLI** |  |
|
|
9
|
+
| **Erosolar CLI** |  | ⭐⭐⭐⭐ |
|
|
10
10
|
|
|
11
11
|
### Current State
|
|
12
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Handles multi-line paste detection and summarization
|
|
3
|
-
*
|
|
3
|
+
* Claude Code style: show all lines for small pastes, summarized block for large ones
|
|
4
4
|
*/
|
|
5
5
|
export interface PasteSummary {
|
|
6
6
|
isMultiline: boolean;
|
|
@@ -9,19 +9,23 @@ export interface PasteSummary {
|
|
|
9
9
|
preview: string;
|
|
10
10
|
language?: string;
|
|
11
11
|
summary: string;
|
|
12
|
+
/** Full block display for large pastes */
|
|
13
|
+
blockDisplay: string;
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
16
|
* Detect if text is a multi-line paste (3+ lines)
|
|
15
17
|
*/
|
|
16
18
|
export declare function isMultilinePaste(text: string): boolean;
|
|
17
19
|
/**
|
|
18
|
-
* Generate a
|
|
20
|
+
* Generate a summary of pasted content (Claude Code style)
|
|
19
21
|
*/
|
|
20
22
|
export declare function generatePasteSummary(text: string): PasteSummary;
|
|
21
23
|
/**
|
|
22
|
-
* Format a paste summary for display
|
|
24
|
+
* Format a paste summary for display (Claude Code style)
|
|
25
|
+
* Small pastes: return full content
|
|
26
|
+
* Large pastes: return block summary with first/last lines
|
|
23
27
|
*/
|
|
24
|
-
export declare function formatPasteSummaryForDisplay(summary: PasteSummary): string;
|
|
28
|
+
export declare function formatPasteSummaryForDisplay(summary: PasteSummary, fullContent?: string): string;
|
|
25
29
|
/**
|
|
26
30
|
* Create a display-friendly version of multi-line content
|
|
27
31
|
* Returns both the summary for display and the full content for sending
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multilinePasteHandler.d.ts","sourceRoot":"","sources":["../../src/core/multilinePasteHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"multilinePasteHandler.d.ts","sourceRoot":"","sources":["../../src/core/multilinePasteHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;CACtB;AAKD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGtD;AA2ED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAiC/D;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,YAAY,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAQhG;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CASzD"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Handles multi-line paste detection and summarization
|
|
3
|
-
*
|
|
3
|
+
* Claude Code style: show all lines for small pastes, summarized block for large ones
|
|
4
4
|
*/
|
|
5
|
+
/** Threshold for showing full content vs summarized block */
|
|
6
|
+
const FULL_DISPLAY_LINE_THRESHOLD = 15;
|
|
5
7
|
/**
|
|
6
8
|
* Detect if text is a multi-line paste (3+ lines)
|
|
7
9
|
*/
|
|
@@ -14,14 +16,14 @@ export function isMultilinePaste(text) {
|
|
|
14
16
|
*/
|
|
15
17
|
function detectLanguage(text) {
|
|
16
18
|
const patterns = {
|
|
17
|
-
|
|
19
|
+
code: /\b(const|let|var|function|async|await|import|export|=>)\b/,
|
|
18
20
|
typescript: /\b(interface|type|enum|namespace|declare|as const)\b/,
|
|
19
21
|
python: /\b(def|class|import|from|if __name__|async def)\b/,
|
|
20
22
|
json: /^\s*[\{\[].*[\}\]]\s*$/,
|
|
21
|
-
|
|
23
|
+
markup: /^<[a-z]/i,
|
|
22
24
|
css: /^\s*[\.#\[]?[\w\-]+\s*\{/,
|
|
23
25
|
sql: /\b(SELECT|FROM|WHERE|INSERT|UPDATE|DELETE|CREATE|TABLE)\b/i,
|
|
24
|
-
|
|
26
|
+
script: /^#!/,
|
|
25
27
|
yaml: /^[\w\-]+:\s*\S/m,
|
|
26
28
|
};
|
|
27
29
|
for (const [lang, pattern] of Object.entries(patterns)) {
|
|
@@ -32,13 +34,53 @@ function detectLanguage(text) {
|
|
|
32
34
|
return undefined;
|
|
33
35
|
}
|
|
34
36
|
/**
|
|
35
|
-
* Generate a
|
|
37
|
+
* Generate a block display for large pastes (Claude Code style)
|
|
38
|
+
* Shows first 4 lines, ellipsis with count, and last 2 lines
|
|
39
|
+
*/
|
|
40
|
+
function generateBlockDisplay(lines, lineCount, charCount, language) {
|
|
41
|
+
const typeLabel = language || 'text';
|
|
42
|
+
const sizeStr = charCount >= 1000
|
|
43
|
+
? `${(charCount / 1000).toFixed(1)}k chars`
|
|
44
|
+
: `${charCount} chars`;
|
|
45
|
+
const showFirstLines = 4;
|
|
46
|
+
const showLastLines = 2;
|
|
47
|
+
const hiddenLines = lineCount - showFirstLines - showLastLines;
|
|
48
|
+
const displayLines = [];
|
|
49
|
+
const maxLineWidth = 60;
|
|
50
|
+
// Header line
|
|
51
|
+
displayLines.push(`📋 Pasted ${lineCount} lines (${typeLabel}, ${sizeStr}):`);
|
|
52
|
+
// First N lines (truncate long lines)
|
|
53
|
+
for (let i = 0; i < Math.min(showFirstLines, lines.length); i++) {
|
|
54
|
+
let line = lines[i] || '';
|
|
55
|
+
if (line.length > maxLineWidth) {
|
|
56
|
+
line = line.slice(0, maxLineWidth - 1) + '…';
|
|
57
|
+
}
|
|
58
|
+
displayLines.push(` ${line}`);
|
|
59
|
+
}
|
|
60
|
+
// Ellipsis with hidden count (if there are hidden lines)
|
|
61
|
+
if (hiddenLines > 0) {
|
|
62
|
+
displayLines.push(` ... (${hiddenLines} more lines)`);
|
|
63
|
+
// Last N lines
|
|
64
|
+
for (let i = lineCount - showLastLines; i < lineCount; i++) {
|
|
65
|
+
if (i >= showFirstLines) { // Avoid duplicates
|
|
66
|
+
let line = lines[i] || '';
|
|
67
|
+
if (line.length > maxLineWidth) {
|
|
68
|
+
line = line.slice(0, maxLineWidth - 1) + '…';
|
|
69
|
+
}
|
|
70
|
+
displayLines.push(` ${line}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return displayLines.join('\n');
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Generate a summary of pasted content (Claude Code style)
|
|
36
78
|
*/
|
|
37
79
|
export function generatePasteSummary(text) {
|
|
38
80
|
const lines = text.split('\n');
|
|
39
81
|
const nonEmptyLines = lines.filter(line => line.trim().length > 0);
|
|
40
82
|
const charCount = text.length;
|
|
41
|
-
const lineCount =
|
|
83
|
+
const lineCount = lines.length;
|
|
42
84
|
const language = detectLanguage(text);
|
|
43
85
|
// Create preview: first 60 chars or first line
|
|
44
86
|
let preview = nonEmptyLines[0]?.substring(0, 60) || '';
|
|
@@ -46,13 +88,13 @@ export function generatePasteSummary(text) {
|
|
|
46
88
|
preview += '...';
|
|
47
89
|
}
|
|
48
90
|
// Generate summary description
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
91
|
+
const typeLabel = language || 'text';
|
|
92
|
+
const sizeStr = charCount >= 1000
|
|
93
|
+
? `${(charCount / 1000).toFixed(1)}k chars`
|
|
94
|
+
: `${charCount} chars`;
|
|
95
|
+
const summary = `📋 Pasted ${lineCount} lines (${typeLabel}, ${sizeStr})`;
|
|
96
|
+
// Generate block display for large pastes
|
|
97
|
+
const blockDisplay = generateBlockDisplay(lines, lineCount, charCount, language);
|
|
56
98
|
return {
|
|
57
99
|
isMultiline: true,
|
|
58
100
|
lineCount,
|
|
@@ -60,17 +102,25 @@ export function generatePasteSummary(text) {
|
|
|
60
102
|
preview,
|
|
61
103
|
language,
|
|
62
104
|
summary,
|
|
105
|
+
blockDisplay,
|
|
63
106
|
};
|
|
64
107
|
}
|
|
65
108
|
/**
|
|
66
|
-
* Format a paste summary for display
|
|
109
|
+
* Format a paste summary for display (Claude Code style)
|
|
110
|
+
* Small pastes: return full content
|
|
111
|
+
* Large pastes: return block summary with first/last lines
|
|
67
112
|
*/
|
|
68
|
-
export function formatPasteSummaryForDisplay(summary) {
|
|
69
|
-
|
|
113
|
+
export function formatPasteSummaryForDisplay(summary, fullContent) {
|
|
114
|
+
// For small pastes, show full content
|
|
115
|
+
if (summary.lineCount <= FULL_DISPLAY_LINE_THRESHOLD && fullContent) {
|
|
116
|
+
return fullContent;
|
|
117
|
+
}
|
|
118
|
+
// For large pastes, show block display
|
|
119
|
+
return summary.blockDisplay;
|
|
70
120
|
}
|
|
71
121
|
export function processPaste(text) {
|
|
72
122
|
const summary = generatePasteSummary(text);
|
|
73
|
-
const displaySummary = formatPasteSummaryForDisplay(summary);
|
|
123
|
+
const displaySummary = formatPasteSummaryForDisplay(summary, text);
|
|
74
124
|
return {
|
|
75
125
|
displaySummary,
|
|
76
126
|
fullContent: text,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multilinePasteHandler.js","sourceRoot":"","sources":["../../src/core/multilinePasteHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"multilinePasteHandler.js","sourceRoot":"","sources":["../../src/core/multilinePasteHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,6DAA6D;AAC7D,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAEvC;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACtE,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,IAAY;IAClC,MAAM,QAAQ,GAA2B;QACvC,IAAI,EAAE,2DAA2D;QACjE,UAAU,EAAE,sDAAsD;QAClE,MAAM,EAAE,mDAAmD;QAC3D,IAAI,EAAE,wBAAwB;QAC9B,MAAM,EAAE,UAAU;QAClB,GAAG,EAAE,0BAA0B;QAC/B,GAAG,EAAE,4DAA4D;QACjE,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,iBAAiB;KACxB,CAAC;IAEF,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvD,IAAI,OAAO,CAAC,IAAI,CAAC,IA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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.js",
|
|
6
6
|
"type": "module",
|