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.
- package/dist/checkpoint.js +23 -7
- package/dist/theme.js +1 -1
- package/package.json +1 -1
package/dist/checkpoint.js
CHANGED
|
@@ -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 =
|
|
7
|
-
const MAX_KEEP =
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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