zames_pro 2.91.0 → 2.93.0

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,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.93.0] - 2026-11-02
11
+
12
+ ### Fixed
13
+
14
+ - **deepseek:** recognize every tool-call shape the chat returns
15
+
16
+ ## [2.92.0] - 2026-11-01
17
+
18
+ ### Changed
19
+
20
+ - Internal improvements.
21
+
10
22
  ## [2.91.0] - 2026-11-01
11
23
 
12
24
  ### Added
@@ -71,7 +71,12 @@ export function responseLooksLikeToolCall(rawResponse) {
71
71
  // colons like "path: ...".
72
72
  (/^\s*[\[\{]/.test(raw) &&
73
73
  /["']?(?:tool|args|command|path|old_string|content|content_base64)["']?\s*:/.test(raw)) ||
74
- /<\s*\|?\s*(DSML|invoke|parameter)/i.test(raw) ||
74
+ /<\s*\|?\s*(DSML|invoke|parameter|tool_use|tool_call|function_call|antml)/i.test(raw) ||
75
+ // OpenAI-style call wrappers: {"function_call": {...}},
76
+ // {"tool_calls": [...]}, {"name": "Bash", "arguments": "..."}. A real
77
+ // shape from the live chat — without these markers the answer was taken
78
+ // as prose and the agent silently stopped instead of calling the tool.
79
+ /["'](?:function_call|tool_calls?|arguments|parameters)["']\s*:/.test(raw) ||
75
80
  /^\s*\[?\s*\{[^}]*$/.test(raw.trim()));
76
81
  }
77
82
  // A respond message is only a real FINAL answer when it carries some meaning.
@@ -252,5 +252,46 @@ export function parseXmlToolCalls(text) {
252
252
  // name in such an answer, so the call can't be restored — but it also must
253
253
  // not be silently taken as the final answer: agent-loop will ask to retry
254
254
  // (looksLikeToolCall triggers on the word parameter/DSML).
255
- return null;
255
+ //
256
+ // ONE exception is restorable: the tool name itself arrives as a parameter
257
+ // (a `name="tool"` parameter next to `name="args"`). A live answer used
258
+ // exactly this shape; before, it was dropped and the agent stalled after a
259
+ // call that never ran.
260
+ return parseBareDsmlCall(text);
261
+ }
262
+ // A call that arrived as a bare list of parameter tags with NO invoke wrapper:
263
+ // the tool name is the `tool` (or `name`) parameter and the arguments are the
264
+ // `args` parameter (JSON) or the remaining ones.
265
+ function parseBareDsmlCall(text) {
266
+ if (!/<[^>]*?parameter/i.test(text))
267
+ return null;
268
+ const args = parseParameters(text);
269
+ const toolRaw = args['tool'] ?? args['tool_name'] ?? args['name'];
270
+ if (typeof toolRaw !== 'string' || !toolRaw.trim())
271
+ return null;
272
+ const tool = toolRaw.trim();
273
+ let finalArgs = {};
274
+ if ('args' in args) {
275
+ const a = args['args'];
276
+ if (a && typeof a === 'object' && !Array.isArray(a)) {
277
+ finalArgs = a;
278
+ }
279
+ else if (typeof a === 'string') {
280
+ try {
281
+ const parsed = JSON.parse(a);
282
+ if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
283
+ finalArgs = parsed;
284
+ }
285
+ }
286
+ catch { }
287
+ }
288
+ }
289
+ for (const k of Object.keys(args)) {
290
+ if (k === 'tool' || k === 'tool_name' || k === 'name' || k === 'args') {
291
+ continue;
292
+ }
293
+ if (!(k in finalArgs))
294
+ finalArgs[k] = args[k];
295
+ }
296
+ return { tool, args: finalArgs };
256
297
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zames_pro",
3
- "version": "2.91.0",
3
+ "version": "2.93.0",
4
4
  "description": "Terminal coding agent that drives a real browser to chat with DeepSeek, Qwen or GLM — 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": {