wormclaude 1.0.108 → 1.0.110
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 +16 -0
- package/dist/theme.js +1 -1
- package/dist/tools.js +4 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -688,6 +688,7 @@ function App() {
|
|
|
688
688
|
let lastAnswer = ''; // modelin son (sentez) cevabı
|
|
689
689
|
let lastToolSig = '';
|
|
690
690
|
let sameToolCount = 0;
|
|
691
|
+
let consecFailTurns = 0; // üst üste TÜM araçların başarısız olduğu tur sayısı (devre-kesici)
|
|
691
692
|
let taskIn = 0, taskOut = 0, taskCache = 0; // bu görevin GERÇEK token toplamı (tüm turlar; API usage'dan)
|
|
692
693
|
while (iter < MAX_TURNS) {
|
|
693
694
|
if (ac.signal.aborted) {
|
|
@@ -854,6 +855,21 @@ function App() {
|
|
|
854
855
|
if (sum)
|
|
855
856
|
push({ kind: 'note', text: `⎿ ${sum}` });
|
|
856
857
|
}
|
|
858
|
+
// Devre-kesici: bu turda TÜM araçlar başarısız olduysa say. Üst üste 2 tur olursa
|
|
859
|
+
// modele "DUR ve özetle" dedir — yoksa model olmayan araç/Unix sözdizimini (grep, hydra)
|
|
860
|
+
// deneyip döngüye girip token yakıyor ve hiç bitirmiyor.
|
|
861
|
+
const _allFailed = results.length > 0 && results.every((r) => !r.ok);
|
|
862
|
+
consecFailTurns = _allFailed ? consecFailTurns + 1 : 0;
|
|
863
|
+
if (consecFailTurns >= 2) {
|
|
864
|
+
historyRef.current = [...historyRef.current, {
|
|
865
|
+
role: 'user',
|
|
866
|
+
content: getLang() === 'en'
|
|
867
|
+
? 'Multiple commands failed — the required tool/syntax is not available in this environment. STOP running commands and give a SHORT summary of what you found so far, in the user\'s language. Do not call any more tools.'
|
|
868
|
+
: 'Komutlar üst üste başarısız oldu — bu ortamda gerekli araç/sözdizimi yok. Komut çalıştırmayı BIRAK ve şu ana kadarki bulguları KISA bir özetle ver. Başka araç çağırma.',
|
|
869
|
+
}];
|
|
870
|
+
push({ kind: 'note', text: getLang() === 'en' ? 'Commands kept failing — wrapping up with a summary.' : 'Komutlar başarısız oldu — özetle bitiriliyor.' });
|
|
871
|
+
consecFailTurns = 0;
|
|
872
|
+
}
|
|
857
873
|
}
|
|
858
874
|
if (!done)
|
|
859
875
|
push({ kind: 'note', text: t('note.maxTurns', MAX_TURNS) });
|
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) {
|