wormclaude 1.0.207 → 1.0.209

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.
@@ -3,19 +3,35 @@
3
3
  // Snapshot Write/Edit handler'ında, yolu resolveWs ile çözülmüş HALİYLE alınır (doğru dosya).
4
4
  import fs from 'node:fs';
5
5
  import path from 'node:path';
6
- const MAX_SNAP = 5 * 1024 * 1024; // 5MB üstü dosyanın içeriğini saklama (bellek koruması)
7
- const MAX_KEEP = 300; // en fazla bu kadar checkpoint tut
6
+ const MAX_SNAP = 1024 * 1024; // 1MB üstü dosyanın içeriğini saklama (depo şişmesin → donma)
7
+ const MAX_KEEP = 80; // en fazla bu kadar checkpoint tut (depo küçük kalsın)
8
8
  let _cps = [];
9
9
  let _seq = 0;
10
10
  let _storePath = '';
11
+ let _saveTimer = null;
12
+ let _saveDirty = false;
13
+ // DONMA FIX: eskiden her Write/Edit'te TÜM depo SENKRON yazılıyordu (writeFileSync) → depo
14
+ // büyüyünce event-loop kilitleniyordu. Artık ASYNC + DEBOUNCE: arka planda, 250ms'de bir, bloklamadan.
11
15
  function _save() {
12
16
  if (!_storePath)
13
17
  return;
14
- try {
15
- fs.mkdirSync(path.dirname(_storePath), { recursive: true });
16
- fs.writeFileSync(_storePath, JSON.stringify({ seq: _seq, cps: _cps.slice(-MAX_KEEP) }));
17
- }
18
- catch { }
18
+ _saveDirty = true;
19
+ if (_saveTimer)
20
+ return;
21
+ _saveTimer = setTimeout(() => {
22
+ _saveTimer = null;
23
+ if (!_saveDirty)
24
+ return;
25
+ _saveDirty = false;
26
+ try {
27
+ fs.mkdirSync(path.dirname(_storePath), { recursive: true });
28
+ const data = JSON.stringify({ seq: _seq, cps: _cps.slice(-MAX_KEEP) });
29
+ fs.writeFile(_storePath, data, () => { }); // async — event-loop'u BLOKLAMAZ
30
+ }
31
+ catch { }
32
+ }, 250);
33
+ if (_saveTimer.unref)
34
+ _saveTimer.unref();
19
35
  }
20
36
  /** Oturum başında çağrılır — checkpoint deposunu (workspace/.wormclaude/checkpoints.json)
21
37
  * belirler ve varsa yükler (çökme/resume sonrası geri-al hâlâ çalışsın). */
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.207';
19
+ export const VERSION = '1.0.209';
package/dist/tools.js CHANGED
@@ -51,6 +51,18 @@ export function setBashCwd(dir) { bashCwd = dir; }
51
51
  // çağırıp döngüye giriyordu. Aynı (tool,target) 2 dk içinde tekrar gelirse YENİDEN tarama yok —
52
52
  // önceki sonucu + "yeniden tarama, bulgularla yanıtla" notunu dön.
53
53
  const _scanCache = new Map();
54
+ // Yerel analiz araçları (JwtAudit/CodeAudit) döngü-kırıcı: model sonucu raporlamak yerine aynı
55
+ // aracı tekrar çağırıyordu (gerçek-kullanıcı testinde JwtAudit 6 kez). Aynı çağrı 2 dk içinde
56
+ // tekrarlanırsa "zaten yapıldı, metinle özetle" döndür.
57
+ const _localCallCache = new Map();
58
+ function _localRecall(name, keyArg) {
59
+ const k = name + '|' + keyArg.slice(0, 200);
60
+ const prev = _localCallCache.get(k);
61
+ if (prev && Date.now() - prev < 120000)
62
+ return true;
63
+ _localCallCache.set(k, Date.now());
64
+ return false;
65
+ }
54
66
  // Göreli dosya yollarını AKTİF workspace'e (bashCwd) çözer; mutlak yol aynen kalır.
55
67
  // Böylece model "index.html" gibi göreli yol verse bile dosya bilinen klasöre yazılır.
56
68
  export function resolveWs(fp) {
@@ -1005,6 +1017,9 @@ async function execOne(call, hooks) {
1005
1017
  }
1006
1018
  // 3.45) SAST — kaynak kod güvenlik denetimi (YEREL; kod sunucuya gitmez)
1007
1019
  if (call.name === 'CodeAudit') {
1020
+ if (_localRecall('CodeAudit', String(args?.path || '.'))) {
1021
+ return { ok: false, args, output: '[ALREADY-DONE] Bu klasör zaten denetlendi (sonuç yukarıda). TEKRAR CodeAudit çağırma — bulguları ŞİMDİ metinle özetle.' };
1022
+ }
1008
1023
  try {
1009
1024
  const { auditCode } = await import('./codeaudit.js');
1010
1025
  const fsMod = await import('node:fs');
@@ -1040,6 +1055,9 @@ async function execOne(call, hooks) {
1040
1055
  }
1041
1056
  // 3.46) JWT güvenlik analizi (YEREL; token sunucuya gitmez)
1042
1057
  if (call.name === 'JwtAudit') {
1058
+ if (_localRecall('JwtAudit', String(args?.token || ''))) {
1059
+ return { ok: false, args, output: '[ALREADY-DONE] Bu JWT zaten analiz edildi (sonuç yukarıda). TEKRAR JwtAudit çağırma — bulguları ŞİMDİ metinle özetle.' };
1060
+ }
1043
1061
  try {
1044
1062
  const { analyzeJwt } = await import('./jwt.js');
1045
1063
  const r = analyzeJwt(String(args?.token || ''));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.207",
3
+ "version": "1.0.209",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {