dsh-tg-bridge 1.44.0 → 1.45.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/bridge-kick.mjs +32 -3
- package/bridge.mjs +5 -0
- package/control/cmd-bridge.mjs +5 -0
- package/control/cmd-views.mjs +1 -1
- package/control/doctor-rows.mjs +58 -0
- package/control/model-card.mjs +2 -2
- package/control/models.mjs +1 -1
- package/core/state.mjs +9 -2
- package/docs/CHANGELOG.md +26 -0
- package/i18n/en/every.mjs +1 -1
- package/i18n/en/supervision.mjs +13 -0
- package/i18n/en.mjs +2 -1
- package/i18n/ru/every.mjs +1 -1
- package/i18n/ru/supervision.mjs +13 -0
- package/i18n/ru.mjs +2 -1
- package/i18n/zh/every.mjs +1 -1
- package/i18n/zh/supervision.mjs +12 -0
- package/i18n/zh.mjs +2 -1
- package/package.json +1 -1
- package/turn/progress.mjs +4 -1
package/bridge-kick.mjs
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
// Exit codes: 0 = nothing to do or started, 2 = start failed.
|
|
17
17
|
|
|
18
18
|
import { spawn, spawnSync } from 'node:child_process';
|
|
19
|
-
import { appendFileSync, existsSync, readFileSync, openSync, closeSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
19
|
+
import { appendFileSync, existsSync, readFileSync, openSync, closeSync, statSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
20
20
|
import { homedir } from 'node:os';
|
|
21
21
|
import { join } from 'node:path';
|
|
22
22
|
|
|
@@ -43,6 +43,8 @@ const CRASH_STARTS = 2;
|
|
|
43
43
|
// LOCK_MAX_AGE_MS here so even a genuinely wedged holder cannot wedge the guard.
|
|
44
44
|
const LOCK = join(DIR, 'restart.lock');
|
|
45
45
|
const LOCK_MAX_AGE_MS = 180_000;
|
|
46
|
+
// A restart marker older than this is a leftover, not a restart in progress.
|
|
47
|
+
const MARKER_MAX_AGE_MS = 600_000;
|
|
46
48
|
|
|
47
49
|
function acquireLock(owner) {
|
|
48
50
|
for (let attempt = 0; attempt < 2; attempt += 1) {
|
|
@@ -88,6 +90,32 @@ function log(line) {
|
|
|
88
90
|
} catch {}
|
|
89
91
|
}
|
|
90
92
|
|
|
93
|
+
/**
|
|
94
|
+
* Forget a restart marker that outlived its restart.
|
|
95
|
+
*
|
|
96
|
+
* The bridge reads the marker on start to tell other topics their turn was cut,
|
|
97
|
+
* then clears it. If it is still there with a live bridge, the process that
|
|
98
|
+
* should have cleared it did not run — and every later start would read this
|
|
99
|
+
* stale marker as "the previous process died mid-turn". Ten minutes is well past
|
|
100
|
+
* any start, so the marker is a leftover, not news.
|
|
101
|
+
*/
|
|
102
|
+
function clearStaleMarker(marker) {
|
|
103
|
+
let age = Number.POSITIVE_INFINITY;
|
|
104
|
+
try {
|
|
105
|
+
age = Date.now() - statSync(marker).mtimeMs;
|
|
106
|
+
} catch {}
|
|
107
|
+
if (age < MARKER_MAX_AGE_MS) {
|
|
108
|
+
log('marker present and bridge alive, restart still in progress');
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
unlinkSync(marker);
|
|
113
|
+
log(`cleared stale restart marker (${Math.round(age / 1000)}s old, bridge alive)`);
|
|
114
|
+
} catch (error) {
|
|
115
|
+
log(`could not clear the restart marker: ${String(error?.message ?? error).slice(0, 120)}`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
91
119
|
function pidFromFile() {
|
|
92
120
|
try {
|
|
93
121
|
const pid = Number(readFileSync(PID_FILE, 'utf8').trim());
|
|
@@ -193,7 +221,8 @@ async function main() {
|
|
|
193
221
|
if (!acquireLock('kick')) {
|
|
194
222
|
log('restart in progress (setup holds the lock), skipping this tick');
|
|
195
223
|
return 0;
|
|
196
|
-
}
|
|
224
|
+
}
|
|
225
|
+
if (!existsSync(BRIDGE)) {
|
|
197
226
|
log('bridge.mjs missing');
|
|
198
227
|
return 2;
|
|
199
228
|
}
|
|
@@ -206,7 +235,7 @@ async function main() {
|
|
|
206
235
|
// Cheap path first: a live pid file is authoritative for a healthy bridge, so
|
|
207
236
|
// the minute tick costs one kill(0) instead of a PowerShell process scan.
|
|
208
237
|
if (filePid && alive(filePid)) {
|
|
209
|
-
if (restartPending)
|
|
238
|
+
if (restartPending) clearStaleMarker(marker);
|
|
210
239
|
// A live bridge proves the release can start: forget the crash history.
|
|
211
240
|
writeStarts([]);
|
|
212
241
|
return 0;
|
package/bridge.mjs
CHANGED
|
@@ -111,7 +111,12 @@ process.on('uncaughtException', (error) => {
|
|
|
111
111
|
process.exit(1);
|
|
112
112
|
});
|
|
113
113
|
process.on('unhandledRejection', (reason) => {
|
|
114
|
+
// Logging alone left the process running in a state nobody had designed: the
|
|
115
|
+
// turn that rejected is gone, the loop keeps polling, and the next /doctor
|
|
116
|
+
// shows a healthy bridge. Exit instead — the minute tick starts a clean one,
|
|
117
|
+
// and the interruption notice tells the topics what happened.
|
|
114
118
|
log(`FATAL unhandled rejection: ${reason && reason.stack ? reason.stack : reason}`);
|
|
119
|
+
process.exit(1);
|
|
115
120
|
});
|
|
116
121
|
process.on('exit', (code) => {
|
|
117
122
|
log(`bridge exiting code=${code}`);
|
package/control/cmd-bridge.mjs
CHANGED
|
@@ -15,6 +15,7 @@ import { setRowConfig, unsetRowConfig } from '../profile/profile-edit.mjs';
|
|
|
15
15
|
import { parseReminder, stampAt, upcoming } from '../work/reminders.mjs';
|
|
16
16
|
import { AgentsetStore, emptySet, slugId } from '../profile/agentsets.mjs';
|
|
17
17
|
import { SETTINGS_PAGES, renderSettingsCard, settingsCurrent } from '../profile/settings-card.mjs';
|
|
18
|
+
import { supervisionRows } from './doctor-rows.mjs';
|
|
18
19
|
import { applyFork, planFork, planRewind } from '../work/rewind.mjs';
|
|
19
20
|
import { cutSession, isRewindPress } from '../work/rewind-buttons.mjs';
|
|
20
21
|
import { renderRewindCard, renderRewindUsage } from '../work/rewind-card.mjs';
|
|
@@ -246,6 +247,10 @@ export async function handleBridgeCommands(ctx) {
|
|
|
246
247
|
add(t(lang, 'ctrl.doctor.logLines'), String(lines.length - start));
|
|
247
248
|
} catch {}
|
|
248
249
|
|
|
250
|
+
// Is anything still watching? A dead supervisor looks exactly like an idle
|
|
251
|
+
// bot until the next crash, which then becomes permanent.
|
|
252
|
+
rows.push(...supervisionRows(lang, DSH_HOME));
|
|
253
|
+
|
|
249
254
|
// Disk space: the silent killer of model downloads and OCR. This used to
|
|
250
255
|
// shell out to `powershell (Get-PSDrive C)`, so on macOS and Linux the row
|
|
251
256
|
// simply vanished — a diagnostic that is silent on the platform you are
|
package/control/cmd-views.mjs
CHANGED
|
@@ -116,7 +116,7 @@ export async function handleViewCommands(ctx) {
|
|
|
116
116
|
lines.push(t(lang, 'ctrl.status.skills', { n: skillsOf().length }));
|
|
117
117
|
// This line used to print the desktop profile's route and bundle count.
|
|
118
118
|
// Both facts were true and both were about the install, printed inside a
|
|
119
|
-
// card about one topic: the card said "Профиль: headless (
|
|
119
|
+
// card about one topic: the card said "Профиль: headless (acme/...)"
|
|
120
120
|
// four lines up and then named a wikivibe desktop route, which reads as if
|
|
121
121
|
// the topic answered there. Nothing about the desktop app belongs in a
|
|
122
122
|
// per-topic card; the count is the one this topic's own profile has.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// The two /doctor rows that answer "is anything still watching?".
|
|
2
|
+
//
|
|
3
|
+
// The bridge cannot report its own death, and it cannot report that the minute
|
|
4
|
+
// supervisor stopped either: a dead supervisor looks exactly like a healthy
|
|
5
|
+
// idle bot until the next crash, which then becomes permanent. These rows are
|
|
6
|
+
// read from files on disk (the restart marker and the supervisor's log), so they
|
|
7
|
+
// stay honest even when the process asking is the one that was just restarted.
|
|
8
|
+
//
|
|
9
|
+
// Kept out of `cmd-bridge.mjs`, which is already close to the 500-line ceiling.
|
|
10
|
+
import { existsSync, statSync } from 'node:fs';
|
|
11
|
+
import { join } from 'node:path';
|
|
12
|
+
import { t } from '../core/i18n.mjs';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* An age short enough for a diagnostic row: `0s`, `45s`, `12m`, `5h`, `3d`.
|
|
16
|
+
*
|
|
17
|
+
* Deliberately unit-suffixed ASCII rather than a sentence: the row is read in
|
|
18
|
+
* three languages, and "12m" survives all of them where a translated word would
|
|
19
|
+
* need three more keys for no extra meaning.
|
|
20
|
+
*/
|
|
21
|
+
export function describeAge(ms) {
|
|
22
|
+
const secs = Math.max(0, Math.round(Number(ms) / 1000) || 0);
|
|
23
|
+
if (secs < 90) return `${secs}s`;
|
|
24
|
+
const mins = Math.round(secs / 60);
|
|
25
|
+
// Rounding 50 minutes up to "1h" would overstate the age of a supervisor that
|
|
26
|
+
// is merely a little behind; the unit changes only when the value does.
|
|
27
|
+
if (mins < 60) return `${mins}m`;
|
|
28
|
+
const hours = Math.round(mins / 60);
|
|
29
|
+
if (hours < 36) return `${hours}h`;
|
|
30
|
+
return `${Math.round(hours / 24)}d`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The supervision rows, in the order a person would ask about them. */
|
|
34
|
+
export function supervisionRows(lang, dshHome) {
|
|
35
|
+
const dir = join(dshHome, 'tg-bridge');
|
|
36
|
+
const rows = [];
|
|
37
|
+
|
|
38
|
+
// A marker that outlives its restart means the next start will announce an
|
|
39
|
+
// interrupted turn that is not news. The kick clears it after ten minutes;
|
|
40
|
+
// seeing one older than that here means the supervisor is not running.
|
|
41
|
+
try {
|
|
42
|
+
const marker = join(dir, 'restart.pending');
|
|
43
|
+
rows.push(`${t(lang, 'ctrl.doctor.restartMarker')}: ${existsSync(marker)
|
|
44
|
+
? t(lang, 'ctrl.doctor.restartMarkerSet', { age: describeAge(Date.now() - statSync(marker).mtimeMs) })
|
|
45
|
+
: t(lang, 'ctrl.doctor.restartMarkerClear')}`);
|
|
46
|
+
} catch {}
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
const kick = join(dir, 'kick.log');
|
|
50
|
+
rows.push(`${t(lang, 'ctrl.doctor.kickAge')}: ${t(lang, 'ctrl.doctor.kickAgo', {
|
|
51
|
+
age: describeAge(Date.now() - statSync(kick).mtimeMs),
|
|
52
|
+
})}`);
|
|
53
|
+
} catch {
|
|
54
|
+
rows.push(`${t(lang, 'ctrl.doctor.kickAge')}: ${t(lang, 'ctrl.doctor.kickMissing')}`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return rows;
|
|
58
|
+
}
|
package/control/model-card.mjs
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
// The flat list this replaces was one tap shorter and two problems worse. A
|
|
4
4
|
// profile with seventeen routes does not fit on a phone, and two endpoints that
|
|
5
5
|
// both serve `deepseek-v4.1-flash` made two buttons with the same name — the
|
|
6
|
-
// person looking for "the
|
|
6
|
+
// person looking for "the acme one" had nothing to tell them apart, and
|
|
7
7
|
// `/model deepseek-v4.1-flash` silently kept whichever provider the patch
|
|
8
8
|
// already had. A model and the endpoint that serves it are one choice, so the
|
|
9
9
|
// choice is made in two steps and the second screen cannot repeat the first.
|
|
10
10
|
//
|
|
11
|
-
// A press names its subject in full (`md:!p:
|
|
11
|
+
// A press names its subject in full (`md:!p:acme`, `md:acme:model`),
|
|
12
12
|
// never an index: an index would mean "the fourth model" and would switch to the
|
|
13
13
|
// wrong route the moment the profile gained or lost one between drawing the card
|
|
14
14
|
// and the tap. Telegram caps callback data at 64 bytes, so a name too long to
|
package/control/models.mjs
CHANGED
|
@@ -62,7 +62,7 @@ export function modelOf(profile) {
|
|
|
62
62
|
*
|
|
63
63
|
* `modelsOf` answers "which model ids exist", and that is the wrong question to
|
|
64
64
|
* put on a screen: the same id is declared by several providers — `deepseek-v4.1-flash`
|
|
65
|
-
* exists on wikivibe and on
|
|
65
|
+
* exists on wikivibe and on acme — so a list of ids shows the same name
|
|
66
66
|
* twice and neither row says where the answers would come from. Picking a model
|
|
67
67
|
* and picking a route is one decision, so the list is made of routes.
|
|
68
68
|
*
|
package/core/state.mjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// message was mid-flight: `offset` advanced before the turn ran, so nothing ever
|
|
6
6
|
// replayed it. An update is written here BEFORE the offset moves and deleted
|
|
7
7
|
// only after the answer reached Telegram — the one order that survives a crash.
|
|
8
|
-
import { appendFileSync, existsSync, mkdirSync, openSync, fsyncSync, closeSync, readFileSync, readdirSync, renameSync, statSync, unlinkSync, writeFileSync as writeFd } from 'node:fs';
|
|
8
|
+
import { appendFileSync, existsSync, mkdirSync, openSync, fsyncSync, closeSync, copyFileSync, readFileSync, readdirSync, renameSync, statSync, unlinkSync, writeFileSync as writeFd } from 'node:fs';
|
|
9
9
|
import { join, isAbsolute } from 'node:path';
|
|
10
10
|
import { DONE_FILE, DONE_TTL_MS, DIR, HOME, LOG, PENDING_DIR, STATE } from './paths.mjs';
|
|
11
11
|
|
|
@@ -29,7 +29,14 @@ export const state = (() => {
|
|
|
29
29
|
try {
|
|
30
30
|
// Strip a UTF-8 BOM: PowerShell's Set-Content adds one and JSON.parse rejects it.
|
|
31
31
|
return JSON.parse(readFileSync(STATE, 'utf8').replace(/^\uFEFF/, ''));
|
|
32
|
-
} catch {
|
|
32
|
+
} catch (error) {
|
|
33
|
+
// Unreadable state used to become an empty one in silence: goals, schedules
|
|
34
|
+
// and sessions were gone and the only trace was that they stopped working.
|
|
35
|
+
// Keep the file that caused it, say why, and start empty.
|
|
36
|
+
try {
|
|
37
|
+
if (!existsSync(`${STATE}.bad`)) copyFileSync(STATE, `${STATE}.bad`);
|
|
38
|
+
} catch {}
|
|
39
|
+
log(`state unreadable: ${String(error?.message ?? error).slice(0, 160)} — kept as state.json.bad, starting empty`);
|
|
33
40
|
return { offset: 0, sessions: {} };
|
|
34
41
|
}
|
|
35
42
|
})();
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# CHANGELOG — DSH Telegram bridge
|
|
2
2
|
|
|
3
|
+
## 1.45.0
|
|
4
|
+
|
|
5
|
+
- **A restart marker no longer outlives its restart.** The minute supervisor
|
|
6
|
+
clears `restart.pending` when the bridge is alive and the marker is more than
|
|
7
|
+
ten minutes old. Left behind, it made a much later start announce an interrupted
|
|
8
|
+
turn that had ended weeks earlier.
|
|
9
|
+
- **`/doctor` says whether anything is still watching.** Two new rows: the restart
|
|
10
|
+
marker with its age, and how long ago the supervisor last ticked. A supervisor
|
|
11
|
+
that stopped is invisible otherwise — the bot looks idle until the next crash,
|
|
12
|
+
which then becomes permanent.
|
|
13
|
+
- **A corrupt `state.json` is kept, not silently dropped.** Goals, schedules and
|
|
14
|
+
sessions used to vanish with no trace; the file is now copied to
|
|
15
|
+
`state.json.bad`, the parse error goes to the log, and the bridge starts empty.
|
|
16
|
+
The limit: only the first corrupt copy is kept, so a second corruption is
|
|
17
|
+
logged but not saved.
|
|
18
|
+
- **An unhandled rejection ends the bridge instead of being logged.** It used to
|
|
19
|
+
keep running in a state nobody designed for, with `/doctor` reporting a healthy
|
|
20
|
+
process. The tick starts a clean one; a running turn is announced as
|
|
21
|
+
interrupted, as with any restart.
|
|
22
|
+
- **`/every` help states its limit** in all three languages: a schedule fires only
|
|
23
|
+
while the bridge runs, and a missed time fires once on the next start, not once
|
|
24
|
+
per missed day.
|
|
25
|
+
- **No provider name in the public tree.** The routing service this bridge was
|
|
26
|
+
developed against was named in 81 places — comments, fixtures, specs. Replaced
|
|
27
|
+
with a deliberately fake name; the pre-release scan is clean again.
|
|
28
|
+
|
|
3
29
|
## 1.44.0
|
|
4
30
|
|
|
5
31
|
- **Change a file from the chat: `/edit`.** `/edit app.mjs:12` shows line 12 and
|
package/i18n/en/every.mjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// agree in three languages. It also keeps `ctrl.mjs` under the 500-line
|
|
6
6
|
// ceiling, which adding thirteen strings to it would have broken.
|
|
7
7
|
export default {
|
|
8
|
-
'ctrl.help.about.every': 'One repeating schedule: /every 09:00 text runs that text as a normal turn every day at that time. /every list shows this chat\'s schedules, /every rm 2 removes one.',
|
|
8
|
+
'ctrl.help.about.every': 'One repeating schedule: /every 09:00 text runs that text as a normal turn every day at that time. /every list shows this chat\'s schedules, /every rm 2 removes one. It fires only while the bridge is running; a time that passed while it was down fires once on the next start, not once per missed day.',
|
|
9
9
|
'ctrl.every.usage': 'Usage: /every 09:00 text — repeats every day at that time · /every list · /every rm 1.',
|
|
10
10
|
'ctrl.every.title': '🔁 Every day',
|
|
11
11
|
'ctrl.every.empty': 'No schedules in this chat yet.',
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// The `/doctor` rows that answer "is anything still watching?".
|
|
2
|
+
//
|
|
3
|
+
// Its own table because `ctrl.mjs` sits at the 500-line ceiling and these six
|
|
4
|
+
// keys belong to one row group: the restart marker and the age of the last
|
|
5
|
+
// supervisor tick. Age is formatted elsewhere and only interpolated here.
|
|
6
|
+
export default {
|
|
7
|
+
'ctrl.doctor.restartMarker': 'Restart marker',
|
|
8
|
+
'ctrl.doctor.restartMarkerSet': 'set {age} ago',
|
|
9
|
+
'ctrl.doctor.restartMarkerClear': 'none',
|
|
10
|
+
'ctrl.doctor.kickAge': 'Supervisor',
|
|
11
|
+
'ctrl.doctor.kickAgo': 'last tick {age} ago',
|
|
12
|
+
'ctrl.doctor.kickMissing': 'no tick yet',
|
|
13
|
+
};
|
package/i18n/en.mjs
CHANGED
|
@@ -13,4 +13,5 @@ import model from './en/model.mjs';
|
|
|
13
13
|
import endpoint from './en/endpoint.mjs';
|
|
14
14
|
import every from './en/every.mjs';
|
|
15
15
|
import dsh from './en/dsh.mjs';
|
|
16
|
-
|
|
16
|
+
import supervision from './en/supervision.mjs';
|
|
17
|
+
export default { ...core, ...ctrl, ...cost, ...sandbox, ...fallback, ...release, ...diff, ...model, ...endpoint, ...every, ...dsh, ...supervision };
|
package/i18n/ru/every.mjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// трёх языках. Заодно `ctrl.mjs` остаётся под потолком в 500 строк, который
|
|
6
6
|
// тринадцать новых строк бы пробили.
|
|
7
7
|
export default {
|
|
8
|
-
'ctrl.help.about.every': 'Одно повторяющееся расписание: /every 09:00 текст каждый день в это время запускает текст как обычный ход. /every list показывает расписания этого чата, /every rm 2 убирает одно.',
|
|
8
|
+
'ctrl.help.about.every': 'Одно повторяющееся расписание: /every 09:00 текст каждый день в это время запускает текст как обычный ход. /every list показывает расписания этого чата, /every rm 2 убирает одно. Срабатывает, только пока мост запущен; время, пропущенное при выключенном мосте, сработает один раз при следующем запуске, а не по разу за каждый пропущенный день.',
|
|
9
9
|
'ctrl.every.usage': 'Как пользоваться: /every 09:00 текст — повтор каждый день в это время · /every list · /every rm 1.',
|
|
10
10
|
'ctrl.every.title': '🔁 Каждый день',
|
|
11
11
|
'ctrl.every.empty': 'В этом чате пока нет расписаний.',
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Строки `/doctor`, отвечающие на вопрос «за процессом ещё кто-то смотрит?».
|
|
2
|
+
//
|
|
3
|
+
// Отдельная таблица, потому что `ctrl.mjs` стоит у потолка в 500 строк, а эти
|
|
4
|
+
// шесть ключей — одна группа строк: метка рестарта и возраст последнего тика
|
|
5
|
+
// супервизора. Возраст считается в коде и здесь только подставляется.
|
|
6
|
+
export default {
|
|
7
|
+
'ctrl.doctor.restartMarker': 'Метка рестарта',
|
|
8
|
+
'ctrl.doctor.restartMarkerSet': 'висит {age}',
|
|
9
|
+
'ctrl.doctor.restartMarkerClear': 'нет',
|
|
10
|
+
'ctrl.doctor.kickAge': 'Супервизор',
|
|
11
|
+
'ctrl.doctor.kickAgo': 'последний тик {age} назад',
|
|
12
|
+
'ctrl.doctor.kickMissing': 'тиков ещё не было',
|
|
13
|
+
};
|
package/i18n/ru.mjs
CHANGED
|
@@ -13,4 +13,5 @@ import model from './ru/model.mjs';
|
|
|
13
13
|
import endpoint from './ru/endpoint.mjs';
|
|
14
14
|
import every from './ru/every.mjs';
|
|
15
15
|
import dsh from './ru/dsh.mjs';
|
|
16
|
-
|
|
16
|
+
import supervision from './ru/supervision.mjs';
|
|
17
|
+
export default { ...core, ...ctrl, ...cost, ...sandbox, ...fallback, ...release, ...diff, ...model, ...endpoint, ...every, ...dsh, ...supervision };
|
package/i18n/zh/every.mjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// (四个动词和五种拒绝),它的句子要在三种语言里保持一致。这也让 `ctrl.mjs`
|
|
5
5
|
// 保持在 500 行上限之下 —— 再加十三行就会超过。
|
|
6
6
|
export default {
|
|
7
|
-
'ctrl.help.about.every': '一个重复的定时任务:/every 09:00 文本 每天这个时间把文本当成普通轮次执行。/every list 显示这个聊天里的定时任务,/every rm 2
|
|
7
|
+
'ctrl.help.about.every': '一个重复的定时任务:/every 09:00 文本 每天这个时间把文本当成普通轮次执行。/every list 显示这个聊天里的定时任务,/every rm 2 删除一个。只在桥接运行时触发;停机期间错过的时间会在下次启动时补触发一次,而不是每错过一天补一次。',
|
|
8
8
|
'ctrl.every.usage': '用法:/every 09:00 文本 —— 每天这个时间重复 · /every list · /every rm 1。',
|
|
9
9
|
'ctrl.every.title': '🔁 每天',
|
|
10
10
|
'ctrl.every.empty': '这个聊天还没有定时任务。',
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// `/doctor` 里回答「还有没有东西在看守」的那两行。
|
|
2
|
+
//
|
|
3
|
+
// 单独一张表,因为 `ctrl.mjs` 已经贴着 500 行上限,而这六个键属于同一组行:
|
|
4
|
+
// 重启标记和上次守护检查的时间。时间在代码里算好,这里只做插值。
|
|
5
|
+
export default {
|
|
6
|
+
'ctrl.doctor.restartMarker': '重启标记',
|
|
7
|
+
'ctrl.doctor.restartMarkerSet': '{age} 前留下',
|
|
8
|
+
'ctrl.doctor.restartMarkerClear': '无',
|
|
9
|
+
'ctrl.doctor.kickAge': '守护进程',
|
|
10
|
+
'ctrl.doctor.kickAgo': '上次检查 {age} 前',
|
|
11
|
+
'ctrl.doctor.kickMissing': '还没有检查记录',
|
|
12
|
+
};
|
package/i18n/zh.mjs
CHANGED
|
@@ -13,4 +13,5 @@ import model from './zh/model.mjs';
|
|
|
13
13
|
import endpoint from './zh/endpoint.mjs';
|
|
14
14
|
import every from './zh/every.mjs';
|
|
15
15
|
import dsh from './zh/dsh.mjs';
|
|
16
|
-
|
|
16
|
+
import supervision from './zh/supervision.mjs';
|
|
17
|
+
export default { ...core, ...ctrl, ...cost, ...sandbox, ...fallback, ...release, ...diff, ...model, ...endpoint, ...every, ...dsh, ...supervision };
|
package/package.json
CHANGED
package/turn/progress.mjs
CHANGED
|
@@ -291,7 +291,10 @@ export async function startProgress(chatId, threadId, lang = config.lang || 'en'
|
|
|
291
291
|
lastView = view ? view.html : text;
|
|
292
292
|
lastEdit = Date.now();
|
|
293
293
|
} catch (error) {
|
|
294
|
-
// "message is not modified" and rate limits are expected
|
|
294
|
+
// "message is not modified" and rate limits are expected, so the edit is
|
|
295
|
+
// skipped — but a silent catch is how a panel that never updates hides for
|
|
296
|
+
// weeks. One line names the reason; the turn itself is never failed by it.
|
|
297
|
+
log(`panel edit skipped [${error?.error_code || error?.code || 'error'}]`);
|
|
295
298
|
dirty = false;
|
|
296
299
|
}
|
|
297
300
|
};
|