zames_pro 2.82.33 → 2.82.35
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/CHANGELOG.md +12 -0
- package/dist/checkpoint.js +42 -2
- package/dist/undo.js +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.82.35] - 2026-10-22
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **checkpoint:** rebuild the index when index.json is corrupt
|
|
15
|
+
|
|
16
|
+
## [2.82.34] - 2026-10-22
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- **undo:** report no backup when retention is zero
|
|
21
|
+
|
|
10
22
|
## [2.82.33] - 2026-10-22
|
|
11
23
|
|
|
12
24
|
### Fixed
|
package/dist/checkpoint.js
CHANGED
|
@@ -121,13 +121,53 @@ export class CheckpointStore {
|
|
|
121
121
|
await fs.mkdir(this.dir, { recursive: true });
|
|
122
122
|
}
|
|
123
123
|
async _readIndex() {
|
|
124
|
+
let raw;
|
|
124
125
|
try {
|
|
125
|
-
|
|
126
|
-
return Array.isArray(data) ? data : [];
|
|
126
|
+
raw = await fs.readFile(this.indexFile, 'utf-8');
|
|
127
127
|
}
|
|
128
128
|
catch {
|
|
129
129
|
return [];
|
|
130
130
|
}
|
|
131
|
+
try {
|
|
132
|
+
const data = JSON.parse(raw);
|
|
133
|
+
if (Array.isArray(data))
|
|
134
|
+
return data;
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
// A CORRUPT index must not hide the archives that are still on disk:
|
|
138
|
+
// /rewind would say "nothing to rewind" and the next create() would
|
|
139
|
+
// start a fresh index, leaving the orphans unprunable forever.
|
|
140
|
+
}
|
|
141
|
+
return await this._rebuildIndexFromDisk();
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Reconstruct the index from archive file names (`<stamp>-<uniq>.tgz`) when
|
|
145
|
+
* index.json is missing or corrupt. The workdir cannot be recovered from an
|
|
146
|
+
* archive name, so a rebuilt record carries the checkpoint DIR as a last
|
|
147
|
+
* resort — restore() extracts the archive itself, and a wrong workdir only
|
|
148
|
+
* affects the label /checkpoints shows.
|
|
149
|
+
*/
|
|
150
|
+
async _rebuildIndexFromDisk() {
|
|
151
|
+
const out = [];
|
|
152
|
+
let files;
|
|
153
|
+
try {
|
|
154
|
+
files = await fs.readdir(this.dir);
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
return out;
|
|
158
|
+
}
|
|
159
|
+
for (const f of files) {
|
|
160
|
+
const m = /^(\d+)-[0-9a-f]+\.tgz$/.exec(f);
|
|
161
|
+
if (!m)
|
|
162
|
+
continue;
|
|
163
|
+
out.push({
|
|
164
|
+
stamp: Number(m[1]),
|
|
165
|
+
file: path.join(this.dir, f),
|
|
166
|
+
workdir: this.dir,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
out.sort((a, b) => a.stamp - b.stamp);
|
|
170
|
+
return out;
|
|
131
171
|
}
|
|
132
172
|
/**
|
|
133
173
|
* Snapshot `workdir` into a tarball. Best-effort: a missing tar, an
|
package/dist/undo.js
CHANGED
|
@@ -30,6 +30,12 @@ export class UndoStore {
|
|
|
30
30
|
async backup(filePath) {
|
|
31
31
|
if (!this.enabled)
|
|
32
32
|
return null;
|
|
33
|
+
// A retention of ZERO means "keep nothing": the record would be pushed and
|
|
34
|
+
// immediately shifted out (with its .bak unlinked) while the caller was
|
|
35
|
+
// told the backup happened — /undo then had nothing to revert. Report
|
|
36
|
+
// honestly that no backup was taken.
|
|
37
|
+
if (this.maxBackups <= 0)
|
|
38
|
+
return null;
|
|
33
39
|
await this._ensure();
|
|
34
40
|
let content = null;
|
|
35
41
|
let existed = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zames_pro",
|
|
3
|
-
"version": "2.82.
|
|
3
|
+
"version": "2.82.35",
|
|
4
4
|
"description": "Terminal coding agent that drives a real browser to chat with DeepSeek, Qwen and other web LLMs — no API key required. Reads and edits files, runs commands, commits to git, like Claude Code / Codex CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|