dsh-tg-bridge 1.54.0 → 1.55.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/chat/media.mjs CHANGED
@@ -294,7 +294,12 @@ export async function readVoiceIntoText(msg, chatId, threadId, lang) {
294
294
  return { text: '', fatal };
295
295
  }
296
296
  log(`voice -> text len=${heard.length}${error ? ` (warn: ${error})` : ''}`);
297
- const preview = heard.length > 1200 ? `${heard.slice(0, 1200)}…` : heard;
297
+ // The echo is what the person reads back, and a cut here looked like the
298
+ // recogniser stopping mid-word: a minute of dense dictation is 2000-2400
299
+ // characters, and the old 1200 cap chopped it in half. Telegram allows 4096
300
+ // per message, so the cap sits just under that; only a note longer than the
301
+ // platform's own voice limit can still reach the ellipsis.
302
+ const preview = heard.length > 3600 ? `${heard.slice(0, 3600)}…` : heard;
298
303
  if (statusId || config.voice?.echo !== false) await editOrSend(`🎤 ${preview}`, `🎤 ${preview}`);
299
304
  return { text: heard, fatal: false };
300
305
  }
package/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # CHANGELOG — DSH Telegram bridge
2
2
 
3
+ ## 1.55.1
4
+
5
+ - **A voice note is echoed whole.** The transcript always reached the model in
6
+ full, but the chat echo stopped at 1200 characters. A minute of dense dictation
7
+ runs to 2000–2400 characters, so the visible transcript was cut in the middle of
8
+ a word — which reads as the recogniser giving up rather than the bridge showing
9
+ less than it heard. The echo now allows 3600, just under Telegram's 4096 limit,
10
+ so only a note longer than the platform's own voice limit can reach the ellipsis.
11
+ - **Nothing else moved.** The prompt still carries the full transcript and the
12
+ engine is untouched; the number shown to the person is the only change.
13
+
14
+ ## 1.55.0
15
+
16
+ - **The parallel ceiling goes to twelve.** `/jobs` was closed at eight by two
17
+ separate rules — the card's range and the queue's clamp — so `config.maxParallel`
18
+ could not exceed it even when edited by hand. Both now stop at twelve, and the
19
+ card offers `1 2 3 4 6 8 10 12` so the ceiling is reachable by thumb. The clamp
20
+ in `turn/queue.mjs` matches `CAP_MAX`: a hand-edited `20` becomes twelve, not
21
+ twenty DSH processes.
22
+ - **The card says what twelve actually costs.** A parallel turn is a whole DSH
23
+ process of a few hundred megabytes, so the range text now calls twelve a
24
+ ceiling rather than a target and says which way it fails past the machine's
25
+ real capacity — everything gets slower, nothing gets faster. A refusal also
26
+ names the range (`1 to 12`) instead of clamping silently.
27
+ - **Four tests, one of them on the buttons.** Twelve is accepted and lands in
28
+ config; thirteen is refused and writes nothing; every offered button is inside
29
+ `1..12` and the card can actually reach the ceiling; the queue clamps a
30
+ hand-edited `20` to twelve, a `0` to one, and an unset cap to the old default
31
+ of three.
32
+
3
33
  ## 1.54.0
4
34
 
5
35
  - **A set can carry the topic's own rules.** `/crew instructions AGENTS.game.md`
package/i18n/en/ctrl.mjs CHANGED
@@ -410,7 +410,7 @@ export default {
410
410
  'ctrl.jobs.cap': 'Parallel turns at once: {n}. Tap a number below, or send /jobs 5.',
411
411
  'ctrl.jobs.capSet': 'Parallel turns at once: {n}. Saved to config.json — it applies to the next turn that starts, no restart needed.',
412
412
  'ctrl.jobs.capUnsaved': 'Parallel turns at once: {n} for this process only — config.json could not be written, so a restart goes back to the old value. Check /logs.',
413
- 'ctrl.jobs.capRange': 'A number from 1 to 8. Each parallel turn is a full DSH process, so more than 8 on one machine makes every turn slower, not faster.',
413
+ 'ctrl.jobs.capRange': 'A number from 1 to 12. Each parallel turn is a full DSH process taking a few hundred megabytes, so 12 is a ceiling, not a target: past what the machine holds, every turn gets slower instead of faster.',
414
414
  'ctrl.remind.title': '⏰ Reminders',
415
415
  'ctrl.remind.empty': 'Nothing scheduled.',
416
416
  'ctrl.remind.line': '{n}. {when} ({left}) — {text}',
package/i18n/ru/ctrl.mjs CHANGED
@@ -410,7 +410,7 @@ export default {
410
410
  'ctrl.jobs.cap': 'Одновременных ходов: {n}. Нажми число ниже или отправь /jobs 5.',
411
411
  'ctrl.jobs.capSet': 'Одновременных ходов: {n}. Записано в config.json — применится к следующему начатому ходу, перезапуск не нужен.',
412
412
  'ctrl.jobs.capUnsaved': 'Одновременных ходов: {n} только для этого процесса — config.json не записался, после перезапуска вернётся старое значение. Посмотри /logs.',
413
- 'ctrl.jobs.capRange': 'Число от 1 до 8. Каждый параллельный ход — отдельный процесс DSH, поэтому больше 8 на одной машине замедляет все ходы, а не ускоряет.',
413
+ 'ctrl.jobs.capRange': 'Число от 1 до 12. Каждый параллельный ход — отдельный процесс DSH на несколько сотен мегабайт, поэтому 12 — это потолок, а не норма: сверх того, что держит машина, все ходы замедляются, а не ускоряются.',
414
414
  'ctrl.remind.title': '⏰ Напоминания',
415
415
  'ctrl.remind.empty': 'Ничего не запланировано.',
416
416
  'ctrl.remind.line': '{n}. {when} ({left}) — {text}',
package/i18n/zh/ctrl.mjs CHANGED
@@ -410,7 +410,7 @@ export default {
410
410
  'ctrl.jobs.cap': '同时运行的轮次:{n}。点下面的数字,或发送 /jobs 5。',
411
411
  'ctrl.jobs.capSet': '同时运行的轮次:{n}。已写入 config.json——下一轮开始时生效,无需重启。',
412
412
  'ctrl.jobs.capUnsaved': '同时运行的轮次:{n},仅本进程有效——config.json 未能写入,重启后会回到旧值。请看 /logs。',
413
- 'ctrl.jobs.capRange': '数字范围 1 到 8。每个并行轮次都是一个完整的 DSH 进程,所以同一台机器上超过 8 会让所有轮次变慢,而不是变快。',
413
+ 'ctrl.jobs.capRange': '数字范围 1 到 12。每个并行轮次都是一个完整的 DSH 进程,占用数百 MB,所以 12 是上限而不是常态:超过机器能承受的数量,所有轮次只会变慢。',
414
414
  'ctrl.remind.title': '⏰ 提醒',
415
415
  'ctrl.remind.empty': '没有安排。',
416
416
  'ctrl.remind.line': '{n}. {when}({left})— {text}',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-tg-bridge",
3
- "version": "1.54.0",
3
+ "version": "1.55.1",
4
4
  "description": "Drive DeepSeek Harness from Telegram: one project, model and session per forum topic",
5
5
  "type": "module",
6
6
  "main": "plugin-bridge.mjs",
package/turn/queue.mjs CHANGED
@@ -37,11 +37,14 @@ export const MAX_PARALLEL = 3;
37
37
  * three long turns in flight a fourth topic waited with no message at all, so a
38
38
  * prompt in a fresh topic looked exactly like a dead bot. The number is a
39
39
  * setting now, and waiting for a slot is announced (see `enqueue`).
40
+ *
41
+ * The clamp matches `CAP_MAX` in `work/jobs-cap.mjs`; a value above it is a
42
+ * hand-edited config, not something the chat can write.
40
43
  */
41
44
  export function maxParallel() {
42
45
  const raw = Number(config?.maxParallel);
43
46
  if (!Number.isFinite(raw)) return MAX_PARALLEL;
44
- return Math.min(8, Math.max(1, Math.round(raw)));
47
+ return Math.min(12, Math.max(1, Math.round(raw)));
45
48
  }
46
49
 
47
50
  export function acquire() {
package/work/jobs-cap.mjs CHANGED
@@ -3,16 +3,20 @@
3
3
  // `/jobs 5` and the buttons under the `/jobs` card write the same number, and a
4
4
  // tap must not be able to store a value the command would refuse. The ceiling is
5
5
  // a real machine limit — every parallel turn is a whole DSH process — so the
6
- // range is closed at eight and the refusal says why instead of clamping.
6
+ // range stops at twelve and the refusal says why instead of clamping.
7
+ //
8
+ // Twelve is a ceiling, not a target: a turn costs a few hundred megabytes, so on
9
+ // a 16 GB machine half a dozen heavy turns is already the comfortable number and
10
+ // the rest wait for a slot (announced, see `enqueue`). The card says so.
7
11
  //
8
12
  // The live config changes first and is persisted second: a failed write costs
9
13
  // the setting after a restart, not the setting now, and the caller reports which
10
14
  // of the two happened rather than claiming a save it did not make.
11
15
  export const CAP_MIN = 1;
12
- export const CAP_MAX = 8;
16
+ export const CAP_MAX = 12;
13
17
 
14
- /** The values the card offers. Five rows of buttons is already a lot of thumb. */
15
- export const CAP_CHOICES = [1, 2, 3, 4, 5, 8];
18
+ /** The values the card offers. Twelve is reachable without a wall of buttons. */
19
+ export const CAP_CHOICES = [1, 2, 3, 4, 6, 8, 10, 12];
16
20
 
17
21
  /**
18
22
  * Apply a ceiling. Returns `{ ok:false }` for anything outside the range, and