zames_pro 2.81.20 → 2.81.21

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 CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.81.21] - 2026-10-22
11
+
12
+ ### Fixed
13
+
14
+ - **extra-tools:** ApplyPatch Add File refuses to overwrite an existing file
15
+
10
16
  ## [2.81.20] - 2026-10-22
11
17
 
12
18
  ### Fixed
@@ -376,6 +376,18 @@ export function createExtraTools(workdir, { undo, todos } = {}) {
376
376
  continue;
377
377
  }
378
378
  if (op.op === 'add') {
379
+ // `Add File:` means CREATE. Applied to an existing file it used to
380
+ // silently OVERWRITE the whole file (the writer just writes the
381
+ // body), so a stale or wrong path destroyed real content with no
382
+ // warning. Refuse; Update/Delete remain for existing files.
383
+ if (await fs
384
+ .stat(file)
385
+ .then(() => true)
386
+ .catch(() => false)) {
387
+ throw new Error('Add File ' +
388
+ op.file +
389
+ ': the file already exists. Use Update File to change it.');
390
+ }
379
391
  const body = op.lines
380
392
  .filter((l) => l.startsWith('+'))
381
393
  .map((l) => l.slice(1))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zames_pro",
3
- "version": "2.81.20",
3
+ "version": "2.81.21",
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": {