dsh-telegram-multiagent 1.2.0 → 1.2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +6 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-telegram-multiagent",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Telegram channel for DeepSeek Harness — one shared module serving several agents, with unforgeable sender marks, merged owner+coordinator memory, and a delivery mode you switch in a file outside the code.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.js CHANGED
@@ -453,8 +453,12 @@ export function apply(ctx, config = {}) {
453
453
  const url = `https://api.telegram.org/file/bot${token}/${filePath}`;
454
454
  const ext = path.extname(filePath) || '.oga';
455
455
  const tmp = path.join(os.tmpdir(), `dsh-voice-${Date.now()}${ext}`);
456
- // curl доступен на хосте; fetch тоже можно, но curl проще для бинарника.
457
- execFileSync('curl', ['-s', '-o', tmp, url]);
456
+ // 🔴 Скачиваем ВСТРОЕННЫМ fetch, а не curl: адрес содержит токен бота, а
457
+ // строка запуска процесса (/proc/<pid>/cmdline) читается ЛЮБЫМ пользователем
458
+ // машины. Через curl токен утекал бы при КАЖДОМ голосовом сообщении.
459
+ const res = await fetch(url);
460
+ if (!res.ok) throw new Error(`telegram file download: HTTP ${res.status}`);
461
+ fs.writeFileSync(tmp, Buffer.from(await res.arrayBuffer()));
458
462
  return tmp;
459
463
  }
460
464