zames_pro 2.81.20 → 2.81.22
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/answer-parse.js +30 -2
- package/dist/extraTools.js +12 -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.81.22] - 2026-10-22
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **parser:** a tool call whose args are a JSON string is recognized
|
|
15
|
+
|
|
16
|
+
## [2.81.21] - 2026-10-22
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- **extra-tools:** ApplyPatch Add File refuses to overwrite an existing file
|
|
21
|
+
|
|
10
22
|
## [2.81.20] - 2026-10-22
|
|
11
23
|
|
|
12
24
|
### Fixed
|
package/dist/answer-parse.js
CHANGED
|
@@ -221,15 +221,43 @@ function repairRawControlChars(str) {
|
|
|
221
221
|
}
|
|
222
222
|
return out;
|
|
223
223
|
}
|
|
224
|
+
/** True when a value is a string holding the JSON of a plain object. */
|
|
225
|
+
function isJsonObjectString(v) {
|
|
226
|
+
if (typeof v !== 'string')
|
|
227
|
+
return false;
|
|
228
|
+
try {
|
|
229
|
+
const parsed = JSON.parse(v);
|
|
230
|
+
return !!parsed && typeof parsed === 'object' && !Array.isArray(parsed);
|
|
231
|
+
}
|
|
232
|
+
catch {
|
|
233
|
+
return false;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
/** Unwrap a JSON-string `args` into an object; return the value as-is otherwise. */
|
|
237
|
+
function coerceArgsObject(v) {
|
|
238
|
+
if (typeof v === 'string') {
|
|
239
|
+
try {
|
|
240
|
+
const parsed = JSON.parse(v);
|
|
241
|
+
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
|
242
|
+
return parsed;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
catch { }
|
|
246
|
+
}
|
|
247
|
+
return v;
|
|
248
|
+
}
|
|
224
249
|
function tryParse(str) {
|
|
225
250
|
try {
|
|
226
251
|
const obj = JSON.parse(str);
|
|
227
252
|
if (obj &&
|
|
228
253
|
typeof obj.tool === 'string' &&
|
|
229
254
|
obj.args &&
|
|
230
|
-
|
|
255
|
+
// `args` may arrive as a JSON STRING (double-encoded): unwrap it when it
|
|
256
|
+
// parses to a plain object, otherwise the call is not recognized at all
|
|
257
|
+
// and the run either re-asks or ends with the JSON as the final answer.
|
|
258
|
+
(typeof obj.args === 'object' || isJsonObjectString(obj.args)) &&
|
|
231
259
|
!Array.isArray(obj.args)) {
|
|
232
|
-
return obj;
|
|
260
|
+
return { tool: obj.tool, args: coerceArgsObject(obj.args) };
|
|
233
261
|
}
|
|
234
262
|
return null;
|
|
235
263
|
}
|
package/dist/extraTools.js
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "2.81.22",
|
|
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": {
|