zames_pro 2.82.119 → 2.82.121
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 +12 -0
- package/dist/diff.js +19 -0
- package/dist/tui/InputLine.js +7 -2
- package/dist/tui/edit.js +9 -3
- package/package.json +1 -1
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.121] - 2026-10-24
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **tui:** the input history stores the expanded paste, not its marker
|
|
15
|
+
|
|
16
|
+
## [2.82.120] - 2026-10-24
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- **diff:** a huge file no longer exhausts memory in the diff
|
|
21
|
+
|
|
10
22
|
## [2.82.119] - 2026-10-24
|
|
11
23
|
|
|
12
24
|
### Fixed
|
package/dist/diff.js
CHANGED
|
@@ -27,6 +27,25 @@ export function unifiedDiff(a, b, { label = '' } = {}) {
|
|
|
27
27
|
function diffOps(a, b) {
|
|
28
28
|
const n = a.length;
|
|
29
29
|
const m = b.length;
|
|
30
|
+
// The table is O(n*m) CELLS: a 20 000-line file changed wholesale needs
|
|
31
|
+
// ~400M cells (~3.2 GB) and the process died with an out-of-memory crash
|
|
32
|
+
// (the callers diff arbitrary source files, not "a handful of lines").
|
|
33
|
+
// Past a sane budget, fall back to a positional diff: it is less precise
|
|
34
|
+
// (no LCS alignment) but bounded, and a diff of a huge file is a preview.
|
|
35
|
+
const MAX_CELLS = 4_000_000;
|
|
36
|
+
if ((n + 1) * (m + 1) > MAX_CELLS) {
|
|
37
|
+
const ops = [];
|
|
38
|
+
const max = Math.max(n, m);
|
|
39
|
+
for (let k = 0; k < max; k++) {
|
|
40
|
+
if (k < n && k < m && a[k] === b[k])
|
|
41
|
+
continue;
|
|
42
|
+
if (k < n)
|
|
43
|
+
ops.push({ kind: 'del', line: a[k] });
|
|
44
|
+
if (k < m)
|
|
45
|
+
ops.push({ kind: 'add', line: b[k] });
|
|
46
|
+
}
|
|
47
|
+
return ops;
|
|
48
|
+
}
|
|
30
49
|
// lcs[i][j] = length of the LCS of a[i..] and b[j..].
|
|
31
50
|
const lcs = Array.from({ length: n + 1 }, () => new Array(m + 1).fill(0));
|
|
32
51
|
for (let i = n - 1; i >= 0; i--) {
|
package/dist/tui/InputLine.js
CHANGED
|
@@ -11,7 +11,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
11
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
12
12
|
import { Box, Text, useInput, usePaste, useCursor, useWindowSize, useStdin, } from 'ink';
|
|
13
13
|
import { translate } from '../i18n.js';
|
|
14
|
-
import { inputInnerCols, layoutInput, SUGGEST_PAGE, } from '../input/layout.js';
|
|
14
|
+
import { expandPastes, inputInnerCols, layoutInput, SUGGEST_PAGE, } from '../input/layout.js';
|
|
15
15
|
import { insertText, insertPaste, insertNewline, backspace, del, moveLeft, moveRight, moveHome, moveEnd, wordLeft, wordRight, deleteWordLeft, deleteWordRight, killToLineEnd, moveVisualRows, pushUndo, undoEdit, historyUp, historyDown, searchStart, searchNext, searchAccept, searchCancel, searchInput, searchBackspace, recordHistory, afterSubmit, } from './edit.js';
|
|
16
16
|
import { dispatchKey, parseCsiU } from './keys.js';
|
|
17
17
|
import { useSyncExternalStore } from 'react';
|
|
@@ -70,7 +70,12 @@ export function InputLine(props) {
|
|
|
70
70
|
return;
|
|
71
71
|
if (!s.buf.trim())
|
|
72
72
|
return;
|
|
73
|
-
|
|
73
|
+
// Record the EXPANDED text in the history: the buffer holds a
|
|
74
|
+
// `[Pasted lines#N]` marker for a large paste, the adapter expands it from
|
|
75
|
+
// the paste list, and `afterSubmit` CLEARS that list. Storing the marker
|
|
76
|
+
// made a later Up recall send the literal marker (no body to expand).
|
|
77
|
+
const expanded = expandPastes(s.pastes, s.buf);
|
|
78
|
+
const withHist = recordHistory(s, expanded);
|
|
74
79
|
const next = afterSubmit(withHist);
|
|
75
80
|
setSt(next);
|
|
76
81
|
props.onHistoryChange(withHist.history);
|
package/dist/tui/edit.js
CHANGED
|
@@ -323,12 +323,18 @@ export function searchBackspace(s) {
|
|
|
323
323
|
return s;
|
|
324
324
|
return searchRefresh({ ...s, searchQuery: s.searchQuery.slice(0, -1) }, true);
|
|
325
325
|
}
|
|
326
|
-
/**
|
|
326
|
+
/**
|
|
327
|
+
* Record a submitted message in the history (dedup the last one).
|
|
328
|
+
*
|
|
329
|
+
* `text` is the EXPANDED message (the caller resolves `[Pasted lines#N]`
|
|
330
|
+
* markers first): a marker stored as-is is recalled later into a buffer with
|
|
331
|
+
* no paste body behind it, and the literal marker is sent to the model.
|
|
332
|
+
*/
|
|
327
333
|
export function recordHistory(s, text) {
|
|
328
|
-
if (!text.trim() || s.history[s.history.length - 1] === text) {
|
|
334
|
+
if (!String(text ?? '').trim() || s.history[s.history.length - 1] === text) {
|
|
329
335
|
return { ...s, histIndex: s.history.length, histDraft: '' };
|
|
330
336
|
}
|
|
331
|
-
const history = s.history.concat(text);
|
|
337
|
+
const history = s.history.concat(String(text));
|
|
332
338
|
return { ...s, history, histIndex: history.length, histDraft: '' };
|
|
333
339
|
}
|
|
334
340
|
/** Reset the buffer after a submit (keeps history/pastes cleared). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zames_pro",
|
|
3
|
-
"version": "2.82.
|
|
3
|
+
"version": "2.82.121",
|
|
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": {
|