wormclaude 1.0.232 → 1.0.234
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/theme.js +1 -1
- package/dist/tools.js +16 -1
- package/dist/tui.js +20 -3
- package/package.json +1 -1
package/dist/theme.js
CHANGED
package/dist/tools.js
CHANGED
|
@@ -802,8 +802,10 @@ export function setPlanMode(on) { planMode = !!on; }
|
|
|
802
802
|
// Turn başında kullanıcının mesajından hesaplanır → compaction'dan ETKİLENMEZ (turn boyu sabit).
|
|
803
803
|
let inspectLock = false;
|
|
804
804
|
const _inspectReads = new Set();
|
|
805
|
+
// Re-read bütçesi (her mod, turn-başı sıfırlanır): aynı dosyayı Edit yapmadan defalarca okuma israfı.
|
|
806
|
+
const _turnReadCount = new Map();
|
|
805
807
|
export function isInspectLock() { return inspectLock; }
|
|
806
|
-
export function setInspectLock(on) { inspectLock = !!on; _inspectReads.clear(); }
|
|
808
|
+
export function setInspectLock(on) { inspectLock = !!on; _inspectReads.clear(); _turnReadCount.clear(); }
|
|
807
809
|
const _INSPECT_VERBS = /(incele|inceler|ne i[şs]e? yar|a[çc][ıi]kla|analiz|g[öo]zden ge[çc]ir|i[çc]inde ne|ne var|[öo]zetle|anlat|what'?s in|what does|what is in|explain|analy[sz]e|review|inspect|understand|describe|summari[sz]e)/i;
|
|
808
810
|
const _ACTION_VERBS = /(yap\b|yaz\b|olu[şs]tur|kur\b|d[üu]zelt|ekle\b|\bsil\b|de[ğg]i[şs]tir|g[üu]ncelle|refactor|implement|\bbuild\b|create|\bmake\b|\bwrite\b|\bfix\b|\badd\b|remove|\bedit\b|setup|install|generate|klonla|clone|indir|[çc]al[ıi][şs]t[ıi]r|\brun\b|tara\b|scan|recon|\baudit\b|denetle|pentest|exploit|payload|dropper)/i;
|
|
809
811
|
// Minified/bundle/hash'li/generated ASSET mı? İnceleme modunda bunları okumak projeyi
|
|
@@ -943,6 +945,19 @@ async function execOne(call, hooks) {
|
|
|
943
945
|
_inspectReads.add(_p);
|
|
944
946
|
}
|
|
945
947
|
}
|
|
948
|
+
// 3.3) RE-READ BÜTÇESİ (her mod): büyük dosyayı (ör. 748 satır) chunk chunk defalarca okuyup
|
|
949
|
+
// yakınsamama israfını kes. Bir dosyayı Edit'leyince sayaç sıfırlanır (doğrulama re-read'i meşru).
|
|
950
|
+
if ((call.name === 'Edit' || call.name === 'Write') && args?.file_path) {
|
|
951
|
+
_turnReadCount.delete(String(args.file_path));
|
|
952
|
+
}
|
|
953
|
+
if (call.name === 'Read' && args?.file_path && !inspectLock) {
|
|
954
|
+
const _rp = String(args.file_path);
|
|
955
|
+
const _n = (_turnReadCount.get(_rp) || 0) + 1;
|
|
956
|
+
_turnReadCount.set(_rp, _n);
|
|
957
|
+
if (_n > 3) {
|
|
958
|
+
return { ok: false, output: `[RE-READ LIMIT] You have already read "${_rp.split(/[\\/]/).pop()}" ${_n - 1}× this turn — its content is in the context above. STOP re-reading it and make the change you planned NOW with Edit. If you need one specific line, use Grep for that line instead of re-reading the whole file. This limit resets once you Edit the file.`, args };
|
|
959
|
+
}
|
|
960
|
+
}
|
|
946
961
|
// 3.4) Güvenlik taraması — kullanıcı "tara/scan/xss/sqli/recon" deyince model bu aracı çağırır;
|
|
947
962
|
// elle PowerShell payload yazmak YERİNE sunucu motorunu (runPentest) çalıştırır.
|
|
948
963
|
if (call.name === 'SecurityScan') {
|
package/dist/tui.js
CHANGED
|
@@ -437,6 +437,7 @@ export async function runTui() {
|
|
|
437
437
|
let lastSig = '', sameCount = 0, usedWeb = false, lastAnswer = '';
|
|
438
438
|
const sigWindow = []; // dönüşümlü/döngüsel loop tespiti (A,B,A,B) için son imzalar
|
|
439
439
|
let consecFail = 0, totalFails = 0; // devre-kesici: olmayan araç/sözdizimi döngüsünü kır
|
|
440
|
+
let fruitless = 0; // boş-arama loop koruması: art arda Glob/Grep "(no matches)" → dur, yol iste
|
|
440
441
|
let reactiveRetried = false; // bağlam taşmasında bir kez compact+retry
|
|
441
442
|
let secrecyRetried = false; // inceleme görevinde yanlış gizlilik-reddinde bir kez zorla-okut
|
|
442
443
|
try {
|
|
@@ -629,7 +630,15 @@ export async function runTui() {
|
|
|
629
630
|
const _failed = results.filter((r) => !r.ok).length;
|
|
630
631
|
totalFails += _failed;
|
|
631
632
|
consecFail = (results.length > 0 && _failed === results.length) ? consecFail + 1 : 0;
|
|
632
|
-
|
|
633
|
+
// Boş-arama loop: Glob/Grep "(no matches)" ok:true döner → fail-breaker'ı tripe etmez.
|
|
634
|
+
// Bu tur SADECE arama yaptıysa ve HEPSİ boşsa fruitless++ ; bir yararlı sonuç gelince sıfırla.
|
|
635
|
+
const _searchCalls = toolCalls.filter((tc) => /^(Glob|Grep)$/.test(tc.name)).length;
|
|
636
|
+
const _emptySearch = results.filter((r, i) => r.ok && /^(Glob|Grep)$/.test(toolCalls[i].name) && /^\(no matches\)|no matches/i.test((r.output || '').trim())).length;
|
|
637
|
+
if (_searchCalls > 0 && _emptySearch === _searchCalls && _emptySearch === toolCalls.length)
|
|
638
|
+
fruitless += _emptySearch;
|
|
639
|
+
else if (results.some((r) => r.ok && !/^\(no matches\)/i.test((r.output || '').trim())))
|
|
640
|
+
fruitless = 0;
|
|
641
|
+
const _willStop = consecFail >= 2 || totalFails >= 4 || fruitless >= 5;
|
|
633
642
|
// REFLECT-AFTER: bir araç başarısızsa (ve henüz sert-dur eşiğine gelmediysek) modele
|
|
634
643
|
// teşhis+adapte dayat — körlemesine tekrar/pes etmesin, benim gibi "neden + başka yol" düşünsün.
|
|
635
644
|
for (let i = 0; i < toolCalls.length; i++) {
|
|
@@ -644,10 +653,18 @@ export async function runTui() {
|
|
|
644
653
|
if (_willStop) {
|
|
645
654
|
// Model-yönlü direktif İNGİLİZCE (Türkçe direktif instruction-following'i bozar);
|
|
646
655
|
// model yine kullanıcının diliyle özetler. (Kullanıcı-yönlü not aşağıda TR kalır.)
|
|
647
|
-
|
|
648
|
-
|
|
656
|
+
const _searchLoop = fruitless >= 5 && consecFail < 2 && totalFails < 4;
|
|
657
|
+
if (_searchLoop) {
|
|
658
|
+
history.push({ role: 'user', content: 'Your repeated Glob/Grep searches keep returning no matches — the files are not where you are looking. STOP searching now. Ask the user for the exact folder path or file name (in their language), or plainly say you could not find them. Do NOT run more searches.' });
|
|
659
|
+
printItem({ kind: 'note', text: getLang() === 'en' ? 'Searches came up empty — asking for the path.' : 'Aramalar boş döndü — yolu soruyorum.' });
|
|
660
|
+
}
|
|
661
|
+
else {
|
|
662
|
+
history.push({ role: 'user', content: 'Several commands failed — required tools/syntax are not available here (e.g. grep/openssl/hydra on Windows). STOP running commands now and give a SHORT summary of what you found so far, in the user\'s language. Do NOT call more tools, do NOT use grep/sed/awk.' });
|
|
663
|
+
printItem({ kind: 'note', text: getLang() === 'en' ? 'Commands kept failing — wrapping up.' : 'Komutlar başarısız oldu — özetle bitiriliyor.' });
|
|
664
|
+
}
|
|
649
665
|
consecFail = 0;
|
|
650
666
|
totalFails = 0;
|
|
667
|
+
fruitless = 0;
|
|
651
668
|
}
|
|
652
669
|
}
|
|
653
670
|
}
|