zames_pro 2.50.1 → 2.50.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/dist/config-menu.js +7 -2
- package/dist/input.js +6 -15
- package/dist/self-review.js +2 -2
- package/dist/spinner.js +5 -10
- package/dist/theme.js +10 -1
- package/package.json +1 -1
package/dist/config-menu.js
CHANGED
|
@@ -99,9 +99,14 @@ export function runConfigMenu(opts) {
|
|
|
99
99
|
// Erase the previous block and print the new one. We count VISUAL lines
|
|
100
100
|
// (accounting for wrapping by terminal width), otherwise on narrow
|
|
101
101
|
// terminals you get "garbage" from unerased tails.
|
|
102
|
+
// Reserve the last column. A line whose visible width reaches exactly the
|
|
103
|
+
// terminal width hits the autowrap edge: depending on the terminal it
|
|
104
|
+
// either consumes two rows for the following `\n` or keeps a pending wrap,
|
|
105
|
+
// and in both cases a full-width divisor UNDERCOUNTS the block height — the
|
|
106
|
+
// erase then misses the tail and the config lines DUPLICATE on screen (the
|
|
107
|
+
// reported bug). Overcounting by one is a harmless blank row; undercounting
|
|
108
|
+
// is not, so we bias to the safe side here.
|
|
102
109
|
const cols = output.columns || 80;
|
|
103
|
-
// Reserve the last column like the editor does: a row that fills the
|
|
104
|
-
// terminal exactly can autowrap, which desyncs the block height.
|
|
105
110
|
const usable = Math.max(1, cols - 1);
|
|
106
111
|
const rowsOf = (s) => {
|
|
107
112
|
return Math.max(1, Math.ceil(visCols(s) / usable));
|
package/dist/input.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { theme } from './theme.js';
|
|
1
|
+
import { theme, divider } from './theme.js';
|
|
2
2
|
import { renderMarkdown } from './markdown.js';
|
|
3
3
|
import { randomThinkingPhrase, stripEllipsis, DOTS, renderDots, } from './spinner.js';
|
|
4
4
|
import { translate } from './i18n.js';
|
|
@@ -315,9 +315,6 @@ export class LineEditor {
|
|
|
315
315
|
// True while the dot-animation timer is running. Lets sendPause() update
|
|
316
316
|
// only the base text (remaining seconds) without restarting the timer.
|
|
317
317
|
_animating;
|
|
318
|
-
// Whether the animated status shows the trailing "Esc — стоп" hint. Off
|
|
319
|
-
// while a tool runs (its process cannot be cancelled).
|
|
320
|
-
_showHint;
|
|
321
318
|
_dotPhase;
|
|
322
319
|
_thinkBase;
|
|
323
320
|
// Explicit lifecycle state of the send ('generating' | 'paused' |
|
|
@@ -422,7 +419,6 @@ export class LineEditor {
|
|
|
422
419
|
this._inPaste = false;
|
|
423
420
|
this._dotTimer = null;
|
|
424
421
|
this._animating = false;
|
|
425
|
-
this._showHint = true;
|
|
426
422
|
this._dotPhase = 0;
|
|
427
423
|
this._thinkBase = '';
|
|
428
424
|
this._sendState = '';
|
|
@@ -1071,10 +1067,10 @@ export class LineEditor {
|
|
|
1071
1067
|
_dots(n) {
|
|
1072
1068
|
return renderDots(n);
|
|
1073
1069
|
}
|
|
1074
|
-
// Status-line hint ("Esc — stop"), localized.
|
|
1070
|
+
// Status-line hint ("Esc — stop"), localized. Shown for every animated
|
|
1071
|
+
// state: Esc really aborts both a generation and a running tool (the Bash
|
|
1072
|
+
// child is killed via AbortSignal), so the promise is accurate.
|
|
1075
1073
|
_hint() {
|
|
1076
|
-
if (!this._showHint)
|
|
1077
|
-
return '';
|
|
1078
1074
|
return theme.dim(' · ' + translate(this.locale)('spinner.hint'));
|
|
1079
1075
|
}
|
|
1080
1076
|
// The lifecycle phase prefix for the status line, colored by meaning:
|
|
@@ -1110,13 +1106,8 @@ export class LineEditor {
|
|
|
1110
1106
|
// Shared by the thinking spinner and the send-pause indicator, so the pause
|
|
1111
1107
|
// is animated too (previously the pause was a static console line and the
|
|
1112
1108
|
// dots stayed frozen).
|
|
1113
|
-
|
|
1114
|
-
// `showHint` (default true) controls the trailing "· Esc — стоп". While a
|
|
1115
|
-
// TOOL runs we hide it: the tool's child process cannot be killed, so
|
|
1116
|
-
// promising "Esc to stop" would be misleading.
|
|
1117
|
-
_startAnimated(baseText, showHint = true) {
|
|
1109
|
+
_startAnimated(baseText) {
|
|
1118
1110
|
this._thinkBase = theme.brown(stripEllipsis(baseText));
|
|
1119
|
-
this._showHint = showHint;
|
|
1120
1111
|
this._dotPhase = 0;
|
|
1121
1112
|
this.setStatus(this._thinkBase + this._dots(0) + this._hint());
|
|
1122
1113
|
this._stopDots();
|
|
@@ -1194,7 +1185,7 @@ export class LineEditor {
|
|
|
1194
1185
|
NL +
|
|
1195
1186
|
rendered +
|
|
1196
1187
|
NL +
|
|
1197
|
-
theme.dim(
|
|
1188
|
+
theme.dim(divider()));
|
|
1198
1189
|
}
|
|
1199
1190
|
// Warning to the operator (e.g. the agent stopped suspiciously).
|
|
1200
1191
|
// Printed above the input line without overwriting it.
|
package/dist/self-review.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import fs from 'fs/promises';
|
|
3
|
-
import { theme } from './theme.js';
|
|
3
|
+
import { theme, divider } from './theme.js';
|
|
4
4
|
import { translate, DEFAULT_LOCALE } from './i18n.js';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
6
|
import { ZAMES_HOME } from './config.js';
|
|
@@ -116,7 +116,7 @@ export async function selfReview({ browser, focus, transcript, locale, }) {
|
|
|
116
116
|
await fs.writeFile(reportPath, finalMessage || t('self.report_empty'), 'utf-8');
|
|
117
117
|
// Compute what changed
|
|
118
118
|
const changed = await diffFiles(SRC_DIR, snapDir);
|
|
119
|
-
console.log(theme.system(
|
|
119
|
+
console.log(theme.system(divider()));
|
|
120
120
|
console.log(theme.system(t('self.report_path', { v: reportPath })));
|
|
121
121
|
console.log(theme.system(t('self.snapshot_path', { v: snapDir })));
|
|
122
122
|
if (changed.length) {
|
package/dist/spinner.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ora from 'ora';
|
|
2
|
-
import { theme } from './theme.js';
|
|
2
|
+
import { theme, divider } from './theme.js';
|
|
3
3
|
import { renderMarkdown } from './markdown.js';
|
|
4
4
|
import { translate } from './i18n.js';
|
|
5
5
|
// Phrases for the "agent is working" spinner. Chosen in random order.
|
|
@@ -59,14 +59,9 @@ export function createSpinner(locale = 'ru') {
|
|
|
59
59
|
// "running" dot sequence. Shared by the thinking spinner and the send-pause
|
|
60
60
|
// indicator, so the pause is animated too (before, it was a static line and
|
|
61
61
|
// the dots did not move — the operator saw a frozen spinner).
|
|
62
|
-
|
|
63
|
-
// `showHint` (default true) controls the trailing "· Esc — стоп". While a
|
|
64
|
-
// tool runs we hide it: its process cannot be cancelled, so promising a stop
|
|
65
|
-
// would be misleading.
|
|
66
|
-
const startAnimated = (baseText, showHint = true) => {
|
|
62
|
+
const startAnimated = (baseText) => {
|
|
67
63
|
animBase = theme.brown(stripEllipsis(baseText));
|
|
68
|
-
|
|
69
|
-
start(animBase + renderDots(0) + hint);
|
|
64
|
+
start(animBase + renderDots(0) + HINT);
|
|
70
65
|
dotPhase = 0;
|
|
71
66
|
if (dotTimer)
|
|
72
67
|
clearInterval(dotTimer);
|
|
@@ -74,7 +69,7 @@ export function createSpinner(locale = 'ru') {
|
|
|
74
69
|
if (!spinner)
|
|
75
70
|
return;
|
|
76
71
|
dotPhase = (dotPhase + 1) % DOTS.length;
|
|
77
|
-
spinner.text = animBase + renderDots(dotPhase) +
|
|
72
|
+
spinner.text = animBase + renderDots(dotPhase) + HINT;
|
|
78
73
|
}, 400);
|
|
79
74
|
animating = true;
|
|
80
75
|
if (dotTimer.unref)
|
|
@@ -158,7 +153,7 @@ export function createSpinner(locale = 'ru') {
|
|
|
158
153
|
// (which is highlighted by the prompt with a golden arrow).
|
|
159
154
|
console.log(NL + theme.assistant(translate(locale)('editor.answer')) + NL);
|
|
160
155
|
console.log(rendered);
|
|
161
|
-
console.log(theme.dim(
|
|
156
|
+
console.log(theme.dim(divider()) + NL);
|
|
162
157
|
},
|
|
163
158
|
warning: (msg) => {
|
|
164
159
|
stop();
|
package/dist/theme.js
CHANGED
|
@@ -29,7 +29,16 @@ export const theme = {
|
|
|
29
29
|
success: chalk.hex('#a9c08c'), // soft sage
|
|
30
30
|
brown: chalk.hex('#a1723f'), // brown (status/spinner)
|
|
31
31
|
toggleOn: chalk.hex('#6fd0b0'), // teal-green — a toggle is ON
|
|
32
|
-
toggleOff: chalk.hex('#4a4f5a'), // dim gray — a toggle is OFF
|
|
33
32
|
bold: chalk.bold,
|
|
34
33
|
};
|
|
34
|
+
// Horizontal rule that separates the model's answer from the next block. It
|
|
35
|
+
// spans the terminal width (capped at `max`) so it does not look stubby on a
|
|
36
|
+
// wide terminal. Falls back to 60 columns when the width is unknown (non-TTY).
|
|
37
|
+
// One column is kept free, like everywhere else in the status/input layout, so
|
|
38
|
+
// a full-width rule cannot trigger autowrap.
|
|
39
|
+
export function divider(max = 100) {
|
|
40
|
+
const cols = process.stdout.columns || 0;
|
|
41
|
+
const width = Math.max(20, Math.min(max, cols ? cols - 1 : 60));
|
|
42
|
+
return '─'.repeat(width);
|
|
43
|
+
}
|
|
35
44
|
export default theme;
|