@emaxe/tuigram 1.0.0 → 1.0.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 ADDED
@@ -0,0 +1,108 @@
1
+ # Changelog
2
+
3
+ [English](./CHANGELOG.md) · [Русский](./CHANGELOG.ru.md)
4
+
5
+ All notable changes to this project are documented in this file.
6
+
7
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
8
+ and this project adheres to [Semantic Versioning](https://semver.org/).
9
+
10
+ ## [Unreleased]
11
+
12
+ ### Planned
13
+
14
+ - English localization of the TUI and CLI interface strings.
15
+
16
+ ## [1.0.1] — 2026-08-29
17
+
18
+ Documentation and packaging only — no runtime changes.
19
+
20
+ ### Added
21
+
22
+ - English `README.md` and Russian `README.ru.md` with a language switcher, a table of
23
+ contents and a contributing section.
24
+ - `CHANGELOG.md` and `CHANGELOG.ru.md` in Keep a Changelog format.
25
+ - A "Screenshots" section: ASCII captures of the main window, chat search, the help,
26
+ action, send-file, file-browser and chat-info modals, plus sample CLI output.
27
+ - `AGENTS.md` with `.agents/rules/` — codebase rules for humans and AI agents
28
+ (architecture, code style, neo-blessed UI, tests, secrets, docs and release),
29
+ with thin pointers for Copilot, Cursor and Claude Code.
30
+
31
+ ### Changed
32
+
33
+ - The npm package now ships `README.ru.md`, `CHANGELOG.md` and `CHANGELOG.ru.md`;
34
+ `scripts/check-package.js` treats them as required files.
35
+
36
+ ## [1.0.0] — 2026-08-29
37
+
38
+ First public release.
39
+
40
+ ### Added
41
+
42
+ **TUI**
43
+
44
+ - Two-pane adaptive terminal interface: dialog list on the left, message history
45
+ and input box on the right.
46
+ - Keyboard and mouse control — clicks and wheel scrolling.
47
+ - Dialog categories (`1`–`6`): All, Direct messages, Groups, Channels, Bots, Unread.
48
+ - Instant chat search and filtering by title and `@username` (`/`).
49
+ - Live typing indicator for the active chat.
50
+ - Rendering of Telegram entities with color: bold, italic, monospace code, code blocks,
51
+ URLs, mentions, hashtags and spoilers.
52
+ - Media attachment indicators: photo, video, document, voice, sticker, poll, geo,
53
+ contact, venue, dice and web page previews.
54
+ - Message reactions (👍, 🔥, ❤️) via the action menu.
55
+ - Infinite upward pagination of message history (`PageUp` / `Ctrl+U`).
56
+ - Reply (`Ctrl+R`) and edit (`Ctrl+E`) modes with a context banner above the input box.
57
+ - Modal windows: help (`F1` / `?`), chat info (`Ctrl+P`), message actions (`Ctrl+A`),
58
+ send file (`Ctrl+O`), file browser (`Ctrl+F`) and confirmation dialogs.
59
+ - Slash commands in the input box: `/help`, `/info`, `/sendfile`, `/clear`, `/logout`.
60
+ - Downloading incoming media through the message action menu.
61
+ - Three themes selectable via `TUI_THEME`: `default` (dark), `nord`, `light`.
62
+ All colors are hex values that reduce to xterm-256 indices ≥ 16, so a terminal's
63
+ own palette cannot repaint them.
64
+
65
+ **CLI**
66
+
67
+ - `tuigram init` — interactive and non-interactive (`--api-id`, `--api-hash`)
68
+ storage of Telegram API credentials.
69
+ - `tuigram paths` — prints the configuration and data paths plus the current state.
70
+ - `tuigram login` — login wizard with 2FA support.
71
+ - `tuigram dialogs [--limit N]` — list of dialogs.
72
+ - `tuigram history <peer> [--limit N]` — chat history, where `<peer>` is a `@username`,
73
+ an ID, or `me` for Saved Messages.
74
+ - `tuigram send <peer> <text>` — send a text message.
75
+ - `tuigram sendfile <peer> <path...> [--caption ...] [--as-file]` — send files;
76
+ up to 10 paths are sent as a single album.
77
+ - `tuigram listen` — live stream of MTProto updates.
78
+ - `./run.sh` — interactive launcher menu for development.
79
+
80
+ **Configuration and storage**
81
+
82
+ - Credentials and session are stored in OS user directories, not inside the package,
83
+ so a global install stays read-only and survives `npm update`.
84
+ - Path overrides via `TUIGRAM_CONFIG_DIR` / `TUIGRAM_DATA_DIR`, with `XDG_CONFIG_HOME`
85
+ and `XDG_DATA_HOME` honored.
86
+ - Settings precedence: process environment → project `.env` (repository clone only)
87
+ → the user `.env`.
88
+ - Automatic migration of a session from the legacy `<project>/data/session.txt` location.
89
+
90
+ **Security**
91
+
92
+ - The session file and the settings file are written with `0600` permissions.
93
+ - `scripts/check-package.js` — a pre-publish check that fails if `.env`, `data/`,
94
+ a session string, logs or tests would end up in the npm tarball; it also verifies
95
+ the shebang and the executable bit on `bin/tuigram.js`.
96
+ - `/logout` revokes the authorization key on the server and deletes the local session file.
97
+
98
+ **Tests**
99
+
100
+ - Unit tests (`npm test`) covering time formatting, peer parsing and entity types,
101
+ Telegram-entity rendering, slash-command argument parsing, `.env` writing and
102
+ credential validation, non-interactive login guards, and package configuration.
103
+ - A WCAG contrast test (3:1 threshold) applied to every theme **after** conversion
104
+ to xterm-256 — the colors are checked exactly as the user sees them.
105
+
106
+ [Unreleased]: https://github.com/emaxe/tuigram/compare/v1.0.1...HEAD
107
+ [1.0.1]: https://github.com/emaxe/tuigram/compare/v1.0.0...v1.0.1
108
+ [1.0.0]: https://github.com/emaxe/tuigram/releases/tag/v1.0.0
@@ -0,0 +1,110 @@
1
+ # История изменений
2
+
3
+ [English](./CHANGELOG.md) · [Русский](./CHANGELOG.ru.md)
4
+
5
+ Все заметные изменения проекта фиксируются в этом файле.
6
+
7
+ Формат основан на [Keep a Changelog](https://keepachangelog.com/ru/1.1.0/),
8
+ версионирование — по [Semantic Versioning](https://semver.org/lang/ru/).
9
+
10
+ ## [Unreleased]
11
+
12
+ ### Планируется
13
+
14
+ - Английская локализация строк интерфейса TUI и CLI.
15
+
16
+ ## [1.0.1] — 2026-08-29
17
+
18
+ Только документация и упаковка — поведение клиента не менялось.
19
+
20
+ ### Добавлено
21
+
22
+ - Английский `README.md` и русский `README.ru.md` с переключателем языков,
23
+ оглавлением и разделом об участии в разработке.
24
+ - `CHANGELOG.md` и `CHANGELOG.ru.md` в формате Keep a Changelog.
25
+ - Раздел «Скриншоты»: текстовые снимки главного окна, поиска чатов, окон справки,
26
+ действий, отправки файла, обзора файлов и сведений о чате, а также примеры вывода CLI.
27
+ - `AGENTS.md` вместе с `.agents/rules/` — правила кодовой базы для людей и ИИ-агентов
28
+ (архитектура, стиль кода, интерфейс на neo-blessed, тесты, секреты, документация
29
+ и релиз) и тонкие указатели для Copilot, Cursor и Claude Code.
30
+
31
+ ### Изменено
32
+
33
+ - В npm-пакет теперь попадают `README.ru.md`, `CHANGELOG.md` и `CHANGELOG.ru.md`;
34
+ `scripts/check-package.js` считает их обязательными.
35
+
36
+ ## [1.0.0] — 2026-08-29
37
+
38
+ Первый публичный релиз.
39
+
40
+ ### Добавлено
41
+
42
+ **TUI**
43
+
44
+ - Двухпанельный адаптивный интерфейс терминала: список диалогов слева, история
45
+ сообщений и поле ввода справа.
46
+ - Управление клавиатурой и мышью — клики и прокрутка колесом.
47
+ - Категории диалогов (`1`–`6`): Все, Личные, Группы, Каналы, Боты, Непрочитанные.
48
+ - Мгновенный поиск и фильтрация чатов по названию и `@username` (`/`).
49
+ - Индикатор набора текста в активном чате в реальном времени.
50
+ - Цветовое отображение Telegram Entities: жирный, курсив, моноширинный код, блоки
51
+ кода, ссылки, упоминания, хештеги и спойлеры.
52
+ - Индикаторы медиа-вложений: фото, видео, документы, голосовые, стикеры, опросы,
53
+ геопозиции, контакты, места, кубик и превью веб-страниц.
54
+ - Реакции на сообщения (👍, 🔥, ❤️) через меню действий.
55
+ - Бесконечная пагинация истории сообщений вверх (`PageUp` / `Ctrl+U`).
56
+ - Режимы ответа (`Ctrl+R`) и редактирования (`Ctrl+E`) с контекстной плашкой над
57
+ полем ввода.
58
+ - Модальные окна: справка (`F1` / `?`), сведения о чате (`Ctrl+P`), действия с
59
+ сообщением (`Ctrl+A`), отправка файла (`Ctrl+O`), обзор файлов (`Ctrl+F`) и
60
+ диалоги подтверждения.
61
+ - Слэш-команды в поле ввода: `/help`, `/info`, `/sendfile`, `/clear`, `/logout`.
62
+ - Скачивание входящих медиа через меню действий с сообщением.
63
+ - Три темы, выбираемые через `TUI_THEME`: `default` (тёмная), `nord`, `light`.
64
+ Все цвета заданы hex-значениями, которые сводятся к индексам xterm-256 ≥ 16 —
65
+ собственная палитра терминала не может их перекрасить.
66
+
67
+ **CLI**
68
+
69
+ - `tuigram init` — интерактивное и неинтерактивное (`--api-id`, `--api-hash`)
70
+ сохранение ключей Telegram API.
71
+ - `tuigram paths` — вывод путей конфигурации и данных вместе с текущим состоянием.
72
+ - `tuigram login` — визард авторизации с поддержкой 2FA.
73
+ - `tuigram dialogs [--limit N]` — список диалогов.
74
+ - `tuigram history <peer> [--limit N]` — история чата, где `<peer>` — это `@username`,
75
+ ID или `me` для «Избранного».
76
+ - `tuigram send <peer> <текст>` — отправка текстового сообщения.
77
+ - `tuigram sendfile <peer> <путь...> [--caption ...] [--as-file]` — отправка файлов;
78
+ до 10 путей уходят одним альбомом.
79
+ - `tuigram listen` — живой стрим обновлений MTProto.
80
+ - `./run.sh` — интерактивное меню-диспетчер для разработки.
81
+
82
+ **Конфигурация и хранение**
83
+
84
+ - Ключи и сессия хранятся в пользовательских директориях ОС, а не внутри пакета,
85
+ поэтому глобальная установка остаётся read-only и переживает `npm update`.
86
+ - Переопределение путей через `TUIGRAM_CONFIG_DIR` / `TUIGRAM_DATA_DIR`, с учётом
87
+ `XDG_CONFIG_HOME` и `XDG_DATA_HOME`.
88
+ - Приоритет настроек: окружение процесса → `.env` проекта (только клон репозитория)
89
+ → пользовательский `.env`.
90
+ - Автоматический перенос сессии из устаревшего расположения `<проект>/data/session.txt`.
91
+
92
+ **Безопасность**
93
+
94
+ - Файл сессии и файл настроек сохраняются с правами `0600`.
95
+ - `scripts/check-package.js` — предпубликационная проверка, которая падает, если в
96
+ npm-архив попадают `.env`, `data/`, строка сессии, логи или тесты; она же проверяет
97
+ shebang и флаг исполняемости у `bin/tuigram.js`.
98
+ - `/logout` отзывает ключ авторизации на сервере и удаляет локальный файл сессии.
99
+
100
+ **Тесты**
101
+
102
+ - Юнит-тесты (`npm test`) на форматирование времени, разбор пиров и типов сущностей,
103
+ рендеринг Telegram Entities, разбор аргументов слэш-команд, запись `.env` и валидацию
104
+ ключей, защиту от неинтерактивного логина и конфигурацию пакета.
105
+ - Тест контраста по WCAG (порог 3:1) для каждой темы — **после** конверсии в xterm-256,
106
+ то есть ровно в том виде, в каком цвет увидит пользователь.
107
+
108
+ [Unreleased]: https://github.com/emaxe/tuigram/compare/v1.0.1...HEAD
109
+ [1.0.1]: https://github.com/emaxe/tuigram/compare/v1.0.0...v1.0.1
110
+ [1.0.0]: https://github.com/emaxe/tuigram/releases/tag/v1.0.0