wormclaude 1.0.208 → 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.208';
19
+ export const VERSION = '1.0.209';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.208",
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": {