wormclaude 1.0.107 → 1.0.109
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.js +14 -1
- package/dist/theme.js +1 -1
- package/dist/tools.js +4 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -829,10 +829,23 @@ function App() {
|
|
|
829
829
|
setAsk({ question: q.question, options: q.options.length ? q.options : [{ label: 'OK' }], resolve });
|
|
830
830
|
}),
|
|
831
831
|
});
|
|
832
|
+
// Tool çıktısını context'e eklerken KIS: komut çıktıları (curl/scan vb.) çok gürültülü
|
|
833
|
+
// (SSL handshake, tüm header'lar) ve 32k pencereyi hızla doldurur → baş+son tut, ortayı at.
|
|
834
|
+
// Az token = uzun tarama. Read/dosya araçları model içeriği görsün diye geniş kalır.
|
|
835
|
+
const _capOut = (name, out) => {
|
|
836
|
+
const s = out || '';
|
|
837
|
+
const isCmd = name === 'Bash' || name === 'PowerShell';
|
|
838
|
+
const CAP = isCmd ? 2200 : 8000;
|
|
839
|
+
if (s.length <= CAP)
|
|
840
|
+
return s;
|
|
841
|
+
if (isCmd)
|
|
842
|
+
return s.slice(0, 1400) + `\n… [${s.length - 2000} karakter kısaltıldı] …\n` + s.slice(-600);
|
|
843
|
+
return s.slice(0, CAP) + `\n… [${s.length - CAP} karakter kısaltıldı]`;
|
|
844
|
+
};
|
|
832
845
|
// Sonuçları orijinal sırada geçmişe ekle (OpenAI tool sırası şart)
|
|
833
846
|
for (let i = 0; i < toolCalls.length; i++) {
|
|
834
847
|
historyRef.current = [...historyRef.current, {
|
|
835
|
-
role: 'tool', tool_call_id: toolCalls[i].id, content: results[i].output
|
|
848
|
+
role: 'tool', tool_call_id: toolCalls[i].id, content: _capOut(toolCalls[i].name, results[i].output),
|
|
836
849
|
}];
|
|
837
850
|
}
|
|
838
851
|
// Araç-grubu özeti (2+ araçta tek satır etiket)
|
package/dist/theme.js
CHANGED
package/dist/tools.js
CHANGED
|
@@ -50,7 +50,10 @@ function runBashCapturingCwd(command, timeout) {
|
|
|
50
50
|
const cwd = getBashCwd();
|
|
51
51
|
const opts = { encoding: 'utf8', timeout, maxBuffer: 10 * 1024 * 1024, windowsHide: true, cwd };
|
|
52
52
|
if (process.platform === 'win32') {
|
|
53
|
-
|
|
53
|
+
// stderr'i yakala: yoksa cmd.exe stderr'i terminale "inherit" eder (curl'ün "% Total"
|
|
54
|
+
// progress meter'ı, hata mesajları ekrana sızar). 2>&1 ile stdout'a birleştir → tek akış.
|
|
55
|
+
const _cmd = /2>&1|2>\s*nul/i.test(command) ? command : command + ' 2>&1';
|
|
56
|
+
const out = execSync(_cmd, opts);
|
|
54
57
|
// best-effort: "cd <hedef>" / "cd /d <hedef>" (zincirsiz tek komut)
|
|
55
58
|
const m = /^\s*cd\s+(?:\/d\s+)?"?([^"&|<>]+?)"?\s*$/i.exec(command);
|
|
56
59
|
if (m) {
|