erosolar-cli 2.1.94 → 2.1.95
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.
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* StreamingResponseFormatter
|
|
3
|
-
* Claude Code style:
|
|
4
|
-
*
|
|
3
|
+
* Claude Code style: Format streaming content with ⏺ bullet prefix.
|
|
4
|
+
* First line gets bullet, continuation lines are indented.
|
|
5
5
|
*/
|
|
6
6
|
export declare class StreamingResponseFormatter {
|
|
7
7
|
private lineOpen;
|
|
8
8
|
private currentLine;
|
|
9
9
|
private mode;
|
|
10
|
+
private isFirstLine;
|
|
11
|
+
private columns;
|
|
10
12
|
constructor(columns?: number);
|
|
11
13
|
header(): string;
|
|
12
14
|
/**
|
|
@@ -17,7 +19,7 @@ export declare class StreamingResponseFormatter {
|
|
|
17
19
|
formatChunk(chunk: string): string;
|
|
18
20
|
/**
|
|
19
21
|
* Format reasoning chunk with visual indicator
|
|
20
|
-
* Used for extended thinking mode
|
|
22
|
+
* Used for extended thinking mode - uses muted ○ prefix
|
|
21
23
|
*/
|
|
22
24
|
formatReasoningChunk(chunk: string): string;
|
|
23
25
|
finish(options?: string | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamingFormatter.d.ts","sourceRoot":"","sources":["../../src/ui/streamingFormatter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"streamingFormatter.d.ts","sourceRoot":"","sources":["../../src/ui/streamingFormatter.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,qBAAa,0BAA0B;IACrC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,WAAW,CAAM;IACzB,OAAO,CAAC,IAAI,CAAsC;IAClD,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,OAAO,CAAS;gBAEZ,OAAO,CAAC,EAAE,MAAM;IAI5B,MAAM,IAAI,MAAM;IAMhB;;;OAGG;IACH,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,IAAI;IAI5C,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IA0ClC;;;OAGG;IACH,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAqC3C,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,MAAM;IAsBpG,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,QAAQ;CAajB"}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { theme } from './theme.js';
|
|
2
|
+
const BULLET = '⏺';
|
|
3
|
+
const INDENT = ' '; // 2 spaces for continuation lines
|
|
2
4
|
/**
|
|
3
5
|
* StreamingResponseFormatter
|
|
4
|
-
* Claude Code style:
|
|
5
|
-
*
|
|
6
|
+
* Claude Code style: Format streaming content with ⏺ bullet prefix.
|
|
7
|
+
* First line gets bullet, continuation lines are indented.
|
|
6
8
|
*/
|
|
7
9
|
export class StreamingResponseFormatter {
|
|
8
10
|
lineOpen = false;
|
|
9
11
|
currentLine = '';
|
|
10
12
|
mode = 'content';
|
|
13
|
+
isFirstLine = true; // Track if we've output the bullet yet
|
|
14
|
+
columns;
|
|
11
15
|
constructor(columns) {
|
|
12
|
-
clamp(columns ?? 80, 48, 110);
|
|
16
|
+
this.columns = clamp(columns ?? 80, 48, 110);
|
|
13
17
|
}
|
|
14
18
|
header() {
|
|
15
19
|
// Start on a clean line before streaming content
|
|
20
|
+
this.isFirstLine = true;
|
|
16
21
|
return '\n';
|
|
17
22
|
}
|
|
18
23
|
/**
|
|
@@ -27,28 +32,72 @@ export class StreamingResponseFormatter {
|
|
|
27
32
|
return '';
|
|
28
33
|
}
|
|
29
34
|
const normalized = chunk.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
35
|
+
// Build output with bullet formatting
|
|
36
|
+
let output = '';
|
|
37
|
+
const chars = normalized.split('');
|
|
38
|
+
for (const char of chars) {
|
|
39
|
+
// Add bullet prefix for first character of first line
|
|
40
|
+
if (this.isFirstLine && !this.lineOpen) {
|
|
41
|
+
output += `${BULLET} `;
|
|
42
|
+
this.isFirstLine = false;
|
|
43
|
+
this.lineOpen = true;
|
|
44
|
+
}
|
|
45
|
+
if (char === '\n') {
|
|
46
|
+
output += char;
|
|
47
|
+
this.lineOpen = false;
|
|
48
|
+
this.currentLine = '';
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
// If starting a new line after newline, add indent
|
|
52
|
+
if (!this.lineOpen) {
|
|
53
|
+
output += INDENT;
|
|
54
|
+
this.lineOpen = true;
|
|
55
|
+
}
|
|
56
|
+
output += char;
|
|
57
|
+
this.currentLine += char;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
30
60
|
// Apply visual distinction for reasoning blocks
|
|
31
61
|
const formatted = this.mode === 'reasoning'
|
|
32
|
-
? theme.ui.muted(
|
|
33
|
-
:
|
|
34
|
-
// Track whether the line ended cleanly so finish() can close it if needed
|
|
35
|
-
this.lineOpen = !normalized.endsWith('\n');
|
|
36
|
-
this.currentLine = normalized.split('\n').pop() ?? '';
|
|
62
|
+
? theme.ui.muted(output)
|
|
63
|
+
: output;
|
|
37
64
|
return formatted;
|
|
38
65
|
}
|
|
39
66
|
/**
|
|
40
67
|
* Format reasoning chunk with visual indicator
|
|
41
|
-
* Used for extended thinking mode
|
|
68
|
+
* Used for extended thinking mode - uses muted ○ prefix
|
|
42
69
|
*/
|
|
43
70
|
formatReasoningChunk(chunk) {
|
|
44
71
|
if (!chunk) {
|
|
45
72
|
return '';
|
|
46
73
|
}
|
|
47
74
|
const normalized = chunk.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
75
|
+
// Build output with muted bullet formatting for reasoning
|
|
76
|
+
let output = '';
|
|
77
|
+
const chars = normalized.split('');
|
|
78
|
+
for (const char of chars) {
|
|
79
|
+
// Add muted bullet prefix for first character of first line
|
|
80
|
+
if (this.isFirstLine && !this.lineOpen) {
|
|
81
|
+
output += '○ '; // Muted bullet for reasoning
|
|
82
|
+
this.isFirstLine = false;
|
|
83
|
+
this.lineOpen = true;
|
|
84
|
+
}
|
|
85
|
+
if (char === '\n') {
|
|
86
|
+
output += char;
|
|
87
|
+
this.lineOpen = false;
|
|
88
|
+
this.currentLine = '';
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
// If starting a new line after newline, add indent
|
|
92
|
+
if (!this.lineOpen) {
|
|
93
|
+
output += INDENT;
|
|
94
|
+
this.lineOpen = true;
|
|
95
|
+
}
|
|
96
|
+
output += char;
|
|
97
|
+
this.currentLine += char;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return theme.ui.muted(output);
|
|
52
101
|
}
|
|
53
102
|
finish(options) {
|
|
54
103
|
const resolved = typeof options === 'string' ? { note: options } : options ?? {};
|
|
@@ -70,6 +119,7 @@ export class StreamingResponseFormatter {
|
|
|
70
119
|
resetState() {
|
|
71
120
|
this.lineOpen = false;
|
|
72
121
|
this.currentLine = '';
|
|
122
|
+
this.isFirstLine = true;
|
|
73
123
|
}
|
|
74
124
|
modeIcon(mode) {
|
|
75
125
|
switch (mode) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamingFormatter.js","sourceRoot":"","sources":["../../src/ui/streamingFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,0BAA0B;IAC7B,QAAQ,GAAG,KAAK,CAAC;IACjB,WAAW,GAAG,EAAE,CAAC;IACjB,IAAI,GAA4B,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"streamingFormatter.js","sourceRoot":"","sources":["../../src/ui/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AC,IAAI,CAAC;YACnD,MAAM,IAAI,GAAG,UAAU,IAAI,CAAC;QAC9B,CAAC;QAED,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,UAAU;QAChB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IAEO,QAAQ,CAAC,IAA6C;QAC5D,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,QAAQ;gBACX,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACzB,KAAK,MAAM;gBACT,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC5B,KAAK,MAAM;gBACT,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC1B,KAAK,UAAU,CAAC;YAChB;gBACE,OAAO,IAAI,CAAC;QAChB,CAAC;IACH,CAAC;CACF;AAED,SAAS,KAAK,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW;IACpD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;AAC7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "erosolar-cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.95",
|
|
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.js",
|
|
6
6
|
"type": "module",
|