@hncode/hncode 0.8.1 → 0.8.2
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/README.md +18 -0
- package/README_CN.md +14 -0
- package/package.json +1 -1
- package/src/agent-task.js +354 -337
- package/src/agent.js +19 -3
- package/src/animate.js +35 -0
- package/src/config.js +25 -7
- package/src/file-tree.js +4 -3
- package/src/highlight.js +20 -6
- package/src/i18n.js +825 -0
- package/src/image-row.js +11 -2
- package/src/index.js +730 -610
- package/src/llm.js +146 -21
- package/src/log-file.js +112 -0
- package/src/markdown.js +619 -567
- package/src/migrate-index.js +175 -0
- package/src/migrate.js +392 -0
- package/src/panels.js +9 -7
- package/src/rows-plan-bg.js +3 -2
- package/src/rows-status.js +20 -6
- package/src/rows-tool-result.js +35 -8
- package/src/screen-paint.js +153 -128
- package/src/session-recover.js +317 -0
- package/src/session.js +203 -13
- package/src/swarm-progress.js +5 -1
- package/src/tasks-browser.js +9 -8
- package/src/team-panel.js +12 -11
- package/src/text.js +192 -149
- package/src/tool-line.js +7 -2
- package/src/tool-result.js +400 -327
- package/src/tools/ask-user-question.js +1 -2
- package/src/tools/bash.js +15 -9
- package/src/tools/edit.js +640 -665
- package/src/tools/goal.js +130 -93
- package/src/tools/read.js +141 -133
- package/src/tools/tasks.js +214 -214
- package/src/tools/utils.js +143 -104
- package/src/tui.js +20689 -19943
package/src/image-row.js
CHANGED
|
@@ -56,8 +56,17 @@ export function encodeImageRow(sequence, rows, cols, source) {
|
|
|
56
56
|
*/
|
|
57
57
|
export function isImageRow(line) {
|
|
58
58
|
if (typeof line !== 'string') return false;
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
// SEARCH THE ONE CHARACTER, THEN CONFIRM THE REST.
|
|
60
|
+
//
|
|
61
|
+
// `indexOf(IMAGE_MARK)` scans the whole row for a five-character string. Almost every row is text, so almost every
|
|
62
|
+
// call runs that scan to the end and finds nothing — 14% of a scroll frame's samples on a long transcript.
|
|
63
|
+
//
|
|
64
|
+
// The marker begins with U+0001, which does not occur in rendered text at all. Searching for that single character
|
|
65
|
+
// first lets the common case fail after one vectorised pass over a one-character needle instead of a five-character
|
|
66
|
+
// one, and only a row that actually contains it pays for the rest of the check.
|
|
67
|
+
const at = line.indexOf('\u0001');
|
|
68
|
+
if (at < 0 || at >= 8) return false;
|
|
69
|
+
return line.startsWith(IMAGE_MARK, at) && /^\s*$/.test(line.slice(0, at));
|
|
61
70
|
}
|
|
62
71
|
|
|
63
72
|
/**
|