dsh-tg-bridge 1.54.0 → 1.55.0
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/docs/CHANGELOG.md +19 -0
- package/i18n/en/ctrl.mjs +1 -1
- package/i18n/ru/ctrl.mjs +1 -1
- package/i18n/zh/ctrl.mjs +1 -1
- package/package.json +1 -1
- package/turn/queue.mjs +4 -1
- package/work/jobs-cap.mjs +8 -4
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# CHANGELOG — DSH Telegram bridge
|
|
2
2
|
|
|
3
|
+
## 1.55.0
|
|
4
|
+
|
|
5
|
+
- **The parallel ceiling goes to twelve.** `/jobs` was closed at eight by two
|
|
6
|
+
separate rules — the card's range and the queue's clamp — so `config.maxParallel`
|
|
7
|
+
could not exceed it even when edited by hand. Both now stop at twelve, and the
|
|
8
|
+
card offers `1 2 3 4 6 8 10 12` so the ceiling is reachable by thumb. The clamp
|
|
9
|
+
in `turn/queue.mjs` matches `CAP_MAX`: a hand-edited `20` becomes twelve, not
|
|
10
|
+
twenty DSH processes.
|
|
11
|
+
- **The card says what twelve actually costs.** A parallel turn is a whole DSH
|
|
12
|
+
process of a few hundred megabytes, so the range text now calls twelve a
|
|
13
|
+
ceiling rather than a target and says which way it fails past the machine's
|
|
14
|
+
real capacity — everything gets slower, nothing gets faster. A refusal also
|
|
15
|
+
names the range (`1 to 12`) instead of clamping silently.
|
|
16
|
+
- **Four tests, one of them on the buttons.** Twelve is accepted and lands in
|
|
17
|
+
config; thirteen is refused and writes nothing; every offered button is inside
|
|
18
|
+
`1..12` and the card can actually reach the ceiling; the queue clamps a
|
|
19
|
+
hand-edited `20` to twelve, a `0` to one, and an unset cap to the old default
|
|
20
|
+
of three.
|
|
21
|
+
|
|
3
22
|
## 1.54.0
|
|
4
23
|
|
|
5
24
|
- **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
|
|
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 до
|
|
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 到
|
|
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
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(
|
|
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
|
|
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 =
|
|
16
|
+
export const CAP_MAX = 12;
|
|
13
17
|
|
|
14
|
-
/** The values the card offers.
|
|
15
|
-
export const CAP_CHOICES = [1, 2, 3, 4,
|
|
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
|