zames_pro 2.82.61 → 2.82.62
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/attach-refs.js +21 -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.82.62] - 2026-10-23
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **attachments:** do not inline a binary @file reference as text
|
|
15
|
+
|
|
10
16
|
## [2.82.61] - 2026-10-23
|
|
11
17
|
|
|
12
18
|
### Fixed
|
package/dist/attach-refs.js
CHANGED
|
@@ -6,6 +6,17 @@ import { extractAtFileRefs } from './path-token.js';
|
|
|
6
6
|
// Extracted from src/index.ts so the logic is unit-testable without the whole
|
|
7
7
|
// CLI. This module touches only the filesystem (no browser/terminal).
|
|
8
8
|
const NL = String.fromCharCode(10);
|
|
9
|
+
// A NUL byte in the head is the classic binary signal (text files essentially
|
|
10
|
+
// never contain one). Only the head is scanned: a huge archive must not be
|
|
11
|
+
// walked byte-by-byte just to decide it is not text.
|
|
12
|
+
function isBinaryBuffer(buf) {
|
|
13
|
+
const n = Math.min(buf.length, 8000);
|
|
14
|
+
for (let i = 0; i < n; i++) {
|
|
15
|
+
if (buf[i] === 0)
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
9
20
|
// Resolve a pasted string into a path to an EXISTING file. Handles quoted
|
|
10
21
|
// paths (drag&drop from some file managers adds quotes) and paths relative to
|
|
11
22
|
// the working directory. Returns null when nothing matches.
|
|
@@ -92,13 +103,21 @@ export async function inlineAtRefs(workdir, text) {
|
|
|
92
103
|
const file = await resolveAttachPath(workdir, ref);
|
|
93
104
|
if (!file)
|
|
94
105
|
continue;
|
|
95
|
-
let
|
|
106
|
+
let buf;
|
|
96
107
|
try {
|
|
97
|
-
|
|
108
|
+
buf = await fs.readFile(file);
|
|
98
109
|
}
|
|
99
110
|
catch {
|
|
100
111
|
continue;
|
|
101
112
|
}
|
|
113
|
+
// A BINARY file (an image, an archive, a compiled blob) read as UTF-8
|
|
114
|
+
// becomes replacement characters and NUL bytes in the prompt — the model
|
|
115
|
+
// cannot use that, and the reference was still counted as inlined. Leave
|
|
116
|
+
// it in the text as a plain `@path` reference (the same answer the Read
|
|
117
|
+
// tool gives for a binary file).
|
|
118
|
+
if (isBinaryBuffer(buf))
|
|
119
|
+
continue;
|
|
120
|
+
const raw = buf.toString('utf-8');
|
|
102
121
|
let body = raw;
|
|
103
122
|
let note = '';
|
|
104
123
|
// The per-file cap alone lets the TOTAL budget be overshot: a file that
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zames_pro",
|
|
3
|
-
"version": "2.82.
|
|
3
|
+
"version": "2.82.62",
|
|
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": {
|