zames_pro 2.66.0 → 2.66.1

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 CHANGED
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.66.1] - 2026-10-07
11
+
12
+ ### Changed
13
+
14
+ - README: русский перевод теперь свёрнут в `<details>` прямо в `README.md`,
15
+ поэтому его можно читать на странице npm, не уходя на GitHub. npm рендерит
16
+ readme тем же GitHub Flavored Markdown, что и GitHub, а отдельный
17
+ `README.ru.md` на npm-странице не виден (у npm один readme на пакет).
18
+ Обе языковые версии собираются из `docs/readme.{en,ru}.md` скриптом
19
+ `npm run build:readme`; `test/readme-built.test.ts` следит за рассинхроном.
20
+
10
21
  ## [2.66.0] - 2026-10-07
11
22
 
12
23
  ### Added
package/README.md CHANGED
@@ -485,3 +485,487 @@ first-party API client.
485
485
  ## License
486
486
 
487
487
  MIT
488
+
489
+ <details>
490
+ <summary>🇷🇺 Читать по-русски (Russian)</summary>
491
+
492
+ Терминальный coding-агент, работающий поверх [chat.deepseek.com](https://chat.deepseek.com/) через Playwright.
493
+ По духу он похож на Claude Code / Codex CLI: запускается в текущей
494
+ директории, читает и правит файлы, выполняет команды и коммитит в git.
495
+
496
+ > API-ключ не нужен — агент управляет веб-чатом DeepSeek как обычный
497
+ > пользователь через настоящий (headless) браузер.
498
+
499
+ <p align="center">
500
+ <img src="https://raw.githubusercontent.com/Viqto0r/zames_pro/master/docs/demo.png" alt="сессия zames в терминале" width="860">
501
+ </p>
502
+
503
+ ## Быстрый старт
504
+
505
+ ```bash
506
+ npm install -g zames_pro # Chromium для Playwright скачается автоматически
507
+ cd your-project # любая папка, в которой должен работать агент
508
+ zames # один раз войти, дальше просто описывайте задачу
509
+ ```
510
+
511
+ Здесь **нет API-ключа и нет оплаты за токены**: zames входит в **ваш
512
+ собственный аккаунт [chat.deepseek.com](https://chat.deepseek.com/)** в
513
+ настоящем (headless) Chromium и управляет веб-чатом как обычный пользователь.
514
+ При первом запуске он один раз спросит логин DeepSeek (сессия сохраняется в
515
+ `~/.zames/profile`); после этого достаточно запустить `zames` и написать
516
+ задачу обычным языком:
517
+
518
+ ```text
519
+ ❯ отрефактори загрузчик конфига и добавь тест на новый дефолт
520
+ ```
521
+
522
+ Пока агент работает, можно продолжать печатать — сообщение, отправленное
523
+ посреди задачи, встанет в очередь и уйдёт сразу после неё, в тот же чат.
524
+ `Esc` прерывает текущую генерацию, `/help` показывает команды, `/exit` — выход.
525
+
526
+ ## Как это работает
527
+
528
+ zames не вызывает API модели. Он запускает headless Chromium с постоянным
529
+ профилем, входит в `chat.deepseek.com` как человек, печатает задачу в поле
530
+ чата и читает ответ обратно.
531
+
532
+ <p align="center">
533
+ <img src="https://raw.githubusercontent.com/Viqto0r/zames_pro/master/docs/how-it-works.png" alt="как работает zames" width="860">
534
+ </p>
535
+
536
+ Словами: вы вводите задачу → zames отправляет системный промпт и задачу в
537
+ веб-чат DeepSeek → модель отвечает → zames разбирает вызов инструмента,
538
+ выполняет его локально, возвращает результат обратно и печатает финальный
539
+ ответ.
540
+
541
+ Ключевые детали:
542
+
543
+ - **Ответ читается из сырого сетевого потока** (SSE), а не из отрендеренного
544
+ DOM, поэтому JSON вызова инструмента с шаблонными строками и экранированием
545
+ остаётся целым.
546
+ - **Постоянный профиль** (`~/.zames/profile`) держит вас залогиненным;
547
+ User-Agent headless-браузера подменяется, чтобы CDN DeepSeek не отдавал 403
548
+ на вход.
549
+ - **Троттлинг отправки** (15 с по умолчанию) щадит рейт-лимит веб-чата во
550
+ время долгих прогонов с инструментами.
551
+ - **Агент запесочен** в директорию запуска — ни один инструмент не может
552
+ читать или писать выше неё.
553
+
554
+ ## Содержание
555
+
556
+ - [Быстрый старт](#быстрый-старт) · [Возможности](#возможности) · [Почему zames?](#почему-zames) · [Требования](#требования)
557
+ - [Как это работает](#как-это-работает) · [Установка](#установка) · [Вход в аккаунт](#вход-в-аккаунт) · [Использование](#использование)
558
+ - [Инструменты](#инструменты) · [Слэш-команды](#слэш-команды)
559
+ - [Контекст проекта, навыки и память](#контекст-проекта-навыки-и-память) · [MCP (внешние инструменты)](#mcp-внешние-инструменты) · [Конфигурация](#конфигурация)
560
+ - [FAQ](#faq) · [Ссылки](#ссылки) · [Лицензия](#лицензия)
561
+
562
+ ## Возможности
563
+
564
+ - **Инструменты как в Claude Code / Codex** — `Read`, `Write`, `Edit`, `Bash`,
565
+ `Glob`, `Grep`, плюс `MultiEdit`, `ApplyPatch`, `LS`, `TodoWrite`, git- и
566
+ веб-инструменты. Каждая правка подкреплена `/undo`.
567
+ - **Работает, пока вы печатаете** — сообщения, набранные во время задачи,
568
+ встают в очередь и уходят сразу после неё, в тот же чат (как набор текста
569
+ во время генерации на сайте).
570
+ - **Режим плана** — `/plan` (или `--plan`) убирает все мутирующие инструменты,
571
+ чтобы агент изучал код, не трогая дерево.
572
+ - **Контекст проекта** — читает `AGENTS.md`, `MEMORY.md`, навыки (`SKILL.md`) и
573
+ пользовательские команды из репозитория и `~/.zames`, как в Codex / Claude
574
+ Code.
575
+ - **Поддержка MCP** — подключение внешних серверов инструментов (например,
576
+ `@playwright/mcp`).
577
+ - **Планировщик** — `/loop`, `/cron` и `/jobs` повторяют задачи по таймеру.
578
+ - **Двуязычный интерфейс** — русский / английский (`/config lang`).
579
+
580
+ ## Почему zames?
581
+
582
+ - **Нет API-ключа и счёта за токены** — используется ваш собственный аккаунт
583
+ чата DeepSeek, а не платный API. Удобно для долгих задач с инструментами.
584
+ - **Тот же рабочий процесс, что в Claude Code / Codex** — инструменты,
585
+ `AGENTS.md`, навыки, MCP и слэш-команды, так что всё знакомо с первого дня.
586
+ - **Работает без присмотра** — headless по умолчанию, возобновляемые сессии,
587
+ `/loop` и `/cron` для задач по расписанию.
588
+ - **Local-first** — профиль браузера, учётные данные и логи не покидают вашу
589
+ машину, а агент запесочен в директорию проекта.
590
+
591
+ ## Требования
592
+
593
+ - Node.js >= 20
594
+ - Аккаунт DeepSeek. При первом запуске zames спросит логин/пароль DeepSeek в
595
+ терминале (и сохранит их в `~/.zames/config.json` после успешного входа,
596
+ поэтому более поздний разлогин обрабатывается автоматически, без повторных
597
+ вопросов). Можно также войти вручную в окне браузера, когда он headed.
598
+
599
+ ## Вход в аккаунт
600
+
601
+ Браузер по умолчанию работает **headless**. Когда DeepSeek требует входа,
602
+ zames:
603
+
604
+ 1. переиспользует сессию из постоянного профиля (`~/.zames/profile`), если она
605
+ ещё валидна;
606
+ 2. иначе входит автоматически по сохранённым учётным данным
607
+ (`browser.auth.username` / `browser.auth.password`);
608
+ 3. иначе спрашивает логин/пароль в терминале (в TTY) и после успешного входа
609
+ запоминает их для следующего раза;
610
+ 4. иначе показывает подсказку про ручной вход.
611
+
612
+ Чтобы войти руками (например, если DeepSeek показывает капчу), запустите с
613
+ видимым окном:
614
+
615
+ ```bash
616
+ zames --headed
617
+ ```
618
+
619
+ Флаг `--headless` (значение по умолчанию) и `headless: true` в конфиге держат
620
+ браузер без окна; `--headed` / `headless: false` показывают его.
621
+
622
+ Headless работает из коробки: headless Chrome обычно представляется как
623
+ `HeadlessChrome/...`, и CDN DeepSeek блокирует такой User-Agent ответом 403,
624
+ поэтому zames срезает этот маркер перед загрузкой страницы (сохраняя реальную
625
+ версию движка). `--headed` нужен не только ради входа.
626
+
627
+ Учётные данные и переключатели можно также править из `/config`
628
+ (`browser.auth.username`, `browser.auth.password`, `browser.auth.saveSession`).
629
+
630
+ ## Установка
631
+
632
+ ```bash
633
+ npm install -g zames_pro
634
+ ```
635
+
636
+ Chromium для Playwright скачивается автоматически при установке. На Linux/WSL
637
+ необходимые системные библиотеки тоже ставятся, если доступен `sudo` без
638
+ пароля; иначе выполните один раз вручную:
639
+
640
+ ```bash
641
+ npx playwright install chromium
642
+ sudo npx playwright install-deps chromium
643
+ ```
644
+
645
+ ## Использование
646
+
647
+ Перейдите в папку проекта и запустите:
648
+
649
+ ```bash
650
+ zames
651
+ ```
652
+
653
+ Агент работает внутри директории, из которой он запущен, и не может её покинуть (песочница).
654
+
655
+ Пока агент работает, можно продолжать печатать: Enter ставит сообщение в
656
+ очередь (оно уйдёт сразу после текущей задачи, в тот же чат), а Esc / Ctrl+C
657
+ прерывают текущую генерацию. Это повторяет набор текста во время генерации на
658
+ сайте DeepSeek.
659
+
660
+ ### Строка ввода
661
+
662
+ Промпт — это небольшой редактор строки с постоянной историей:
663
+
664
+ - `↑` / `↓` — переход по истории сообщений (сохраняется в
665
+ `~/.zames/history.json`, поэтому переживает перезапуск); внутри
666
+ многострочного сообщения стрелки двигают по строкам.
667
+ - `Ctrl+R` — инкрементальный поиск по истории в обратном порядке (как в bash):
668
+ печатайте для фильтра, `Ctrl+R` — за более старыми совпадениями, `Enter` —
669
+ принять, `Esc` — отменить.
670
+ - `Ctrl+_` — отменить последнюю правку строки ввода (случайно нажатые
671
+ `Ctrl+U` / `Ctrl+K` можно вернуть).
672
+ - `Ctrl+U` — очистить строку, `Ctrl+K` — удалить до конца строки, `Ctrl+W` —
673
+ удалить слово перед курсором, `Ctrl+←`/`Ctrl+→` — переход по словам.
674
+ - `\` + `Enter`, `Ctrl+J`, `Ctrl+Enter` или `Shift+Enter` — вставить новую
675
+ строку.
676
+ - `/` + `Tab` — подсказки и автодополнение слэш-команд.
677
+ - `!команда` — выполнить shell-команду напрямую, минуя модель (как bash-режим
678
+ Claude Code). Действует та же песочница, что и для инструмента `Bash`, так
679
+ что прямая команда тоже не может выйти за пределы проекта.
680
+
681
+ Установите `NO_COLOR=1`, чтобы отключить цвета (иначе используется спокойная
682
+ палитра по умолчанию).
683
+
684
+ ### Картинки и файлы
685
+
686
+ В строку ввода можно вставить картинку или файл (Ctrl+Shift+V / Shift+Insert
687
+ или собственной вставкой терминала). zames сохраняет его в `<project>/tmp` и
688
+ показывает маркер в строке — `[image#1]` для картинок, `[file#1]` для прочих
689
+ файлов — затем загружает реальный файл в чат вместе с вашим сообщением. Это те
690
+ же форматы, что принимает веб-чат DeepSeek (PNG, JPEG, GIF, WEBP, BMP, SVG и
691
+ обычные типы документов).
692
+
693
+ Вставка картинки работает, когда терминал передаёт её как `data:` URL или как
694
+ base64-блок с узнаваемой сигнатурой изображения. Можно также вставить путь к
695
+ локальному файлу (перетащите файл в терминал или скопируйте его путь); если
696
+ файл существует — он прикрепляется, иначе текст вставляется как обычно.
697
+
698
+ Нажмите Ctrl+V (или сделайте пустую вставку), и zames прочитает картинку прямо
699
+ из буфера обмена: Linux через wl-paste (Wayland) или xclip/xsel (X11), macOS
700
+ через pngpaste, Windows через PowerShell. Нужные Linux-утилиты ставятся
701
+ автоматически при `npm install` (best-effort, через определённый пакетный
702
+ менеджер). Если картинка не найдена, zames сообщит об этом и напишет, какой
703
+ инструмент пробовал, вместо молчания.
704
+
705
+ ### Опции
706
+
707
+ ```
708
+ zames --task <текст задачи>
709
+ zames --chat <id>
710
+ zames --new-chat
711
+ zames --resend-prompt
712
+ zames --dir <path>
713
+ zames --headless
714
+ zames --headed
715
+ zames --plan
716
+ zames --output-format jsonl
717
+ zames --debug
718
+ zames --version
719
+ zames --help
720
+ ```
721
+
722
+ ### Машиночитаемый вывод (скрипты / CI)
723
+
724
+ Для одноразовых запусков (`--task`) агент может выдавать поток событий как JSON
725
+ lines в stdout, оставляя весь человеческий текст в stderr:
726
+
727
+ ```bash
728
+ zames --task "summarize the diff" --output-format jsonl
729
+ ```
730
+
731
+ Каждая строка — одно событие (`tool_call`, `tool_result`, `assistant_final`, …),
732
+ так что это сразу пайпится в `jq`:
733
+
734
+ ```bash
735
+ zames --task "..." --output-format jsonl \
736
+ | jq -r 'select(.type=="assistant_final") | .message'
737
+ ```
738
+
739
+ ## Инструменты
740
+
741
+ У агента тот же стиль инструментов, что в Claude Code / Codex CLI:
742
+
743
+ - **Файловые** — `Read`, `Write`, `Edit`, `Bash`, `Glob`, `Grep`. `Read` по
744
+ умолчанию отдаёт сырое содержимое; передайте `numbered=true`, чтобы получить
745
+ нумерацию строк в стиле `cat -n` (только для справки — не вставляйте её в
746
+ `Edit`).
747
+ - **Дополнительные** — `LS` (список директории), `MultiEdit` (несколько правок
748
+ одного файла атомарно), `TodoWrite` (чек-лист задач сессии), `ApplyPatch`
749
+ (мультифайловый патч в формате V4A от Codex: `*** Begin Patch` … `*** End Patch`).
750
+ - **Git** — `GitStatus`, `GitDiff`, `GitLog`, `GitShow`, `GitBranchList`,
751
+ `GitAdd`, `GitCommit`, `GitPush`.
752
+ - **Web** — `WebFetch`, `WebSearch`.
753
+ - **Служебный** — `respond` (финальный ответ оператору, завершает задачу).
754
+
755
+ Все файловые инструменты остаются внутри рабочей директории (песочница).
756
+ `Write`/`Edit` и `MultiEdit`/`ApplyPatch` делают резервную копию (undo) перед
757
+ изменением файла.
758
+
759
+ ## Слэш-команды
760
+
761
+ Введите / в промпте для подсказок (Tab дополняет). Кроме команд сессии и
762
+ конфига (/new, /chats, /resume, /cd, /status, /config, /undo, /transcript,
763
+ /mcp, /skills, /memory, /init, /reload, /debug-dom, /help, /exit) есть
764
+ несколько в духе Claude Code / Codex CLI:
765
+
766
+ - /diff [--staged] — показать git-диф рабочего дерева (--staged для индекса).
767
+ - /diffstat — сводка изменений одной строкой (`git diff --stat`).
768
+ - /context — показать, что загружено в промпт (AGENTS.md, MEMORY.md, навыки,
769
+ пользовательские команды) и размер системного промпта.
770
+ - /retry — отправить последнюю задачу в тот же чат заново (удобно после
771
+ обрезанного или пустого ответа).
772
+ - /rename <title> — задать заголовок текущей сессии (виден в /sessions).
773
+ - /copy — скопировать последний ответ ассистента в буфер обмена ОС.
774
+ - /cost (алиас /usage) — статистика сессии: задачи, вызовы инструментов,
775
+ длительность и размер контекста в токенах (DeepSeek
776
+ `accumulated_token_usage`).
777
+ - /export [file] — записать транскрипт сессии в Markdown-файл
778
+ (по умолчанию zames-export-<stamp>.md).
779
+ - /doctor — диагностика node, git, конфига, браузера, буфера обмена и MCP.
780
+ - /add-dir <path> — проверить дополнительную директорию (песочница
781
+ фиксируется при старте; для записи туда перезапустите с --dir).
782
+ - /resume <n> (после /chats) и /resume-id <id> — открыть чат и НАПЕЧАТАТЬ его
783
+ диалог в терминал, чтобы восстановленный контекст был виден. Показываются
784
+ только последние 20 сообщений (`RESTORED_HISTORY_LIMIT`). /last открывает
785
+ последний чат текущей директории без поиска; /sessions показывает сохранённые
786
+ сессии с их относительным возрастом.
787
+ - /help <command> — полное описание одной команды (например, `/help diff`)
788
+ вместо всего списка.
789
+ - /review [focus] [--staged] — попросить агента проверить незакоммиченные
790
+ изменения и сообщить находки (без правок кода).
791
+ - /plan [on|off] — режим плана (только чтение). Пока он включён, мутирующие
792
+ инструменты (Write/Edit/MultiEdit/ApplyPatch/Bash, GitAdd/GitCommit/GitPush)
793
+ убраны из набора, чтобы агент изучал код, не трогая дерево. Стартовать в нём
794
+ можно с `--plan`.
795
+ - /compact — попросить DeepSeek сжать текущий чат в передаточное резюме, затем
796
+ открыть НОВЫЙ чат, заново отправить системный промпт и положить резюме как
797
+ перенесённый контекст. Используйте, когда контекст разрастается.
798
+ - /goal [text|clear] — задать долгоживущую цель сессии. Она добавляется в
799
+ начало каждого сообщения задачи, поэтому модель держит общую картину через
800
+ много ходов. Хранится в `<project>/.zames-goal` (git-ignored) и
801
+ восстанавливается при следующем запуске.
802
+ - /loop <interval> <task> — повторять задачу периодически (например,
803
+ `/loop 10m run the tests`). /cron "<min> <hour> <dom> <month> <dow>" <task> —
804
+ запуск по расписанию. /jobs [rm <id>|clear] перечисляет и останавливает их.
805
+ Сработавшая задача попадает в ту же очередь сообщений, что и ваш ввод, так
806
+ что выполняется, когда агент свободен (никогда посреди генерации), и всё
807
+ равно соблюдает троттлинг отправки.
808
+ - /thinking [on|off] и /web [on|off] — переключить Deep thinking / Smart search.
809
+ Их (а также /queue, /jobs, /goal, `/config <sub>`) можно использовать, ПОКА
810
+ агент работает — они не трогают текущую генерацию.
811
+ - /queue [clear] — показать или очистить сообщения, ждущие отправки после
812
+ текущей задачи.
813
+
814
+ Контекст в токенах показывается и вживую: в строке статуса над вводом слева
815
+ спиннер/текст, справа — контекст (например, `125k · 13%`, процент от 1M
816
+ контекста). Он ОКРАШЕН по уровню заполнения: зелёный ниже 50%, жёлтый 50-80%,
817
+ красный выше 80%. Значение приходит из DeepSeek `accumulated_token_usage` и
818
+ скрыто до первого ответа.
819
+
820
+ ## Контекст проекта, навыки и память
821
+
822
+ Как в Codex / Claude Code, zames читает инструкции проекта и переиспользуемые
823
+ процессы из вашего репозитория и из `~/.zames`.
824
+
825
+ - **AGENTS.md** — инструкции проекта. Положите его в корень репозитория (или в
826
+ любую родительскую папку рабочей директории). Глобальные инструкции живут в
827
+ `~/.zames/AGENTS.md` (и `~/.claude/CLAUDE.md`). Запустите `/init`, и агент
828
+ изучит проект и напишет AGENTS.md на основе реальных команд сборки/тестов и
829
+ соглашений (`/init --force` перезапишет существующий файл).
830
+ - **MEMORY.md** — долговечные заметки, переживающие сессии. Агент дописывает
831
+ сюда полезные факты; можно править вручную или добавить из промпта через
832
+ `/remember <text>`.
833
+ - **Навыки** — папка с файлом `SKILL.md` (YAML-фронтматтер: `name`,
834
+ `description`, опционально `allowed-tools`, `user-invokable`) плюс любые
835
+ вспомогательные файлы. Ищутся в `.zames/skills/`, `.claude/skills/`,
836
+ `.agents/skills/`, `skills/` и `~/.zames/skills/`. Агент читает тело только
837
+ когда задача совпадает с описанием. Список — `/skills`; вызов —
838
+ `/<skill-name>`.
839
+ - **Пользовательские команды** — `.md`-файлы в `.zames/commands/` (или
840
+ `.claude/commands/`). Поддерживают подстановки `$ARGUMENTS` / `{{args}}` и
841
+ вызываются как `/<command-name>`.
842
+
843
+ Навыки и пользовательские команды видны в списке автодополнения «/» и в
844
+ `/help`.
845
+
846
+ ```
847
+ /skills список найденных навыков
848
+ /memory показать действующие AGENTS.md / MEMORY.md
849
+ /remember <text> дописать долговечную заметку в MEMORY.md
850
+ /init [--force] проанализировать проект и создать AGENTS.md
851
+ ```
852
+
853
+ ## MCP (внешние инструменты)
854
+
855
+ zames может использовать инструменты с серверов [MCP](https://modelcontextprotocol.io).
856
+ Главный пример — @playwright/mcp: он даёт агенту настоящий браузер
857
+ (navigate, click, snapshot, type, ...) поверх того, который zames уже
858
+ использует для чата DeepSeek.
859
+
860
+ Положите файл конфига (той же формы, что в Claude Code / Cursor):
861
+
862
+ - `~/.zames/mcp.json` — глобальный
863
+ - `<project>/.zames/mcp.json` — на уровне проекта (поздние файлы побеждают)
864
+ - `<project>/.mcp.json` — привычное имя MCP
865
+
866
+ ```json
867
+ {
868
+ "mcpServers": {
869
+ "playwright": {
870
+ "command": "npx",
871
+ "args": ["-y", "@playwright/mcp@latest", "--headless", "--isolated"]
872
+ }
873
+ }
874
+ }
875
+ ```
876
+
877
+ ВАЖНО: держите MCP-браузер изолированным. @playwright/mcp по умолчанию
878
+ использует ТУ ЖЕ директорию профиля, что и zames (~/.zames/profile). Если
879
+ запустить его без --isolated (или без собственного --user-data-dir),
880
+ MCP-браузер и браузер агента подерутся за один профиль, и чат DeepSeek
881
+ покажет «Something went wrong when opening your profile». Всегда передавайте
882
+ --isolated, как в примере выше.
883
+ Серверы бывают и удалёнными ("url": "https://...", "transport": "sse").
884
+ Их инструменты видны агенту как `server__tool` (например,
885
+ `playwright__browser_navigate`) и перечисляются в `/mcp` и `/status`.
886
+ Сервер, который не смог подключиться, пропускается с предупреждением и
887
+ никогда не роняет агента.
888
+
889
+ ## Конфигурация
890
+
891
+ Глобальный конфиг: `~/.zames/config.json`
892
+ Локальный (на проект): `.zamesrc.json`
893
+
894
+ Просматривать и менять настройки можно не выходя из агента — командой
895
+ `/config`. Запустите её без аргументов, чтобы открыть интерактивное меню
896
+ (↑/↓ — навигация, Enter — изменение, `d` — сброс, `q` — выход). Булевы и
897
+ enum переключаются на месте; числа и строки открывают ввод.
898
+
899
+ ```
900
+ /config интерактивное меню настроек
901
+ /config list показать все изменяемые настройки
902
+ /config get <path> показать настройку
903
+ /config set <path> <value> изменить настройку
904
+ /config reset <path> сбросить настройку к дефолту
905
+ /config path показать пути файлов конфига
906
+ /config lang <ru|en> переключить язык интерфейса и агента
907
+ ```
908
+
909
+ Примеры:
910
+
911
+ ```
912
+ /config set maxIterations 20
913
+ /config set browser.deepThinking true # DeepSeek Deep thinking (медленно; рассуждения скрыты)
914
+ /config set browser.webSearch false # DeepSeek Smart web search
915
+ /config lang en
916
+ ```
917
+
918
+ Изменения пишутся в проектный `.zamesrc.json` и применяются сразу (где это
919
+ возможно без перезапуска).
920
+
921
+ ### Язык
922
+
923
+ `/config lang ru` или `/config lang en` переключает и язык интерфейса
924
+ (справка, сообщения, спиннер), и язык, на котором агент вам отвечает. Локаль
925
+ хранится в `ui.locale` в файле конфига.
926
+
927
+ Данные агента хранятся в `~/.zames`: профиль браузера, логи, история undo,
928
+ сессии.
929
+
930
+ ## FAQ
931
+
932
+ **Это официальный продукт DeepSeek?**
933
+ Нет. zames управляет публичным веб-интерфейсом chat.deepseek.com через
934
+ настоящий браузер, как обычный пользователь. Он не связан с DeepSeek.
935
+
936
+ **Нужен ли API-ключ?**
937
+ Нет. Вы один раз входите в свой аккаунт DeepSeek; сессия хранится в
938
+ `~/.zames/profile` и переиспользуется.
939
+
940
+ **Какую модель он использует?**
941
+ Ту, которую использует веб-чат DeepSeek (DeepSeek-V3 или reasoning-модель при
942
+ включённом «Deep thinking»). zames никогда не вызывает API напрямую.
943
+
944
+ **Работает ли headless / на сервере?**
945
+ Да — headless по умолчанию, а `--output-format jsonl` делает его скриптуемым.
946
+ `--headed` нужен только для ручного входа или отладки селекторов.
947
+
948
+ **Разрешена ли автоматизация веб-интерфейса?**
949
+ Это зависит от условий DeepSeek; автоматизация сайта может их нарушать.
950
+ Используйте на свой риск и держите троттлинг отправки (15 с по умолчанию),
951
+ чтобы не бить по рейт-лимиту.
952
+
953
+ **Чем отличается от Claude Code / Codex?**
954
+ Та же форма (инструменты, `AGENTS.md`, навыки, MCP, слэш-команды), но работает
955
+ на вашем аккаунте DeepSeek вместо API, как автоматизация браузера, а не
956
+ first-party API-клиент.
957
+
958
+ ## Ссылки
959
+
960
+ - **npm:** <https://www.npmjs.com/package/zames_pro>
961
+ - **GitHub:** <https://github.com/Viqto0r/zames_pro>
962
+ - **Changelog:** [`CHANGELOG.md`](CHANGELOG.md)
963
+ - **Contributing:** [`CONTRIBUTING.md`](CONTRIBUTING.md)
964
+ - **Security policy:** [`SECURITY.md`](SECURITY.md)
965
+ - **Code of conduct:** [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md)
966
+
967
+ ## Лицензия
968
+
969
+ MIT
970
+
971
+ </details>
package/README.ru.md CHANGED
@@ -500,3 +500,472 @@ first-party API-клиент.
500
500
  ## Лицензия
501
501
 
502
502
  MIT
503
+
504
+ <details>
505
+ <summary>🇬🇧 Read in English</summary>
506
+
507
+ A terminal coding agent that works on top of [chat.deepseek.com](https://chat.deepseek.com/) through Playwright.
508
+ In spirit it is similar to Claude Code / Codex CLI: it starts in the current
509
+ directory, reads and edits files, runs commands, and commits to git.
510
+
511
+ > No API key required — it drives the DeepSeek web chat like a regular user
512
+ > through a real (headless) browser.
513
+
514
+ <p align="center">
515
+ <img src="https://raw.githubusercontent.com/Viqto0r/zames_pro/master/docs/demo.png" alt="zames session in the terminal" width="860">
516
+ </p>
517
+
518
+ ## Quick start
519
+
520
+ ```bash
521
+ npm install -g zames_pro # Chromium for Playwright is downloaded automatically
522
+ cd your-project # any folder the agent should work in
523
+ zames # sign in once, then describe your task
524
+ ```
525
+
526
+ There is **no API key and no per-token bill**: zames signs in to **your own
527
+ [chat.deepseek.com](https://chat.deepseek.com/) account** in a real (headless)
528
+ Chromium and drives the web chat like a regular user. The first launch asks for
529
+ your DeepSeek login once (the session is stored in `~/.zames/profile`); after
530
+ that just run `zames` and type a task in plain language:
531
+
532
+ ```text
533
+ ❯ refactor the config loader and add a test for the new default
534
+ ```
535
+
536
+ While the agent works you can keep typing — a message sent mid-task is queued
537
+ and runs right after it, in the same chat. `Esc` aborts the current generation,
538
+ `/help` lists commands, `/exit` quits.
539
+
540
+ ## How it works
541
+
542
+ zames does not call the model API. It launches a headless Chromium with a
543
+ persistent profile, signs in to `chat.deepseek.com` like a human, types the task
544
+ into the chat box, and reads the answer back.
545
+
546
+ <p align="center">
547
+ <img src="https://raw.githubusercontent.com/Viqto0r/zames_pro/master/docs/how-it-works.png" alt="how zames works" width="860">
548
+ </p>
549
+
550
+ In text: you type a task → zames sends the system prompt plus the task into
551
+ the DeepSeek web chat → the model answers → zames parses the tool call, runs
552
+ the tool locally, feeds the result back, and prints the final answer for you.
553
+
554
+ Key pieces:
555
+
556
+ - **The answer is read from the raw network stream** (SSE), not the rendered
557
+ DOM, so tool-call JSON with template strings and escapes survives intact.
558
+ - **A persistent profile** (`~/.zames/profile`) keeps you signed in; the
559
+ headless User-Agent is patched so DeepSeek's CDN does not 403 the login.
560
+ - **A send throttle** (15 s by default) keeps the web chat's rate limit happy
561
+ during long tool-heavy runs.
562
+ - **The agent is sandboxed** to the directory it was started in — no tool can
563
+ read or write above it.
564
+
565
+ ## Table of contents
566
+
567
+ - [Quick start](#quick-start) · [Features](#features) · [Why zames?](#why-zames) · [Requirements](#requirements)
568
+ - [How it works](#how-it-works) · [Installation](#installation) · [Signing in](#signing-in) · [Usage](#usage)
569
+ - [Tools](#tools) · [Slash commands](#slash-commands)
570
+ - [Project context, skills and memory](#project-context-skills-and-memory) · [MCP (external tools)](#mcp-external-tools) · [Configuration](#configuration)
571
+ - [FAQ](#faq) · [Links](#links) · [License](#license)
572
+
573
+ ## Features
574
+
575
+ - **Tools like Claude Code / Codex** — `Read`, `Write`, `Edit`, `Bash`,
576
+ `Glob`, `Grep`, plus `MultiEdit`, `ApplyPatch`, `LS`, `TodoWrite`, git and web
577
+ tools. Every edit is backed by `/undo`.
578
+ - **Runs while you keep typing** — queue messages during a task; they run right
579
+ after it, in the same chat (like typing during generation on the web).
580
+ - **Plan mode** — `/plan` (or `--plan`) drops all mutating tools, so the agent
581
+ can investigate the code without touching the tree.
582
+ - **Project context** — reads `AGENTS.md`, `MEMORY.md`, skills (`SKILL.md`) and
583
+ custom commands from the repo and `~/.zames`, the same idea as Codex / Claude
584
+ Code.
585
+ - **MCP support** — plug in external tool servers (e.g. `@playwright/mcp`).
586
+ - **Scheduling** — `/loop`, `/cron` and `/jobs` repeat tasks on a timer.
587
+ - **Bilingual UI** — Russian / English (`/config lang`).
588
+
589
+ ## Why zames?
590
+
591
+ - **No API key, no per-token bill** — it uses your own DeepSeek chat account,
592
+ not the paid API. Good for long, tool-heavy tasks.
593
+ - **Same workflow as Claude Code / Codex** — tools, `AGENTS.md`, skills, MCP
594
+ and slash commands, so it feels familiar from day one.
595
+ - **Runs unattended** — headless by default, resumable sessions, and `/loop`
596
+ plus `/cron` for scheduled work.
597
+ - **Local-first** — the browser profile, credentials and logs never leave your
598
+ machine, and the agent is sandboxed to the project directory.
599
+
600
+ ## Requirements
601
+
602
+ - Node.js >= 20
603
+ - A DeepSeek account. On first launch zames asks for your DeepSeek
604
+ login/password in the terminal (and stores them in `~/.zames/config.json`
605
+ after a successful sign-in, so a later logout is handled automatically
606
+ without asking you again). You can also sign in manually in the browser
607
+ window when the browser is headed.
608
+
609
+ ## Signing in
610
+
611
+ The browser runs **headless by default**. When DeepSeek requires a sign-in,
612
+ zames:
613
+
614
+ 1. reuses the session stored in the persistent profile (`~/.zames/profile`)
615
+ if it is still valid;
616
+ 2. otherwise signs in automatically with the saved credentials
617
+ (`browser.auth.username` / `browser.auth.password`);
618
+ 3. otherwise asks you for the login/password in the terminal (in a TTY) and,
619
+ after a successful sign-in, remembers them for next time;
620
+ 4. otherwise falls back to a manual sign-in hint.
621
+
622
+ To sign in by hand (for example, if DeepSeek shows a captcha), run with a
623
+ visible window:
624
+
625
+ ```bash
626
+ zames --headed
627
+ ```
628
+
629
+ The `--headless` flag (the default) and `headless: true` in the config keep
630
+ the browser without a window; `--headed` / `headless: false` show it.
631
+
632
+ Headless works out of the box: a headless Chrome normally advertises a
633
+ `HeadlessChrome/...` User-Agent that DeepSeek's CDN blocks with a 403, so
634
+ zames strips that marker before loading the page (keeping the real engine
635
+ version). You do not need `--headed` just to log in.
636
+
637
+ Credentials and toggles can also be edited from `/config`
638
+ (`browser.auth.username`, `browser.auth.password`, `browser.auth.saveSession`).
639
+
640
+ ## Installation
641
+
642
+ ```bash
643
+ npm install -g zames_pro
644
+ ```
645
+
646
+ Chromium for Playwright is downloaded automatically on install. On Linux/WSL
647
+ the required system libraries are installed too when passwordless `sudo` is
648
+ available; otherwise run once by hand:
649
+
650
+ ```bash
651
+ npx playwright install chromium
652
+ sudo npx playwright install-deps chromium
653
+ ```
654
+
655
+ ## Usage
656
+
657
+ Go to your project folder and run:
658
+
659
+ ```bash
660
+ zames
661
+ ```
662
+
663
+ The agent works inside the directory it was started in and cannot leave it (sandbox).
664
+
665
+ While the agent is working you can keep typing: press Enter to queue a message
666
+ (it is sent right after the current task, in the same chat), or Esc / Ctrl+C to
667
+ abort the current generation. This mirrors typing during generation on the
668
+ DeepSeek website.
669
+
670
+ ### Input line
671
+
672
+ The prompt is a small line editor with persistent history:
673
+
674
+ - `↑` / `↓` — walk the message history (saved in `~/.zames/history.json`, so it
675
+ survives a restart); inside a multiline message the arrows move between lines.
676
+ - `Ctrl+R` — incremental reverse search over the history (bash-style): type to
677
+ filter, `Ctrl+R` for older matches, `Enter` to accept, `Esc` to cancel.
678
+ - `Ctrl+_` — undo the last edit in the input line (a fat-fingered `Ctrl+U` /
679
+ `Ctrl+K` is recoverable).
680
+ - `Ctrl+U` — clear the line, `Ctrl+K` — delete to end of line, `Ctrl+W` —
681
+ delete the word before the cursor, `Ctrl+←`/`Ctrl+→` — move by words.
682
+ - `\` + `Enter`, `Ctrl+J`, `Ctrl+Enter` or `Shift+Enter` — insert a newline.
683
+ - `/` + `Tab` — slash-command hints and completion.
684
+ - `!command` — run a shell command directly, bypassing the model (like
685
+ Claude Code's bash mode). The same sandbox guard as the `Bash` tool applies,
686
+ so a direct command cannot leave the project either.
687
+
688
+ Set `NO_COLOR=1` to disable colors (a calm default palette is used otherwise).
689
+
690
+ ### Images and files
691
+
692
+ You can paste an image or a file into the input line (Ctrl+Shift+V / Shift+Insert
693
+ or the terminal's own paste). zames saves it under `<project>/tmp` and shows a
694
+ marker in the line - `[image#1]` for images, `[file#1]` for other files - then
695
+ uploads the real file to the chat together with your message. These are the
696
+ same formats the DeepSeek web chat accepts (PNG, JPEG, GIF, WEBP, BMP, SVG and
697
+ the usual document types).
698
+
699
+ Pasting an image works when the terminal sends it as a `data:` URL or as a
700
+ base64 blob with a recognizable image signature. You can also paste a path to a
701
+ local file (drag a file into the terminal or copy its path); if the file exists
702
+ it is attached, otherwise the text is inserted as usual.
703
+
704
+ Press Ctrl+V (or use an empty paste) and zames reads the image straight from
705
+ the clipboard: Linux via wl-paste (Wayland) or xclip/xsel (X11), macOS
706
+ via pngpaste, Windows via PowerShell. The needed Linux tools are installed
707
+ automatically on npm install (best-effort, through the detected package
708
+ manager). If no image is found, zames says so and reports which tool it tried,
709
+ instead of staying silent.
710
+
711
+ ### Options
712
+
713
+ ```
714
+ zames --task <task text>
715
+ zames --chat <id>
716
+ zames --new-chat
717
+ zames --resend-prompt
718
+ zames --dir <path>
719
+ zames --headless
720
+ zames --headed
721
+ zames --plan
722
+ zames --output-format jsonl
723
+ zames --debug
724
+ zames --version
725
+ zames --help
726
+ ```
727
+
728
+ ### Machine-readable output (scripts / CI)
729
+
730
+ For one-shot runs (`--task`) the agent can emit its event stream as JSON lines
731
+ on stdout, keeping all human text on stderr:
732
+
733
+ ```bash
734
+ zames --task "summarize the diff" --output-format jsonl
735
+ ```
736
+
737
+ Each line is one event (`tool_call`, `tool_result`, `assistant_final`, ...), so
738
+ it pipes straight into `jq`:
739
+
740
+ ```bash
741
+ zames --task "..." --output-format jsonl \
742
+ | jq -r 'select(.type=="assistant_final") | .message'
743
+ ```
744
+
745
+ ## Tools
746
+
747
+ The agent has the same style of tools as Claude Code / Codex CLI:
748
+
749
+ - **File tools** — `Read`, `Write`, `Edit`, `Bash`, `Glob`, `Grep`. `Read`
750
+ returns raw content by default; pass `numbered=true` to get `cat -n`-style
751
+ line numbers (for reference only — do not paste them into `Edit`).
752
+ - **Extra tools** — `LS` (list a directory), `MultiEdit` (several edits to one
753
+ file applied atomically), `TodoWrite` (session task checklist), `ApplyPatch`
754
+ (multi-file patch in Codex's V4A format: `*** Begin Patch` … `*** End Patch`).
755
+ - **Git** — `GitStatus`, `GitDiff`, `GitLog`, `GitShow`, `GitBranchList`,
756
+ `GitAdd`, `GitCommit`, `GitPush`.
757
+ - **Web** — `WebFetch`, `WebSearch`.
758
+ - **Service** — `respond` (final answer to the operator, ends the task).
759
+
760
+ All file tools stay inside the working directory (sandbox). `Write`/`Edit` and
761
+ `MultiEdit`/`ApplyPatch` make a backup (undo) before touching a file.
762
+
763
+ ## Slash commands
764
+
765
+ Type / in the prompt for hints (Tab completes). Besides the session and
766
+ config commands (/new, /chats, /resume, /cd, /status, /config,
767
+ /undo, /transcript, /mcp, /skills, /memory, /init, /reload,
768
+ /debug-dom, /help, /exit) there are a few that mirror Claude Code /
769
+ Codex CLI:
770
+
771
+ - /diff [--staged] — show the working-tree git diff (--staged for the index).
772
+ - /diffstat — a one-line change summary (`git diff --stat`).
773
+ - /context — show what is loaded into the prompt (AGENTS.md, MEMORY.md,
774
+ skills, custom commands) and the system-prompt size.
775
+ - /retry — resend the last task into the same chat (handy after a truncated
776
+ or empty answer).
777
+ - /rename <title> — set the current session title (shown in /sessions).
778
+ - /copy — copy the last assistant answer to the OS clipboard.
779
+ - /cost (alias /usage) — session stats: tasks, tool calls, duration, and the
780
+ context size in tokens (DeepSeek's `accumulated_token_usage`).
781
+ - /export [file] — write the session transcript to a Markdown file
782
+ (zames-export-<stamp>.md by default).
783
+ - /doctor — diagnose node, git, config, browser, clipboard and MCP.
784
+ - /add-dir <path> — validate an extra directory (the sandbox is fixed at
785
+ startup; relaunch with --dir to write there).
786
+ - /resume <n> (after /chats) and /resume-id <id> — open a chat and PRINT its
787
+ dialogue into the terminal, so the restored context is visible. Only the
788
+ last 20 messages are shown (`RESTORED_HISTORY_LIMIT`). /last reopens the last
789
+ chat of the current directory with no lookup step; /sessions shows the saved
790
+ sessions with their relative age.
791
+ - /help <command> — the full description of a single command (e.g. `/help diff`)
792
+ instead of the whole list.
793
+ - /review [focus] [--staged] — ask the agent to review uncommitted changes
794
+ and report findings (no code changes).
795
+ - /plan [on|off] — plan (read-only) mode. While it is on, the mutating tools
796
+ (Write/Edit/MultiEdit/ApplyPatch/Bash, GitAdd/GitCommit/GitPush) are removed
797
+ from the tool set, so the agent can investigate without touching the tree.
798
+ Start in it with `--plan`.
799
+ - /compact — ask DeepSeek to compress the current chat into a handover
800
+ summary, then open a NEW chat, resend the system prompt and post the summary
801
+ as the carried-over context. Use it when the context gets long.
802
+ - /goal [text|clear] — set a long-lived session goal. It is prepended to every
803
+ task message, so the model keeps the big picture across many turns. Stored in
804
+ `<project>/.zames-goal` (git-ignored) and restored on the next launch.
805
+ - /loop <interval> <task> — repeat a task periodically (e.g. `/loop 10m run the
806
+ tests`). /cron "<min> <hour> <dom> <month> <dow>" <task> — run on a schedule.
807
+ /jobs [rm <id>|clear] lists and stops them. A fired job is put into the same
808
+ message queue you type into, so it runs when the agent is free (never mid-
809
+ generation) and still respects the send throttle.
810
+ - /thinking [on|off] and /web [on|off] — toggle Deep thinking / Smart search.
811
+ These (and /queue, /jobs, /goal, `/config <sub>`) can be used WHILE the agent
812
+ is working — they do not touch the in-flight generation.
813
+ - /queue [clear] — list or clear the messages waiting to be sent after the
814
+ current task.
815
+
816
+ The token context is also shown live: the status line above the input has the
817
+ spinner/text on the left and the context on the right (e.g. `125k · 13%`,
818
+ percent of a 1M context). It is COLORED by fill level: green below 50%,
819
+ yellow 50-80%, red above 80%. It comes from DeepSeek's
820
+ `accumulated_token_usage` and is hidden until the first answer delivers it.
821
+
822
+ ## Project context, skills and memory
823
+
824
+ Like Codex / Claude Code, zames reads project instructions and reusable
825
+ workflows from your repository and from `~/.zames`.
826
+
827
+ - **AGENTS.md** — project instructions. Put one in the repo root (or in any
828
+ parent folder of the working directory). Global instructions live in
829
+ `~/.zames/AGENTS.md` (and `~/.claude/CLAUDE.md`). Run `/init` and the agent
830
+ will explore the project and write an AGENTS.md based on the real build/test
831
+ commands and conventions (use `/init --force` to overwrite an existing file).
832
+ - **MEMORY.md** — durable notes that persist between sessions. The agent
833
+ appends useful facts here; you can edit it by hand, or add one from the
834
+ prompt with `/remember <text>`.
835
+ - **Skills** — a folder with a `SKILL.md` file (YAML frontmatter: `name`,
836
+ `description`, optional `allowed-tools`, `user-invokable`) plus any helper
837
+ files. Discovered under `.zames/skills/`, `.claude/skills/`,
838
+ `.agents/skills/`, `skills/`, and `~/.zames/skills/`. The agent reads the
839
+ body only when a task matches the description. List them with `/skills`;
840
+ invoke one with `/<skill-name>`.
841
+ - **Custom commands** — `.md` files under `.zames/commands/` (or
842
+ `.claude/commands/`). They support `$ARGUMENTS` / `{{args}}` placeholders and
843
+ are invoked with `/<command-name>`.
844
+
845
+ Skills and custom commands show up in the «/» completion list and in `/help`.
846
+
847
+ ```
848
+ /skills list discovered skills
849
+ /memory show AGENTS.md / MEMORY.md in effect
850
+ /remember <text> append a durable note to MEMORY.md
851
+ /init [--force] analyze the project and create AGENTS.md
852
+ ```
853
+
854
+ ## MCP (external tools)
855
+
856
+ zames can use tools from [MCP](https://modelcontextprotocol.io) servers.
857
+ The flagship example is @playwright/mcp: it gives the agent a real browser
858
+ (navigate, click, snapshot, type, ...) on top of the one zames already uses
859
+ for the DeepSeek chat.
860
+
861
+ Drop a config file (same shape as Claude Code / Cursor):
862
+
863
+ - `~/.zames/mcp.json` - global
864
+ - `<project>/.zames/mcp.json` - project-scoped (later files win)
865
+ - `<project>/.mcp.json` - the common MCP name
866
+
867
+ ```json
868
+ {
869
+ "mcpServers": {
870
+ "playwright": {
871
+ "command": "npx",
872
+ "args": ["-y", "@playwright/mcp@latest", "--headless", "--isolated"]
873
+ }
874
+ }
875
+ }
876
+ ```
877
+
878
+ IMPORTANT: keep the MCP browser isolated. @playwright/mcp defaults to the
879
+ SAME profile directory as zames (~/.zames/profile). If it is launched
880
+ without --isolated (or without its own --user-data-dir), the MCP browser
881
+ and the agent browser fight over one profile and the DeepSeek chat shows
882
+ "Something went wrong when opening your profile". Always pass --isolated
883
+ as in the example above.
884
+ Servers can also be remote ("url": "https://...", "transport": "sse").
885
+ Their tools show up in the agent as `server__tool` (e.g.
886
+ `playwright__browser_navigate`) and are listed with `/mcp` and in `/status`.
887
+ A server that fails to connect is skipped with a warning and never breaks the
888
+ agent.
889
+
890
+ ## Configuration
891
+
892
+ Global config: `~/.zames/config.json`
893
+ Local (per project): `.zamesrc.json`
894
+
895
+ You can view and change settings without leaving the agent — use the
896
+ `/config` command. Run it without arguments to open an interactive menu
897
+ (↑/↓ to move, Enter to change, `d` to reset, `q` to quit). Booleans and enums
898
+ toggle in place; numbers and strings open an input prompt.
899
+
900
+ ```
901
+ /config interactive settings menu
902
+ /config list print all editable settings
903
+ /config get <path> show a setting
904
+ /config set <path> <value> change a setting
905
+ /config reset <path> reset a setting to its default
906
+ /config path show config file paths
907
+ /config lang <ru|en> switch interface and agent language
908
+ ```
909
+
910
+ Examples:
911
+
912
+ ```
913
+ /config set maxIterations 20
914
+ /config set browser.deepThinking true # DeepSeek Deep thinking (slow; reasoning is hidden)
915
+ /config set browser.webSearch false # DeepSeek Smart web search
916
+ /config lang en
917
+ ```
918
+
919
+ Changes are written to the project `.zamesrc.json` and applied right away
920
+ (where possible without a restart).
921
+
922
+ ### Language
923
+
924
+ `/config lang ru` or `/config lang en` switches both the interface language
925
+ (help, messages, spinner) and the language the agent answers you in. The
926
+ locale lives in `ui.locale` in the config file.
927
+
928
+ Agent data is stored in `~/.zames`: browser profile, logs, undo history, sessions.
929
+
930
+ ## FAQ
931
+
932
+ **Is this an official DeepSeek product?**
933
+ No. zames drives the public chat.deepseek.com web UI through a real browser,
934
+ like a regular user. It is not affiliated with DeepSeek.
935
+
936
+ **Do I need an API key?**
937
+ No. You sign in with your own DeepSeek account once; the session is stored in
938
+ `~/.zames/profile` and reused.
939
+
940
+ **Which model does it use?**
941
+ Whichever the DeepSeek web chat uses (DeepSeek-V3, or the reasoning model with
942
+ "Deep thinking" on). zames never calls the API directly.
943
+
944
+ **Does it work headless / on a server?**
945
+ Yes — headless is the default, and `--output-format jsonl` makes it scriptable.
946
+ `--headed` is only needed for a manual sign-in or selector debugging.
947
+
948
+ **Is automating the web UI allowed?**
949
+ That depends on DeepSeek's terms; automating a website may violate them. Use at
950
+ your own risk and keep the send throttle (15s by default) so you do not hammer
951
+ the rate limit.
952
+
953
+ **How is it different from Claude Code / Codex?**
954
+ Same shape (tools, `AGENTS.md`, skills, MCP, slash commands) but it runs on your
955
+ DeepSeek account instead of an API, as a browser automation rather than a
956
+ first-party API client.
957
+
958
+ ## Links
959
+
960
+ - **npm:** <https://www.npmjs.com/package/zames_pro>
961
+ - **GitHub:** <https://github.com/Viqto0r/zames_pro>
962
+ - **Changelog:** [`CHANGELOG.md`](CHANGELOG.md)
963
+ - **Contributing:** [`CONTRIBUTING.md`](CONTRIBUTING.md)
964
+ - **Security policy:** [`SECURITY.md`](SECURITY.md)
965
+ - **Code of conduct:** [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md)
966
+
967
+ ## License
968
+
969
+ MIT
970
+
971
+ </details>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zames_pro",
3
- "version": "2.66.0",
3
+ "version": "2.66.1",
4
4
  "description": "Terminal coding agent that drives chat.deepseek.com through Playwright — 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": {
@@ -33,6 +33,7 @@
33
33
  "test:watch": "tsx --test --watch test/*.test.ts",
34
34
  "self-smoke": "tsx scripts/self-smoke.mjs",
35
35
  "render-demo": "node scripts/render-demo.mjs",
36
+ "build:readme": "tsx scripts/build-readme.mts",
36
37
  "postinstall": "node scripts/postinstall.mjs",
37
38
  "prepare": "husky"
38
39
  },
@@ -0,0 +1,129 @@
1
+ // Assemble README.md and README.ru.md from two language sources.
2
+ //
3
+ // Why: npm renders exactly ONE readme per package (README.md in the root) and
4
+ // has no language tabs, so a separate README.ru.md is invisible on the npm
5
+ // page. But npm renders the readme with GitHub Flavored Markdown (via GitHub's
6
+ // API), so a <details> block DOES work there -- and on GitHub too. We therefore
7
+ // keep the English text on top and fold the other language into a collapsible
8
+ // block at the bottom.
9
+ //
10
+ // The two sources (docs/readme.en.md, docs/readme.ru.md) are the single point
11
+ // of edit for each language; this script wires the switcher and the collapsible
12
+ // cross-language block so neither README has to be maintained by hand. The
13
+ // generated files are committed; test/readme-built.test.ts re-runs buildReadmes()
14
+ // and fails if they drift from the sources.
15
+ //
16
+ // Usage: node scripts/build-readme.mjs (or: npm run build:readme)
17
+
18
+ import fs from 'node:fs'
19
+ import path from 'node:path'
20
+ import { fileURLToPath } from 'node:url'
21
+
22
+ const NL = String.fromCharCode(10)
23
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
24
+ export const SWITCHER = '<!-- SWITCHER -->'
25
+
26
+ const REPO = 'https://github.com/Viqto0r/zames_pro/blob/master'
27
+ const EN_SWITCH = [
28
+ '<p align="center">',
29
+ ' <strong>English</strong> | <a href="' +
30
+ REPO +
31
+ '/README.ru.md">Русский</a>',
32
+ '</p>',
33
+ ].join(NL)
34
+ const RU_SWITCH = [
35
+ '<p align="center">',
36
+ ' <a href="' + REPO + '/README.md">English</a> | <strong>Русский</strong>',
37
+ '</p>',
38
+ ].join(NL)
39
+
40
+ export function readSource(
41
+ rootDir: string,
42
+ name: string,
43
+ ): { head: string; body: string } {
44
+ const file = path.join(rootDir, 'docs', name)
45
+ const text = fs.readFileSync(file, 'utf-8')
46
+ const i = text.indexOf(SWITCHER)
47
+ if (i < 0) {
48
+ throw new Error(
49
+ file + ' has no ' + SWITCHER + ' marker (was it edited by hand?)',
50
+ )
51
+ }
52
+ return {
53
+ // Everything above the marker: logo, title, badges.
54
+ head: text.slice(0, i).replace(/\n+$/, ''),
55
+ // Everything below: the actual documentation.
56
+ body: text
57
+ .slice(i + SWITCHER.length)
58
+ .replace(/^\n+/, '')
59
+ .replace(/\n+$/, ''),
60
+ }
61
+ }
62
+
63
+ function details(summary: string, body: string): string {
64
+ return [
65
+ '<details>',
66
+ '<summary>' + summary + '</summary>',
67
+ '',
68
+ body,
69
+ '',
70
+ '</details>',
71
+ ].join(NL)
72
+ }
73
+
74
+ function assemble(opts: {
75
+ head: string
76
+ switchLine: string
77
+ body: string
78
+ foldSummary: string
79
+ foldBody: string
80
+ }): string {
81
+ const { head, switchLine, body, foldSummary, foldBody } = opts
82
+ return [
83
+ head,
84
+ '',
85
+ switchLine,
86
+ '',
87
+ body,
88
+ '',
89
+ details(foldSummary, foldBody),
90
+ '',
91
+ ].join(NL)
92
+ }
93
+
94
+ // Returns the two generated readmes WITHOUT touching the disk, so a test can
95
+ // compare them against the committed files.
96
+ export function buildReadmes(rootDir: string): {
97
+ readmeEn: string
98
+ readmeRu: string
99
+ } {
100
+ const en = readSource(rootDir, 'readme.en.md')
101
+ const ru = readSource(rootDir, 'readme.ru.md')
102
+ return {
103
+ readmeEn: assemble({
104
+ head: en.head,
105
+ switchLine: EN_SWITCH,
106
+ body: en.body,
107
+ foldSummary: '🇷🇺 Читать по-русски (Russian)',
108
+ foldBody: ru.body,
109
+ }),
110
+ readmeRu: assemble({
111
+ head: ru.head,
112
+ switchLine: RU_SWITCH,
113
+ body: ru.body,
114
+ foldSummary: '🇬🇧 Read in English',
115
+ foldBody: en.body,
116
+ }),
117
+ }
118
+ }
119
+
120
+ // Run only when invoked directly (not when imported by a test).
121
+ const invoked =
122
+ process.argv[1] &&
123
+ path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)
124
+ if (invoked) {
125
+ const { readmeEn, readmeRu } = buildReadmes(root)
126
+ fs.writeFileSync(path.join(root, 'README.md'), readmeEn)
127
+ fs.writeFileSync(path.join(root, 'README.ru.md'), readmeRu)
128
+ console.log('build-readme: wrote README.md and README.ru.md')
129
+ }
@@ -108,7 +108,18 @@ const subjects = git(['log', '--no-merges', '--pretty=format:%s', ref + '..HEAD'
108
108
  const parsed = subjects
109
109
  .map(parseConventionalCommit)
110
110
  .filter((c): c is NonNullable<typeof c> => c !== null)
111
- const body = renderChangelogDraft(groupCommits(parsed))
111
+ let body = renderChangelogDraft(groupCommits(parsed))
112
+
113
+ // The conventional draft skips chore/docs/test/etc, so a release whose only
114
+ // change is a docs fix (a README tweak users WILL see on the npm page) would
115
+ // otherwise collapse to a useless "Internal improvements." placeholder. Fall
116
+ // back to the raw commit subjects under Changed instead of that stub.
117
+ if (!body) {
118
+ const fallback = subjects.filter((s) => !/^chore(:|\(release\))/i.test(s))
119
+ if (fallback.length) {
120
+ body = ['## Changed', ''].concat(fallback.map((s) => '- ' + s)).join(NL)
121
+ }
122
+ }
112
123
 
113
124
  // CHANGELOG groups are `### Added` (Keep a Changelog), the draft renders
114
125
  // `## Added` — normalize here.