zames_pro 2.82.13 → 2.82.14

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.82.14] - 2026-10-22
11
+
12
+ ### Fixed
13
+
14
+ - **glm:** read token usage inside the chat:completion envelope
15
+
10
16
  ## [2.82.13] - 2026-10-22
11
17
 
12
18
  ### Fixed
@@ -197,7 +197,13 @@ export function extractTokenUsage(body) {
197
197
  return lastTotal;
198
198
  try {
199
199
  const obj = JSON.parse(body);
200
- const usage = obj?.usage;
200
+ // A non-streamed reply keeps `usage` inside the same `chat:completion`
201
+ // envelope as the SSE stream (`data.usage`); reading only the top level
202
+ // lost the counter entirely.
203
+ const envelope = obj?.data && typeof obj.data === 'object'
204
+ ? obj.data
205
+ : null;
206
+ const usage = ((envelope ? envelope.usage : undefined) ?? obj?.usage);
201
207
  if (usage) {
202
208
  if (typeof usage.prompt_tokens === 'number')
203
209
  return usage.prompt_tokens;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zames_pro",
3
- "version": "2.82.13",
3
+ "version": "2.82.14",
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": {