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 +4 -1
- package/README.ru.md +3 -0
- package/package.json +1 -1
- package/src/cli.mjs +3 -1
- package/src/setup.mjs +5 -1
package/README.md
CHANGED
|
@@ -7,9 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
# AcpGram
|
|
9
9
|
|
|
10
|
+
[](https://github.com/selesnow/acpgram/actions/workflows/ci.yml)
|
|
10
11
|
[](https://www.npmjs.com/package/acpgram)
|
|
11
12
|
[](https://nodejs.org)
|
|
12
13
|
[](LICENSE)
|
|
14
|
+
[](https://github.com/selesnow/acpgram/actions/workflows/codeql.yml)
|
|
15
|
+
[](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
|
|
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
|
+
[](https://github.com/selesnow/acpgram/actions/workflows/ci.yml)
|
|
10
11
|
[](https://www.npmjs.com/package/acpgram)
|
|
11
12
|
[](https://nodejs.org)
|
|
12
13
|
[](LICENSE)
|
|
14
|
+
[](https://github.com/selesnow/acpgram/actions/workflows/codeql.yml)
|
|
15
|
+
[](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
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
|
-
|
|
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
|
-
|
|
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);
|