zames_pro 2.81.21 → 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 +6 -0
- package/dist/answer-parse.js +30 -2
- package/package.json +1 -1
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.22] - 2026-10-22
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **parser:** a tool call whose args are a JSON string is recognized
|
|
15
|
+
|
|
10
16
|
## [2.81.21] - 2026-10-22
|
|
11
17
|
|
|
12
18
|
### 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/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": {
|