zames_pro 2.82.16 → 2.82.18

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.82.18] - 2026-10-22
11
+
12
+ ### Fixed
13
+
14
+ - **ci:** merge cache-busted coverage rows so the gate stops failing
15
+
16
+ ## [2.82.17] - 2026-10-22
17
+
18
+ ### Fixed
19
+
20
+ - **glm:** drop system/tool turns and read fragments on resume
21
+
10
22
  ## [2.82.16] - 2026-10-22
11
23
 
12
24
  ### Fixed
package/dist/glm-chats.js CHANGED
@@ -154,14 +154,50 @@ export function parseGlmHistory(json) {
154
154
  .sort((a, b) => (Number(a.timestamp) || 0) - (Number(b.timestamp) || 0));
155
155
  const out = [];
156
156
  for (const m of sorted) {
157
+ // The role has been `role` (string, case-insensitive) or `from`
158
+ // (`human`/`assistant`, z.ai's older spelling). Reading only `role`
159
+ // attributed a `from: 'human'` turn to the model.
157
160
  const roleStr = String(m.role ?? '').toLowerCase();
158
- const isUser = roleStr === 'user' || roleStr === 'human';
161
+ const fromStr = String(m.from ?? '').toLowerCase();
162
+ // A SYSTEM/TOOL turn is neither the operator nor the model's answer: z.ai's
163
+ // own system prompt and the sandbox output of its agent runtime used to be
164
+ // restored as model REPLIES (the Qwen parser drops those roles too).
165
+ if (/^(system|tool)$/.test(roleStr) || /^(system|tool)$/.test(fromStr)) {
166
+ continue;
167
+ }
168
+ // A numeric flag uses 1 = user, 2 = assistant (the same convention as
169
+ // Qwen's history); anything else is matched by name.
170
+ const isUser = roleStr === 'user' ||
171
+ roleStr === 'human' ||
172
+ roleStr === '1' ||
173
+ fromStr === 'user' ||
174
+ fromStr === 'human';
159
175
  const role = isUser ? 'user' : 'assistant';
160
176
  let text = '';
161
177
  if (typeof m.content === 'string')
162
178
  text = m.content;
163
179
  else if (typeof m.text === 'string')
164
180
  text = m.text;
181
+ else if (Array.isArray(m.fragments)) {
182
+ const want = role === 'assistant' ? 'RESPONSE' : 'REQUEST';
183
+ for (const fr of m.fragments) {
184
+ if (fr && fr.type === want && typeof fr.content === 'string') {
185
+ text += fr.content;
186
+ }
187
+ }
188
+ }
189
+ // `content_list` (phase-split output) is used when `content` is empty; the
190
+ // reasoning phase must never leak into the restored dialogue as the answer.
191
+ if (!text && Array.isArray(m.content_list)) {
192
+ for (const part of m.content_list) {
193
+ if (!part || typeof part.content !== 'string')
194
+ continue;
195
+ const phase = String(part.phase ?? part.type ?? '');
196
+ if (/think|reason/i.test(phase))
197
+ continue;
198
+ text += part.content;
199
+ }
200
+ }
165
201
  text = text.trim();
166
202
  if (text)
167
203
  out.push({ role, text });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zames_pro",
3
- "version": "2.82.16",
3
+ "version": "2.82.18",
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": {