zames_pro 2.82.101 → 2.82.103

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.103] - 2026-10-24
11
+
12
+ ### Fixed
13
+
14
+ - **code-blocks:** a fence with a backtick in its info still opens a block
15
+
16
+ ## [2.82.102] - 2026-10-24
17
+
18
+ ### Fixed
19
+
20
+ - **attachments:** recognize non-Latin and punctuated file names
21
+
10
22
  ## [2.82.101] - 2026-10-24
11
23
 
12
24
  ### Fixed
@@ -233,7 +233,25 @@ export function looksLikeFileName(name) {
233
233
  return false;
234
234
  if (/[\r\n]/.test(n))
235
235
  return false;
236
- return /^[\w.\- ]+\.[A-Za-z0-9]{1,8}$/.test(n);
236
+ // `\w` without the `u` flag is ASCII-ONLY: a non-Latin name (`отчёт.pdf`,
237
+ // `文件.txt`, `café.png`) was rejected, so a pasted file stayed plain text
238
+ // instead of becoming an attachment. Split it instead: the LAST dot must be
239
+ // followed by a short alnum extension and the stem must be non-empty and
240
+ // free of path separators/control chars — punctuation legal in downloads
241
+ // (`report (1).pdf`, `file+1.png`, `a&b.txt`) is allowed, prose without an
242
+ // extension is not.
243
+ const dot = n.lastIndexOf('.');
244
+ if (dot <= 0 || dot >= n.length - 1)
245
+ return false;
246
+ const ext = n.slice(dot + 1);
247
+ if (!/^[A-Za-z0-9]{1,8}$/.test(ext))
248
+ return false;
249
+ const stem = n.slice(0, dot);
250
+ if (!stem.trim())
251
+ return false;
252
+ if (/[\\/]/.test(n) || /[\u0000-\u001f\u007f]/.test(n))
253
+ return false;
254
+ return true;
237
255
  }
238
256
  export async function saveToTemp(tmpDir, name, data) {
239
257
  await fs.mkdir(tmpDir, { recursive: true });
@@ -15,15 +15,24 @@ export function extractCodeBlocks(md) {
15
15
  let i = 0;
16
16
  let n = 0;
17
17
  while (i < lines.length) {
18
- const m = /^(\s*)(`{3,}|~{3,})\s*([^`]*)$/.exec(lines[i]);
18
+ // The info string may contain a BACKTICK (CommonMark forbids it, models
19
+ // write it anyway: ```` ```ts` ````, ```` ```c++ `std::vector` ````). The
20
+ // old `[^`]*` rejected such a line, so the block's own CLOSING fence was
21
+ // read as an OPENING one and the following prose became a bogus block.
22
+ const m = /^(\s*)(`{3,}|~{3,})\s*(.*)$/.exec(lines[i]);
19
23
  if (!m) {
20
24
  i++;
21
25
  continue;
22
26
  }
27
+ // A BACKTICK fence cannot carry a backtick in its info (that is what makes
28
+ // it unparseable for CommonMark); treat the trailing text as prose after a
29
+ // plain fence only when the line is exactly a fence. For our purpose the
30
+ // pragmatic rule is: any trailing text is the language label, backticks
31
+ // stripped.
23
32
  const fence = m[2];
24
33
  const marker = fence[0];
25
34
  const minLen = fence.length;
26
- const lang = (m[3] || '').trim();
35
+ const lang = (m[3] || '').replace(/`/g, '').trim();
27
36
  i++;
28
37
  const body = [];
29
38
  let closed = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zames_pro",
3
- "version": "2.82.101",
3
+ "version": "2.82.103",
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": {