zames_pro 2.84.0 → 2.86.0
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/README.md +19 -8
- package/dist/index.js +3 -13
- package/dist/theme.js +214 -0
- package/dist/tui/InputLine.js +8 -5
- package/dist/tui/background.js +42 -0
- package/dist/tui/edit.js +40 -5
- package/llms-full.txt +10 -4
- 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.86.0] - 2026-10-27
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **ui:** 10 more palettes, no sample dump after picking, picker smoke
|
|
15
|
+
|
|
16
|
+
## [2.85.0] - 2026-10-27
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- **ui:** theme the window background, keep the unsent draft, drop the extra prompt caret
|
|
21
|
+
|
|
10
22
|
## [2.84.0] - 2026-10-27
|
|
11
23
|
|
|
12
24
|
### Added
|
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ lock-in. Install with `npm install -g zames_pro`, run `zames` in any project
|
|
|
38
38
|
folder, and describe the task in plain language.
|
|
39
39
|
|
|
40
40
|
<p align="center">
|
|
41
|
-
<img src="https://raw.githubusercontent.com/Viqto0r/zames_pro/master/docs/
|
|
41
|
+
<img src="https://raw.githubusercontent.com/Viqto0r/zames_pro/master/docs/shots/theme-zames.png" alt="zames terminal coding agent session — an AI coding agent working in the command line without an API key" width="860">
|
|
42
42
|
</p>
|
|
43
43
|
|
|
44
44
|
## Quick start
|
|
@@ -631,11 +631,17 @@ The switch is instant, no restart. `zames` is the default; the bundled palettes
|
|
|
631
631
|
are ports of well-known editor schemes:
|
|
632
632
|
|
|
633
633
|
`zames` (default), `one-dark`, `dracula`, `gruvbox`, `nord`, `monokai`,
|
|
634
|
-
`solarized-dark`, `tokyo-night`, `catppuccin`, `github-dark`,
|
|
635
|
-
`rose-pine`, `everforest`, `kanagawa
|
|
634
|
+
`solarized-dark`, `tokyo-night`, `tokyo-storm`, `catppuccin`, `github-dark`,
|
|
635
|
+
`ayu`, `rose-pine`, `everforest`, `kanagawa`, `night-owl`, `material`,
|
|
636
|
+
`palenight`, `zenburn`, `selenized`, `iceberg`, `sonokai`, `aurora`, `cobalt2`.
|
|
636
637
|
|
|
637
638
|
A theme repaints EVERYTHING: the interface, the agent's answers, the code
|
|
638
|
-
highlighting inside them, the status row and the input frame.
|
|
639
|
+
highlighting inside them, the status row and the input frame. The terminal's
|
|
640
|
+
BACKGROUND follows too: the theme emits OSC-11 with the palette's `bg`
|
|
641
|
+
(supported by iTerm2, Windows Terminal, kitty, WezTerm, Alacritty, GNOME
|
|
642
|
+
Terminal and others; where it is not supported nothing happens). Opt out with
|
|
643
|
+
`ZAMES_NO_BG=1` or `NO_COLOR`.
|
|
644
|
+
To make the choice
|
|
639
645
|
concrete, a SAMPLE SESSION in that palette is shown before you pick (in `/theme`
|
|
640
646
|
below the list, in `/config` press `p` on the theme row); after
|
|
641
647
|
`/theme <id>` the sample is printed too. The frame itself is a separate
|
|
@@ -761,7 +767,7 @@ Qwen или GLM) в агента для командной строки в ду
|
|
|
761
767
|
можно описать обычным языком.
|
|
762
768
|
|
|
763
769
|
<p align="center">
|
|
764
|
-
<img src="https://raw.githubusercontent.com/Viqto0r/zames_pro/master/docs/
|
|
770
|
+
<img src="https://raw.githubusercontent.com/Viqto0r/zames_pro/master/docs/shots/theme-zames.png" alt="сессия zames в терминале — терминальный coding-агент и AI-ассистент программиста без API-ключа" width="860">
|
|
765
771
|
</p>
|
|
766
772
|
|
|
767
773
|
## Быстрый старт
|
|
@@ -1363,11 +1369,16 @@ enum переключаются на месте; числа и строки от
|
|
|
1363
1369
|
редакторов:
|
|
1364
1370
|
|
|
1365
1371
|
`zames` (по умолчанию), `one-dark`, `dracula`, `gruvbox`, `nord`, `monokai`,
|
|
1366
|
-
`solarized-dark`, `tokyo-night`, `catppuccin`, `github-dark`,
|
|
1367
|
-
`rose-pine`, `everforest`, `kanagawa
|
|
1372
|
+
`solarized-dark`, `tokyo-night`, `tokyo-storm`, `catppuccin`, `github-dark`,
|
|
1373
|
+
`ayu`, `rose-pine`, `everforest`, `kanagawa`, `night-owl`, `material`,
|
|
1374
|
+
`palenight`, `zenburn`, `selenized`, `iceberg`, `sonokai`, `aurora`, `cobalt2`.
|
|
1368
1375
|
|
|
1369
1376
|
Тема перекрашивает ВСЁ: интерфейс, ответы агента, подсветку кода в ответах,
|
|
1370
|
-
строку статуса и рамку ввода.
|
|
1377
|
+
строку статуса и рамку ввода. ФОН окна терминала тоже перекрашивается: тема
|
|
1378
|
+
шлёт OSC-11 с цветом `bg` палитры (поддерживают iTerm2, Windows Terminal,
|
|
1379
|
+
kitty, WezTerm, Alacritty, GNOME Terminal и др.; где не поддерживается — просто
|
|
1380
|
+
ничего не происходит). Отключить фон: `ZAMES_NO_BG=1` или `NO_COLOR`.
|
|
1381
|
+
Чтобы было видно, ЧТО меняется, перед выбором
|
|
1371
1382
|
показывается образец сессии в этой палитре (в `/theme` — под списком, в
|
|
1372
1383
|
`/config` — клавиша `p` на строке темы). После применения `/theme <id>`
|
|
1373
1384
|
образец печатается в терминал. Саму рамку можно менять отдельно:
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,6 @@ import fs from 'fs/promises';
|
|
|
5
5
|
import { readFileSync, statSync } from 'fs';
|
|
6
6
|
import { fileURLToPath } from 'url';
|
|
7
7
|
import { theme, applyTheme, themeColors, themeNames, currentThemeName, isThemeName, } from './theme.js';
|
|
8
|
-
import { themePreviewAnsi } from './tui/theme-preview.js';
|
|
9
8
|
import { setInputBorder } from './tui/ui-colors.js';
|
|
10
9
|
import { DeepSeekBrowser, headlessUACacheReady } from './browser.js';
|
|
11
10
|
import { QwenBrowser } from './qwen-browser.js';
|
|
@@ -1519,8 +1518,9 @@ async function main() {
|
|
|
1519
1518
|
theme.dim(') '));
|
|
1520
1519
|
}
|
|
1521
1520
|
// No working-directory tail: it ate input width and is already in the
|
|
1522
|
-
// header / /pwd. A bare
|
|
1523
|
-
|
|
1521
|
+
// header / /pwd. A bare `❯ ` keeps room for the task text and does not
|
|
1522
|
+
// read as a SECOND prompt marker next to the cursor.
|
|
1523
|
+
return theme.prompt('❯ ');
|
|
1524
1524
|
};
|
|
1525
1525
|
await refreshDynamicCommands(currentWorkdir);
|
|
1526
1526
|
if (process.stdin.isTTY && process.stdout.isTTY) {
|
|
@@ -2250,11 +2250,6 @@ async function main() {
|
|
|
2250
2250
|
return;
|
|
2251
2251
|
}
|
|
2252
2252
|
emit(theme.assistant(t('theme.set', { v: applyThemeById(arg) })));
|
|
2253
|
-
// A terminal can only show colors it can paint, and the operator asked
|
|
2254
|
-
// "what exactly changes?" — print a sample of every role in the new
|
|
2255
|
-
// palette right below the confirmation.
|
|
2256
|
-
emit('');
|
|
2257
|
-
emit(themePreviewAnsi(arg));
|
|
2258
2253
|
return;
|
|
2259
2254
|
}
|
|
2260
2255
|
// No argument: a pick list in the TUI, the id list otherwise. The cursor
|
|
@@ -2284,8 +2279,6 @@ async function main() {
|
|
|
2284
2279
|
}
|
|
2285
2280
|
if (picked) {
|
|
2286
2281
|
emit(theme.assistant(t('theme.set', { v: applyThemeById(picked) })));
|
|
2287
|
-
emit('');
|
|
2288
|
-
emit(themePreviewAnsi(picked));
|
|
2289
2282
|
}
|
|
2290
2283
|
else {
|
|
2291
2284
|
// Cancelled: the previews must not stick. Restore WITHOUT persisting.
|
|
@@ -2446,9 +2439,6 @@ async function main() {
|
|
|
2446
2439
|
theme.dir(reviewMode.snapName) +
|
|
2447
2440
|
theme.dim(') ');
|
|
2448
2441
|
}
|
|
2449
|
-
else {
|
|
2450
|
-
tail = theme.dim('› ');
|
|
2451
|
-
}
|
|
2452
2442
|
input = await promptOnce(theme.prompt('❯ ') + tail);
|
|
2453
2443
|
}
|
|
2454
2444
|
}
|
package/dist/theme.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import { contentWidth } from './width.js';
|
|
3
|
+
import { applyBackground } from './tui/background.js';
|
|
3
4
|
// Respect NO_COLOR (https://no-color.org): when the operator sets it (any
|
|
4
5
|
// non-empty value) drop ALL SGR codes so the output can be piped into a file
|
|
5
6
|
// or a log viewer without escape noise. chalk 5 only auto-detects TTY/CI, it
|
|
@@ -286,6 +287,216 @@ export const PALETTES = {
|
|
|
286
287
|
brown: '#e69875',
|
|
287
288
|
toggleOn: '#83c092',
|
|
288
289
|
},
|
|
290
|
+
// Tokyo Night Storm — the slightly bluer variant of Tokyo Night.
|
|
291
|
+
'tokyo-storm': {
|
|
292
|
+
bg: '#24283b',
|
|
293
|
+
user: '#7dcfff',
|
|
294
|
+
userBar: '#3d7fa6',
|
|
295
|
+
turnRule: '#2f3549',
|
|
296
|
+
turnLabel: '#565f89',
|
|
297
|
+
prompt: '#e0af68',
|
|
298
|
+
dir: '#7dcfff',
|
|
299
|
+
assistant: '#c0caf5',
|
|
300
|
+
tool: '#ff9e64',
|
|
301
|
+
toolResult: '#9aa5ce',
|
|
302
|
+
system: '#7d84a8',
|
|
303
|
+
dim: '#565f89',
|
|
304
|
+
taskSummary: '#7aa2f7',
|
|
305
|
+
warn: '#e0af68',
|
|
306
|
+
error: '#f7768e',
|
|
307
|
+
success: '#9ece6a',
|
|
308
|
+
brown: '#ff9e64',
|
|
309
|
+
toggleOn: '#73daca',
|
|
310
|
+
},
|
|
311
|
+
// Night Owl — Sarah Drasner's dark blue scheme from VS Code.
|
|
312
|
+
'night-owl': {
|
|
313
|
+
bg: '#011627',
|
|
314
|
+
user: '#82aaff',
|
|
315
|
+
userBar: '#4b6a9b',
|
|
316
|
+
turnRule: '#122d42',
|
|
317
|
+
turnLabel: '#637777',
|
|
318
|
+
prompt: '#ecc48d',
|
|
319
|
+
dir: '#7fdbca',
|
|
320
|
+
assistant: '#d6deeb',
|
|
321
|
+
tool: '#f78c6c',
|
|
322
|
+
toolResult: '#8badc1',
|
|
323
|
+
system: '#7d8fa9',
|
|
324
|
+
dim: '#637777',
|
|
325
|
+
taskSummary: '#c792ea',
|
|
326
|
+
warn: '#ecc48d',
|
|
327
|
+
error: '#ef5350',
|
|
328
|
+
success: '#addb67',
|
|
329
|
+
brown: '#f78c6c',
|
|
330
|
+
toggleOn: '#21c7a8',
|
|
331
|
+
},
|
|
332
|
+
// Material — the Material Theme Ocean (dark) palette.
|
|
333
|
+
material: {
|
|
334
|
+
bg: '#0f111a',
|
|
335
|
+
user: '#82aaff',
|
|
336
|
+
userBar: '#46608f',
|
|
337
|
+
turnRule: '#1a1f35',
|
|
338
|
+
turnLabel: '#4b526d',
|
|
339
|
+
prompt: '#ffcb6b',
|
|
340
|
+
dir: '#89ddff',
|
|
341
|
+
assistant: '#a6accd',
|
|
342
|
+
tool: '#f78c6c',
|
|
343
|
+
toolResult: '#8b93b5',
|
|
344
|
+
system: '#717cb4',
|
|
345
|
+
dim: '#4b526d',
|
|
346
|
+
taskSummary: '#c792ea',
|
|
347
|
+
warn: '#ffcb6b',
|
|
348
|
+
error: '#ff5370',
|
|
349
|
+
success: '#c3e88d',
|
|
350
|
+
brown: '#f78c6c',
|
|
351
|
+
toggleOn: '#89ddff',
|
|
352
|
+
},
|
|
353
|
+
// Palenight — Material's softer indigo variant.
|
|
354
|
+
palenight: {
|
|
355
|
+
bg: '#292d3e',
|
|
356
|
+
user: '#82aaff',
|
|
357
|
+
userBar: '#4b5f8f',
|
|
358
|
+
turnRule: '#353a52',
|
|
359
|
+
turnLabel: '#676e95',
|
|
360
|
+
prompt: '#ffcb6b',
|
|
361
|
+
dir: '#89ddff',
|
|
362
|
+
assistant: '#a6accd',
|
|
363
|
+
tool: '#f78c6c',
|
|
364
|
+
toolResult: '#8f97bd',
|
|
365
|
+
system: '#7e87b3',
|
|
366
|
+
dim: '#676e95',
|
|
367
|
+
taskSummary: '#c792ea',
|
|
368
|
+
warn: '#ffcb6b',
|
|
369
|
+
error: '#ff5370',
|
|
370
|
+
success: '#c3e88d',
|
|
371
|
+
brown: '#f78c6c',
|
|
372
|
+
toggleOn: '#89ddff',
|
|
373
|
+
},
|
|
374
|
+
// Zenburn — the low-contrast classic from Vim.
|
|
375
|
+
zenburn: {
|
|
376
|
+
bg: '#3f3f3f',
|
|
377
|
+
user: '#8cd0d3',
|
|
378
|
+
userBar: '#5d8d8f',
|
|
379
|
+
turnRule: '#4a4a4a',
|
|
380
|
+
turnLabel: '#7f9f7f',
|
|
381
|
+
prompt: '#e3ceab',
|
|
382
|
+
dir: '#8cd0d3',
|
|
383
|
+
assistant: '#dcdccc',
|
|
384
|
+
tool: '#dfaf8f',
|
|
385
|
+
toolResult: '#a8a8a0',
|
|
386
|
+
system: '#909090',
|
|
387
|
+
dim: '#7f9f7f',
|
|
388
|
+
taskSummary: '#93e0e3',
|
|
389
|
+
warn: '#e3ceab',
|
|
390
|
+
error: '#cc9393',
|
|
391
|
+
success: '#7f9f7f',
|
|
392
|
+
brown: '#dfaf8f',
|
|
393
|
+
toggleOn: '#93e0e3',
|
|
394
|
+
},
|
|
395
|
+
// Selenized Dark — a modern, contrast-checked Solarized rework.
|
|
396
|
+
selenized: {
|
|
397
|
+
bg: '#103c48',
|
|
398
|
+
user: '#4695f7',
|
|
399
|
+
userBar: '#2e6aa8',
|
|
400
|
+
turnRule: '#184956',
|
|
401
|
+
turnLabel: '#72898f',
|
|
402
|
+
prompt: '#dbb32d',
|
|
403
|
+
dir: '#41c7b9',
|
|
404
|
+
assistant: '#adbcbc',
|
|
405
|
+
tool: '#ed8649',
|
|
406
|
+
toolResult: '#8a9ea3',
|
|
407
|
+
system: '#8a9ea3',
|
|
408
|
+
dim: '#72898f',
|
|
409
|
+
taskSummary: '#41c7b9',
|
|
410
|
+
warn: '#dbb32d',
|
|
411
|
+
error: '#fa5750',
|
|
412
|
+
success: '#75b938',
|
|
413
|
+
brown: '#ed8649',
|
|
414
|
+
toggleOn: '#41c7b9',
|
|
415
|
+
},
|
|
416
|
+
// Iceberg — a calm blue "ice" scheme for Neovim/VS Code.
|
|
417
|
+
iceberg: {
|
|
418
|
+
bg: '#161821',
|
|
419
|
+
user: '#84a0c6',
|
|
420
|
+
userBar: '#4f6a8f',
|
|
421
|
+
turnRule: '#1e2132',
|
|
422
|
+
turnLabel: '#6b7089',
|
|
423
|
+
prompt: '#e2a478',
|
|
424
|
+
dir: '#89b8c2',
|
|
425
|
+
assistant: '#c6c8d1',
|
|
426
|
+
tool: '#e2a478',
|
|
427
|
+
toolResult: '#9aa3bd',
|
|
428
|
+
system: '#8389a3',
|
|
429
|
+
dim: '#6b7089',
|
|
430
|
+
taskSummary: '#a093c7',
|
|
431
|
+
warn: '#e2a478',
|
|
432
|
+
error: '#e27878',
|
|
433
|
+
success: '#b4be82',
|
|
434
|
+
brown: '#e2a478',
|
|
435
|
+
toggleOn: '#89b8c2',
|
|
436
|
+
},
|
|
437
|
+
// Sonokai — a vivid, modern take on Monokai.
|
|
438
|
+
sonokai: {
|
|
439
|
+
bg: '#2c2e34',
|
|
440
|
+
user: '#76cce0',
|
|
441
|
+
userBar: '#42808f',
|
|
442
|
+
turnRule: '#3b3e48',
|
|
443
|
+
turnLabel: '#7f8490',
|
|
444
|
+
prompt: '#e7c664',
|
|
445
|
+
dir: '#76cce0',
|
|
446
|
+
assistant: '#e2e2e3',
|
|
447
|
+
tool: '#f39660',
|
|
448
|
+
toolResult: '#a6a7ad',
|
|
449
|
+
system: '#9da0a7',
|
|
450
|
+
dim: '#7f8490',
|
|
451
|
+
taskSummary: '#9ed072',
|
|
452
|
+
warn: '#e7c664',
|
|
453
|
+
error: '#fc5d7c',
|
|
454
|
+
success: '#9ed072',
|
|
455
|
+
brown: '#f39660',
|
|
456
|
+
toggleOn: '#76cce0',
|
|
457
|
+
},
|
|
458
|
+
// Aurora — a northern-lights violet scheme.
|
|
459
|
+
aurora: {
|
|
460
|
+
bg: '#191c27',
|
|
461
|
+
user: '#88c0d0',
|
|
462
|
+
userBar: '#4b7180',
|
|
463
|
+
turnRule: '#242836',
|
|
464
|
+
turnLabel: '#6a6f8c',
|
|
465
|
+
prompt: '#ebcb8b',
|
|
466
|
+
dir: '#88c0d0',
|
|
467
|
+
assistant: '#d8dee9',
|
|
468
|
+
tool: '#d08770',
|
|
469
|
+
toolResult: '#9aa3b8',
|
|
470
|
+
system: '#8891a8',
|
|
471
|
+
dim: '#6a6f8c',
|
|
472
|
+
taskSummary: '#b48ead',
|
|
473
|
+
warn: '#ebcb8b',
|
|
474
|
+
error: '#bf616a',
|
|
475
|
+
success: '#a3be8c',
|
|
476
|
+
brown: '#d08770',
|
|
477
|
+
toggleOn: '#8fbcbb',
|
|
478
|
+
},
|
|
479
|
+
// Cobalt2 — Wes Bos's saturated blue VS Code theme.
|
|
480
|
+
cobalt2: {
|
|
481
|
+
bg: '#193549',
|
|
482
|
+
user: '#9effff',
|
|
483
|
+
userBar: '#4d8f9e',
|
|
484
|
+
turnRule: '#1f4662',
|
|
485
|
+
turnLabel: '#7a8f9e',
|
|
486
|
+
prompt: '#ffc600',
|
|
487
|
+
dir: '#9effff',
|
|
488
|
+
assistant: '#e1efff',
|
|
489
|
+
tool: '#ff9d00',
|
|
490
|
+
toolResult: '#a6b8c8',
|
|
491
|
+
system: '#8ba0b3',
|
|
492
|
+
dim: '#7a8f9e',
|
|
493
|
+
taskSummary: '#0088ff',
|
|
494
|
+
warn: '#ffc600',
|
|
495
|
+
error: '#ff628c',
|
|
496
|
+
success: '#3ad900',
|
|
497
|
+
brown: '#ff9d00',
|
|
498
|
+
toggleOn: '#80ffbb',
|
|
499
|
+
},
|
|
289
500
|
// Kanagawa — Hokusai-inspired muted indigo (the "wave" theme).
|
|
290
501
|
kanagawa: {
|
|
291
502
|
bg: '#1f1f28',
|
|
@@ -367,6 +578,9 @@ export function applyTheme(name) {
|
|
|
367
578
|
theme[key] = built[key];
|
|
368
579
|
}
|
|
369
580
|
activeName = next;
|
|
581
|
+
// The window background is part of the look: paint it (best effort) so a
|
|
582
|
+
// dark palette does not sit on a light terminal background.
|
|
583
|
+
applyBackground(next);
|
|
370
584
|
return next;
|
|
371
585
|
}
|
|
372
586
|
/**
|
package/dist/tui/InputLine.js
CHANGED
|
@@ -12,7 +12,7 @@ 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
14
|
import { expandPastes, inputInnerCols, layoutInput, SUGGEST_PAGE, } from '../input/layout.js';
|
|
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';
|
|
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, rememberDraft, } from './edit.js';
|
|
16
16
|
import { dispatchKey, parseCsiU } from './keys.js';
|
|
17
17
|
import { useSyncExternalStore } from 'react';
|
|
18
18
|
import { matchSlashCommands, suggestWindow, completeSlashCommand, } from '../input/suggest.js';
|
|
@@ -125,17 +125,20 @@ export function InputLine(props) {
|
|
|
125
125
|
case 'submit':
|
|
126
126
|
doSubmit();
|
|
127
127
|
return;
|
|
128
|
+
// The EDIT actions first write the line into the draft slot, so a
|
|
129
|
+
// remembered draft is replaced only by a REAL edit and an accidental
|
|
130
|
+
// Up cannot lose the typed message.
|
|
128
131
|
case 'newline':
|
|
129
|
-
apply(insertNewline);
|
|
132
|
+
apply((s) => pushUndo(rememberDraft(insertNewline(s)), true));
|
|
130
133
|
return;
|
|
131
134
|
case 'insert':
|
|
132
|
-
apply((s) => pushUndo(insertText(s, action.text), true));
|
|
135
|
+
apply((s) => pushUndo(rememberDraft(insertText(s, action.text)), true));
|
|
133
136
|
return;
|
|
134
137
|
case 'backspace':
|
|
135
|
-
apply((s) => backspace(pushUndo(s, true)));
|
|
138
|
+
apply((s) => backspace(pushUndo(rememberDraft(s), true)));
|
|
136
139
|
return;
|
|
137
140
|
case 'delete':
|
|
138
|
-
apply((s) => del(pushUndo(s, true)));
|
|
141
|
+
apply((s) => del(pushUndo(rememberDraft(s), true)));
|
|
139
142
|
return;
|
|
140
143
|
case 'left':
|
|
141
144
|
apply(moveLeft);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Terminal BACKGROUND handling.
|
|
2
|
+
//
|
|
3
|
+
// A terminal cannot be told to paint "the background" — only the cells an app
|
|
4
|
+
// writes are styled. So a theme's `bg` reaches the screen by
|
|
5
|
+
// 1. emitting an OSC-11 background colour for the whole window (most modern
|
|
6
|
+
// terminals support it; a terminal that does not answers nothing), and
|
|
7
|
+
// 2. re-emitting it AFTER a full-screen app exits: the alternate screen keeps
|
|
8
|
+
// the window's background, and Ink's exit sequence resets attributes
|
|
9
|
+
// (SGR reset does not touch OSC-11, but some terminals do reset the colour
|
|
10
|
+
// on 1049l). Re-emitting is harmless where unsupported.
|
|
11
|
+
//
|
|
12
|
+
// The OSC sequence is written STRAIGHT to stdout (not through chalk), because
|
|
13
|
+
// it is not an SGR attribute: `\x1b]11;rgb:rr/gg/bb\x07`.
|
|
14
|
+
import { PALETTES, isThemeName, DEFAULT_THEME } from '../theme.js';
|
|
15
|
+
/** `#rrggbb` -> the `rr/gg/bb` part of an OSC-11 payload. */
|
|
16
|
+
function hexToOsc(hex) {
|
|
17
|
+
const h = hex.replace('#', '');
|
|
18
|
+
return `${h.slice(0, 2)}/${h.slice(2, 4)}/${h.slice(4, 6)}`;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The OSC-11 sequence that sets the window background, or '' when the operator
|
|
22
|
+
* opted out (NO_COLOR / ZAMES_NO_BG). Exported pure, so the encoding is
|
|
23
|
+
* testable without a terminal.
|
|
24
|
+
*/
|
|
25
|
+
export function backgroundOsc(name) {
|
|
26
|
+
if (process.env.NO_COLOR || process.env.ZAMES_NO_BG)
|
|
27
|
+
return '';
|
|
28
|
+
const id = isThemeName(name) ? name : DEFAULT_THEME;
|
|
29
|
+
return '\x1b]11;rgb:' + hexToOsc(PALETTES[id].bg) + '\x07';
|
|
30
|
+
}
|
|
31
|
+
/** Paint the window background for the palette `name` (best effort). */
|
|
32
|
+
export function applyBackground(name) {
|
|
33
|
+
const seq = backgroundOsc(name);
|
|
34
|
+
if (!seq)
|
|
35
|
+
return;
|
|
36
|
+
try {
|
|
37
|
+
process.stdout.write(seq);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
// A closed/redirected stdout must not break a theme switch.
|
|
41
|
+
}
|
|
42
|
+
}
|
package/dist/tui/edit.js
CHANGED
|
@@ -249,9 +249,11 @@ export function historyUp(s) {
|
|
|
249
249
|
if (!s.history.length)
|
|
250
250
|
return s;
|
|
251
251
|
let histIndex = s.histIndex;
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
252
|
+
// Snapshot the unsent line when the browse STARTS (histIndex is at the end),
|
|
253
|
+
// but NEVER replace the remembered draft with a RECALLED entry's text: a
|
|
254
|
+
// second Up after a Down used to overwrite it, and the operator's typed
|
|
255
|
+
// message was lost ("pressed Up by accident").
|
|
256
|
+
const histDraft = histIndex === s.history.length ? s.buf : s.histDraft;
|
|
255
257
|
if (histIndex > 0) {
|
|
256
258
|
histIndex--;
|
|
257
259
|
const buf = s.history[histIndex];
|
|
@@ -269,6 +271,10 @@ export function historyDown(s) {
|
|
|
269
271
|
if (!s.history.length)
|
|
270
272
|
return s;
|
|
271
273
|
let histIndex = s.histIndex;
|
|
274
|
+
// The CURRENT line is the operator's, not a history entry: leaving the
|
|
275
|
+
// history must bring it back. Without this, editing a recalled line and then
|
|
276
|
+
// pressing Down restored the OLD draft and dropped the edit.
|
|
277
|
+
const draft = browsingHistory(s) ? s.histDraft : s.buf;
|
|
272
278
|
let buf;
|
|
273
279
|
if (histIndex < s.history.length - 1) {
|
|
274
280
|
histIndex++;
|
|
@@ -276,9 +282,38 @@ export function historyDown(s) {
|
|
|
276
282
|
}
|
|
277
283
|
else {
|
|
278
284
|
histIndex = s.history.length;
|
|
279
|
-
buf =
|
|
285
|
+
buf = draft;
|
|
280
286
|
}
|
|
281
|
-
return {
|
|
287
|
+
return {
|
|
288
|
+
...s,
|
|
289
|
+
histIndex,
|
|
290
|
+
histDraft: draft,
|
|
291
|
+
buf,
|
|
292
|
+
cursor: Array.from(buf).length,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
// ---------- draft guard ----------
|
|
296
|
+
//
|
|
297
|
+
// The operator's UNSUBMITTED line must survive a history browse, arrow-key
|
|
298
|
+
// scrolling and every other non-typing transition. `histDraft` alone did not:
|
|
299
|
+
// it is snapshotted only when the browse STARTS (histIndex === history.length),
|
|
300
|
+
// so once the cursor was inside the history an edit or a second Up path could
|
|
301
|
+
// replace it — a real report was "I pressed Up by accident and my typed message
|
|
302
|
+
// was gone".
|
|
303
|
+
//
|
|
304
|
+
// The rule: typing/recalling may change the visible buffer, but a transition
|
|
305
|
+
// that is NOT an explicit edit must keep the draft; leaving the history restores
|
|
306
|
+
// it. `typingRun` is true while the operator types (so a real edit adopts the new
|
|
307
|
+
// text as the draft on the next browse).
|
|
308
|
+
/** True while the buffer is a RECALLED history entry (not the draft). */
|
|
309
|
+
export function browsingHistory(s) {
|
|
310
|
+
return s.history.length > 0 && s.histIndex < s.history.length;
|
|
311
|
+
}
|
|
312
|
+
/** Remember the current buffer as the draft when it is NOT a history entry. */
|
|
313
|
+
export function rememberDraft(s) {
|
|
314
|
+
if (s.buf === s.histDraft)
|
|
315
|
+
return s;
|
|
316
|
+
return { ...s, histDraft: s.buf };
|
|
282
317
|
}
|
|
283
318
|
export function searchStart(s) {
|
|
284
319
|
if (!s.history.length)
|
package/llms-full.txt
CHANGED
|
@@ -23,7 +23,7 @@ lock-in. Install with `npm install -g zames_pro`, run `zames` in any project
|
|
|
23
23
|
folder, and describe the task in plain language.
|
|
24
24
|
|
|
25
25
|
<p align="center">
|
|
26
|
-
<img src="https://raw.githubusercontent.com/Viqto0r/zames_pro/master/docs/
|
|
26
|
+
<img src="https://raw.githubusercontent.com/Viqto0r/zames_pro/master/docs/shots/theme-zames.png" alt="zames terminal coding agent session — an AI coding agent working in the command line without an API key" width="860">
|
|
27
27
|
</p>
|
|
28
28
|
|
|
29
29
|
## Quick start
|
|
@@ -616,11 +616,17 @@ The switch is instant, no restart. `zames` is the default; the bundled palettes
|
|
|
616
616
|
are ports of well-known editor schemes:
|
|
617
617
|
|
|
618
618
|
`zames` (default), `one-dark`, `dracula`, `gruvbox`, `nord`, `monokai`,
|
|
619
|
-
`solarized-dark`, `tokyo-night`, `catppuccin`, `github-dark`,
|
|
620
|
-
`rose-pine`, `everforest`, `kanagawa
|
|
619
|
+
`solarized-dark`, `tokyo-night`, `tokyo-storm`, `catppuccin`, `github-dark`,
|
|
620
|
+
`ayu`, `rose-pine`, `everforest`, `kanagawa`, `night-owl`, `material`,
|
|
621
|
+
`palenight`, `zenburn`, `selenized`, `iceberg`, `sonokai`, `aurora`, `cobalt2`.
|
|
621
622
|
|
|
622
623
|
A theme repaints EVERYTHING: the interface, the agent's answers, the code
|
|
623
|
-
highlighting inside them, the status row and the input frame.
|
|
624
|
+
highlighting inside them, the status row and the input frame. The terminal's
|
|
625
|
+
BACKGROUND follows too: the theme emits OSC-11 with the palette's `bg`
|
|
626
|
+
(supported by iTerm2, Windows Terminal, kitty, WezTerm, Alacritty, GNOME
|
|
627
|
+
Terminal and others; where it is not supported nothing happens). Opt out with
|
|
628
|
+
`ZAMES_NO_BG=1` or `NO_COLOR`.
|
|
629
|
+
To make the choice
|
|
624
630
|
concrete, a SAMPLE SESSION in that palette is shown before you pick (in `/theme`
|
|
625
631
|
below the list, in `/config` press `p` on the theme row); after
|
|
626
632
|
`/theme <id>` the sample is printed too. The frame itself is a separate
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zames_pro",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.86.0",
|
|
4
4
|
"description": "Terminal coding agent that drives a real browser to chat with DeepSeek, Qwen or GLM — 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": {
|