natureco-cli 5.7.10 → 5.7.12
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "natureco-cli",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.12",
|
|
4
4
|
"description": "OpenClaw'dan daha güvenli, daha hızlı, daha ucuz AI agent CLI. Multi-agent, self-evolving skills, audit log, maliyet optimizasyonu ve NatureCo platform-native.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"natureco": "bin/natureco.js"
|
|
@@ -95,20 +95,25 @@ function escapeEmbeddedNewlines(str) {
|
|
|
95
95
|
if (newlineCount === 0) return str;
|
|
96
96
|
|
|
97
97
|
// Paste algılandı — output filter'a sinyal ver ve summary yaz
|
|
98
|
-
|
|
99
|
-
_pasteContext = { lineCount };
|
|
100
|
-
if (process.stdout.isTTY) {
|
|
101
|
-
process.stdout.write(`\r\x1b[2K[Pasted ~${lineCount} lines]\n`);
|
|
102
|
-
}
|
|
98
|
+
onPasteDetected(str);
|
|
103
99
|
|
|
104
100
|
return str.replace(/\r\n|\r|\n/g, NEWLINE_PLACEHOLDER);
|
|
105
101
|
}
|
|
106
102
|
|
|
103
|
+
function onPasteDetected(pasteStr) {
|
|
104
|
+
const newlineCount = (pasteStr.match(/\r\n|\r|\n/g) || []).length;
|
|
105
|
+
const lineCount = newlineCount + 1;
|
|
106
|
+
_pasteContext = { lineCount };
|
|
107
|
+
// Mevcut satırı temizle (prompt + öncesinde yazılan text) ve özet yaz
|
|
108
|
+
process.stdout.write(`\r\x1b[2K[Pasted ~${lineCount} lines]\n`);
|
|
109
|
+
}
|
|
110
|
+
|
|
107
111
|
function createPasteSafeInput(source = process.stdin) {
|
|
108
112
|
const proxy = new PassThrough();
|
|
109
113
|
|
|
110
114
|
let inPaste = false;
|
|
111
115
|
let carry = ''; // marker'ın chunk sınırında bölünmesine karşı tampon
|
|
116
|
+
let pasteBuffer = ''; // onPasteDetected için biriken paste içeriği
|
|
112
117
|
|
|
113
118
|
const onData = (chunk) => {
|
|
114
119
|
let str = carry + chunk.toString('utf8');
|
|
@@ -121,14 +126,19 @@ function createPasteSafeInput(source = process.stdin) {
|
|
|
121
126
|
if (endIdx === -1) {
|
|
122
127
|
const keepLen = trailingMarkerPrefixLen(str, PASTE_END);
|
|
123
128
|
const flushLen = str.length - keepLen;
|
|
124
|
-
|
|
129
|
+
const segment = str.slice(0, flushLen);
|
|
130
|
+
pasteBuffer += segment;
|
|
131
|
+
out += segment.replace(/\r\n|\r|\n/g, NEWLINE_PLACEHOLDER);
|
|
125
132
|
carry = str.slice(flushLen);
|
|
126
133
|
str = '';
|
|
127
134
|
break;
|
|
128
135
|
}
|
|
129
136
|
const pasted = str.slice(0, endIdx);
|
|
137
|
+
pasteBuffer += pasted;
|
|
130
138
|
out += pasted.replace(/\r\n|\r|\n/g, NEWLINE_PLACEHOLDER);
|
|
131
139
|
inPaste = false;
|
|
140
|
+
onPasteDetected(pasteBuffer);
|
|
141
|
+
pasteBuffer = '';
|
|
132
142
|
str = str.slice(endIdx + PASTE_END.length);
|
|
133
143
|
continue;
|
|
134
144
|
}
|