wormclaude 1.0.229 → 1.0.231

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/compact.js CHANGED
@@ -53,5 +53,19 @@ export async function runCompact(history, config, focus) {
53
53
  sys ?? { role: 'system', content: 'You are WormClaude.' },
54
54
  { role: 'user', content: 'Önceki konuşmanın özeti (bağlam):\n\n' + summary },
55
55
  ];
56
+ // DRIFT KORUMASI: özet, modelin GERÇEK mevcut isteğini bulanıklaştırıp yanlış davranışa
57
+ // (ör. "sunucuyu başlat" → saçma "paylaşamam") itebiliyor. Son kullanıcı mesajını AYNEN
58
+ // ekle ki model demirlensin. (Blackbox son tool-call/result çiftini korur; bizim minimal
59
+ // eşdeğerimiz: son kullanıcı isteğini verbatim tut.)
60
+ let lastUser = '';
61
+ for (let i = convo.length - 1; i >= 0; i--) {
62
+ if (convo[i].role === 'user' && typeof convo[i].content === 'string') {
63
+ lastUser = convo[i].content;
64
+ break;
65
+ }
66
+ }
67
+ if (lastUser && !/^\s*(önceki konuşmanın özeti|özellikle şuna odaklan)/i.test(lastUser)) {
68
+ newHist.push({ role: 'user', content: 'CURRENT REQUEST (continue exactly this — the summary above is only background, do not refuse or restart it):\n' + lastUser });
69
+ }
56
70
  return { history: newHist, summary };
57
71
  }
package/dist/theme.js CHANGED
@@ -16,4 +16,4 @@ export const theme = {
16
16
  synType: '#a78bfa', // tip/sınıf adları, sabitler
17
17
  synProp: '#e0e0e0', // özellik/anahtar adları
18
18
  };
19
- export const VERSION = '1.0.229';
19
+ export const VERSION = '1.0.231';
package/dist/tools.js CHANGED
@@ -1427,9 +1427,20 @@ export function toolLabel(name, args) {
1427
1427
  return `${name}(...)`;
1428
1428
  }
1429
1429
  // ── Yardımcılar ───────────────────────────────────────────────────────────────
1430
- function walk(dir, out, depth = 0) {
1431
- if (depth > 12 || out.length > 20000)
1430
+ // Taranmayacak ağır/cache dizinleri ev dizini (C:\Users\...) globlanınca .bun/.npm/AppData
1431
+ // gibi on binlerce dosyalı ağaçlar 30dk hang yapıyordu. Bunları atla + zaman bütçesi koy.
1432
+ const _WALK_IGNORE = new Set([
1433
+ 'node_modules', '.git', '.bun', '.npm', '.pnpm-store', '.yarn', '.cache', '.cargo', '.rustup',
1434
+ '.gradle', '.m2', '.nuget', '.conda', '.nvm', '.pyenv', 'appdata', 'application data',
1435
+ '.vscode', '.vscode-server', '.idea', 'dist', 'build', '.next', '.nuxt', '.svelte-kit',
1436
+ 'venv', '.venv', '__pycache__', '.pytest_cache', '.mypy_cache', '.tox', 'target',
1437
+ '.expo', 'library', '.docker', '.android', '.ollama', '$recycle.bin',
1438
+ ]);
1439
+ function walk(dir, out, depth = 0, deadline = 0) {
1440
+ if (depth > 12 || out.length >= 10000)
1432
1441
  return;
1442
+ if (deadline && Date.now() > deadline)
1443
+ return; // zaman bütçesi → ev dizini taramasında hang'i önle
1433
1444
  let entries;
1434
1445
  try {
1435
1446
  entries = fs.readdirSync(dir, { withFileTypes: true });
@@ -1438,13 +1449,16 @@ function walk(dir, out, depth = 0) {
1438
1449
  return;
1439
1450
  }
1440
1451
  for (const e of entries) {
1441
- if (e.name === 'node_modules' || e.name === '.git')
1442
- continue;
1443
- const full = path.join(dir, e.name);
1444
- if (e.isDirectory())
1445
- walk(full, out, depth + 1);
1446
- else
1447
- out.push(full);
1452
+ if (out.length >= 10000 || (deadline && Date.now() > deadline))
1453
+ return;
1454
+ if (e.isDirectory()) {
1455
+ if (_WALK_IGNORE.has(e.name.toLowerCase()))
1456
+ continue;
1457
+ walk(path.join(dir, e.name), out, depth + 1, deadline);
1458
+ }
1459
+ else {
1460
+ out.push(path.join(dir, e.name));
1461
+ }
1448
1462
  }
1449
1463
  }
1450
1464
  function globToRegex(pattern) {
@@ -1882,7 +1896,7 @@ export async function executeTool(name, args) {
1882
1896
  if (name === 'Glob') {
1883
1897
  const base = args.path ? resolveWs(args.path) : getBashCwd();
1884
1898
  const all = [];
1885
- walk(base, all);
1899
+ walk(base, all, 0, Date.now() + 8000);
1886
1900
  const rx = globToRegex(args.pattern);
1887
1901
  let matches = all.filter((f) => rx.test(f.replace(/\\/g, '/')));
1888
1902
  // Değiştirilme zamanına göre sırala (yeni → eski), WormClaude gibi
@@ -1914,7 +1928,7 @@ export async function executeTool(name, args) {
1914
1928
  if (fs.existsSync(base) && fs.statSync(base).isFile())
1915
1929
  files.push(base);
1916
1930
  else
1917
- walk(base, files);
1931
+ walk(base, files, 0, Date.now() + 8000);
1918
1932
  // type / glob filtresi
1919
1933
  let filtered = files;
1920
1934
  if (args.type && TYPE_EXT[args.type]) {
@@ -2222,7 +2236,7 @@ export async function executeTool(name, args) {
2222
2236
  const refRe = new RegExp(`\\b${esc}\\b`);
2223
2237
  const rx = args.action === 'definition' ? defRe : refRe;
2224
2238
  const files = [];
2225
- walk(base, files);
2239
+ walk(base, files, 0, Date.now() + 8000);
2226
2240
  const hits = [];
2227
2241
  for (const f of files) {
2228
2242
  if (hits.length > 100)
package/dist/tui.js CHANGED
@@ -435,6 +435,7 @@ export async function runTui() {
435
435
  const timer = setInterval(() => { spin++; if (busy && !perm && !ask)
436
436
  refresh(); }, 120);
437
437
  let lastSig = '', sameCount = 0, usedWeb = false, lastAnswer = '';
438
+ const sigWindow = []; // dönüşümlü/döngüsel loop tespiti (A,B,A,B) için son imzalar
438
439
  let consecFail = 0, totalFails = 0; // devre-kesici: olmayan araç/sözdizimi döngüsünü kır
439
440
  let reactiveRetried = false; // bağlam taşmasında bir kez compact+retry
440
441
  let secrecyRetried = false; // inceleme görevinde yanlış gizlilik-reddinde bir kez zorla-okut
@@ -568,6 +569,20 @@ export async function runTui() {
568
569
  printItem({ kind: 'note', text: t('tui.loopStop') });
569
570
  break;
570
571
  }
572
+ // Dönüşümlü/döngüsel loop: son 8 turun içinde aynı imza ≥4 kez → A,B,A,B... yakala
573
+ // (ardışık-aynı kontrolünün kaçırdığı 2+ döngü alternasyonu).
574
+ sigWindow.push(sig);
575
+ if (sigWindow.length > 8)
576
+ sigWindow.shift();
577
+ if (sigWindow.length >= 6) {
578
+ const counts = {};
579
+ for (const s of sigWindow)
580
+ counts[s] = (counts[s] || 0) + 1;
581
+ if (Math.max(...Object.values(counts)) >= 4) {
582
+ printItem({ kind: 'note', text: t('tui.loopStop') });
583
+ break;
584
+ }
585
+ }
571
586
  const results = await executeToolCalls(toolCalls, {
572
587
  confirm: (c, args) => new Promise((resolve) => {
573
588
  if (allowAll.has(c.name))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.229",
3
+ "version": "1.0.231",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {