acpgram 1.19.3 → 1.19.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,9 +7,12 @@
7
7
 
8
8
  # AcpGram
9
9
 
10
+ [![CI](https://github.com/selesnow/acpgram/actions/workflows/ci.yml/badge.svg)](https://github.com/selesnow/acpgram/actions/workflows/ci.yml)
10
11
  [![npm version](https://img.shields.io/npm/v/acpgram.svg)](https://www.npmjs.com/package/acpgram)
11
12
  [![Node.js](https://img.shields.io/badge/node-%3E%3D22.13.0-brightgreen.svg)](https://nodejs.org)
12
13
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
14
+ [![CodeQL](https://github.com/selesnow/acpgram/actions/workflows/codeql.yml/badge.svg)](https://github.com/selesnow/acpgram/actions/workflows/codeql.yml)
15
+ [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/selesnow/acpgram/badge)](https://scorecard.dev/viewer/?uri=github.com/selesnow/acpgram)
13
16
 
14
17
  **English** · [Русский](README.ru.md) · [Website](https://alexey-seleznev.pro/acpgram/)
15
18
 
@@ -19,7 +22,7 @@ A Telegram gateway to AI coding agents — **Gemini CLI**, **Claude Code**, **An
19
22
  - Windows, Linux and macOS. Tested on Windows Server and Linux (Ubuntu in WSL); macOS uses the same code as Linux.
20
23
  - Multi-user: the main admin invites teammates and controls what each of them can do.
21
24
 
22
- > The bot's interface is currently in Russian.
25
+ > The bot's default language is English. It also speaks Russian and Ukrainian: each user gets the language of their Telegram app (`ru`, `uk` or `en`), and `/language` changes it.
23
26
 
24
27
  ## Features
25
28
 
package/README.ru.md CHANGED
@@ -7,9 +7,12 @@
7
7
 
8
8
  # AcpGram
9
9
 
10
+ [![CI](https://github.com/selesnow/acpgram/actions/workflows/ci.yml/badge.svg)](https://github.com/selesnow/acpgram/actions/workflows/ci.yml)
10
11
  [![npm version](https://img.shields.io/npm/v/acpgram.svg)](https://www.npmjs.com/package/acpgram)
11
12
  [![Node.js](https://img.shields.io/badge/node-%3E%3D22.13.0-brightgreen.svg)](https://nodejs.org)
12
13
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
14
+ [![CodeQL](https://github.com/selesnow/acpgram/actions/workflows/codeql.yml/badge.svg)](https://github.com/selesnow/acpgram/actions/workflows/codeql.yml)
15
+ [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/selesnow/acpgram/badge)](https://scorecard.dev/viewer/?uri=github.com/selesnow/acpgram)
13
16
 
14
17
  [English](README.md) · **Русский** · [Сайт](https://alexey-seleznev.pro/acpgram/)
15
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acpgram",
3
- "version": "1.19.3",
3
+ "version": "1.19.5",
4
4
  "type": "module",
5
5
  "description": "Telegram gateway to AI coding agents (Gemini CLI, Claude Code, Antigravity CLI, Codex) over the Agent Client Protocol",
6
6
  "license": "MIT",
package/src/cli.mjs CHANGED
@@ -54,7 +54,9 @@ export function updateCommand(platform = process.platform, env = process.env) {
54
54
  if (platform !== 'win32') return ['sh', ['-c', `f="$(mktemp)" && curl -fsSL ${base}/install.sh -o "$f" && bash "$f"; r=$?; rm -f "$f"; exit $r`]];
55
55
  // Windows PowerShell — по полному пути: папки WindowsPowerShell может не быть в PATH, а терминал при этом открыт
56
56
  // из меню «Пуск» и работает (так было на ноутбуке: `acpgram update` молча завершался с кодом 1)
57
- const root = env.SystemRoot || env.SYSTEMROOT || env.windir || 'C:\\Windows';
57
+ // путь из окружения попадает в командную строку (в том числе через cmd.exe): допускаем только обычный путь диска
58
+ // без кавычек, &, |, ^, % и других служебных символов, иначе — стандартный C:\Windows
59
+ const root = [env.SystemRoot, env.SYSTEMROOT, env.windir].find((r) => r && /^[A-Za-z]:\\[\w .()\\-]*$/.test(r)) || 'C:\\Windows';
58
60
  const ps = win32.join(root, 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe');
59
61
  return [existsSync(ps) ? ps : 'powershell', ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-Command', `irm ${base}/install.ps1 | iex`]];
60
62
  }
package/src/setup.mjs CHANGED
@@ -81,10 +81,14 @@ export const envBackupPath = (dataDir = DATA_DIR) => join(dataDir, '.env.bak');
81
81
  export function writeEnvFile(values, path = ENV_PATH, backup = envBackupPath()) {
82
82
  const text = serializeEnv(values); // сначала проверяем, что всё записывается, — до изменения файлов
83
83
  mkdirSync(dirname(path), { recursive: true }); // при установке через npm каталога (~/.acpgram) ещё нет
84
- if (existsSync(path)) {
84
+ // без проверки existsSync перед копированием: между проверкой и копированием файл мог измениться (гонка);
85
+ // если прежнего .env нет — copyFileSync сообщает ENOENT, и это не ошибка
86
+ try {
85
87
  mkdirSync(dirname(backup), { recursive: true });
86
88
  copyFileSync(path, backup);
87
89
  chmodSync(backup, 0o600);
90
+ } catch (e) {
91
+ if (e.code !== 'ENOENT') throw e;
88
92
  }
89
93
  writeFileSync(path, text, { encoding: 'utf8', mode: 0o600 });
90
94
  chmodSync(path, 0o600);