dsh-tg-bridge 1.7.4 → 1.7.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/bot-menu.mjs +3 -3
- package/control.mjs +22 -0
- package/i18n.mjs +3 -0
- package/package.json +1 -1
package/bot-menu.mjs
CHANGED
|
@@ -47,7 +47,7 @@ const COMMANDS = [
|
|
|
47
47
|
{ command: 'app', description: 'Приложение DSH, не мост: /app restart confirm' },
|
|
48
48
|
{ command: 'restart', description: 'Перезапуск моста: /restart confirm' },
|
|
49
49
|
{ command: 'doctor', description: 'Диагностика: мост, сеть, диск, плагины, сессия' },
|
|
50
|
-
{ command: 'logs', description: 'Лог: /logs, /logs 100, /logs errors, /logs
|
|
50
|
+
{ command: 'logs', description: 'Лог: /logs, /logs 100, /logs errors, /logs file' },
|
|
51
51
|
{ command: 'help', description: 'Все команды и подсказки' },
|
|
52
52
|
{ command: 'lang', description: 'Язык интерфейса: en, ru, zh' },
|
|
53
53
|
{ command: 'reasoning', description: 'Заметки по ходу: /reasoning on|off' },
|
|
@@ -77,7 +77,7 @@ const COMMANDS_EN = [
|
|
|
77
77
|
{ command: 'app', description: 'DSH desktop app (not the bridge)' },
|
|
78
78
|
{ command: 'restart', description: 'Restart the bridge: /restart confirm' },
|
|
79
79
|
{ command: 'doctor', description: 'Diagnostics: bridge, network, disk, plugins, session' },
|
|
80
|
-
{ command: 'logs', description: 'Log: /logs, /logs 100, /logs errors, /logs
|
|
80
|
+
{ command: 'logs', description: 'Log: /logs, /logs 100, /logs errors, /logs file' },
|
|
81
81
|
{ command: 'help', description: 'All commands and hints' },
|
|
82
82
|
{ command: 'lang', description: 'Interface language: en, ru, zh' },
|
|
83
83
|
{ command: 'reasoning', description: 'Working notes: /reasoning on|off' },
|
|
@@ -107,7 +107,7 @@ const COMMANDS_ZH = [
|
|
|
107
107
|
{ command: 'app', description: 'DSH 桌面应用(不是桥接)' },
|
|
108
108
|
{ command: 'restart', description: '重启桥接:/restart confirm' },
|
|
109
109
|
{ command: 'doctor', description: '诊断:桥接、网络、磁盘、插件、会话' },
|
|
110
|
-
{ command: 'logs', description: '日志:/logs、/logs 100、/logs errors、/logs
|
|
110
|
+
{ command: 'logs', description: '日志:/logs、/logs 100、/logs errors、/logs file' },
|
|
111
111
|
{ command: 'help', description: '全部命令与提示' },
|
|
112
112
|
{ command: 'lang', description: '界面语言:en、ru、zh' },
|
|
113
113
|
{ command: 'reasoning', description: '工作记录:/reasoning on|off' },
|
package/control.mjs
CHANGED
|
@@ -1230,6 +1230,15 @@ export async function handleControl(ctx) {
|
|
|
1230
1230
|
if (installed && latest && installed !== latest) lines.push(t(lang, 'ctrl.version.update', { v: latest }));
|
|
1231
1231
|
lines.push(t(lang, 'ctrl.version.root', { path: where }));
|
|
1232
1232
|
lines.push(t(lang, 'ctrl.version.hint'));
|
|
1233
|
+
// The number above comes from package.json on disk; the code actually
|
|
1234
|
+
// answering this came from the files as they were at process start. When
|
|
1235
|
+
// ./sync-runtime.mjs (or /update) has since replaced them, saying so
|
|
1236
|
+
// beats a version that reads as live while it is not.
|
|
1237
|
+
const started = Date.now() - process.uptime() * 1000;
|
|
1238
|
+
const newest = newestModuleMtime(where);
|
|
1239
|
+
if (newest && newest > started + 2000) {
|
|
1240
|
+
lines.push(t(lang, 'ctrl.version.stale', { when: stamp(newest) }));
|
|
1241
|
+
}
|
|
1233
1242
|
say(lines.join('\n'));
|
|
1234
1243
|
return true;
|
|
1235
1244
|
}
|
|
@@ -1317,6 +1326,19 @@ function bridgeVersion() {
|
|
|
1317
1326
|
}
|
|
1318
1327
|
}
|
|
1319
1328
|
|
|
1329
|
+
/** Newest mtime among the modules a bridge install is made of, or 0. */
|
|
1330
|
+
function newestModuleMtime(root) {
|
|
1331
|
+
let newest = 0;
|
|
1332
|
+
try {
|
|
1333
|
+
for (const name of readdirSync(root)) {
|
|
1334
|
+
if (!name.endsWith('.mjs')) continue;
|
|
1335
|
+
const at = statSync(join(root, name)).mtimeMs;
|
|
1336
|
+
if (at > newest) newest = at;
|
|
1337
|
+
}
|
|
1338
|
+
} catch {}
|
|
1339
|
+
return newest;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1320
1342
|
/** Latest published version of an npm package, or '' when npm is unreachable. */
|
|
1321
1343
|
function npmLatest(name) {
|
|
1322
1344
|
try {
|
package/i18n.mjs
CHANGED
|
@@ -136,6 +136,7 @@ const DICT = {
|
|
|
136
136
|
'ctrl.version.offline': 'unreachable',
|
|
137
137
|
'ctrl.version.update': 'Update available: /update, then /update confirm',
|
|
138
138
|
'ctrl.version.root': 'Bridge directory: {path}',
|
|
139
|
+
'ctrl.version.stale': 'Files are newer than this process ({when}) — /restart confirm loads them.',
|
|
139
140
|
'ctrl.version.hint': 'The new code loads after /restart confirm; the current chat keeps running until then.',
|
|
140
141
|
'ctrl.update.available': 'Version {from} is running, {to} is on npm.\nInstall it: /update confirm.\nEverything keeps working on the old code until /restart confirm.',
|
|
141
142
|
'ctrl.update.current': 'Already on {v} — the latest published version.',
|
|
@@ -408,6 +409,7 @@ const DICT = {
|
|
|
408
409
|
'ctrl.version.offline': 'недоступен',
|
|
409
410
|
'ctrl.version.update': 'Есть обновление: /update, затем /update confirm',
|
|
410
411
|
'ctrl.version.root': 'Каталог моста: {path}',
|
|
412
|
+
'ctrl.version.stale': 'Файлы новее запуска ({when}) — /restart confirm загрузит их.',
|
|
411
413
|
'ctrl.version.hint': 'Новый код включится после /restart confirm — до этого чат работает как есть.',
|
|
412
414
|
'ctrl.update.available': 'Работает {from}, на npm уже {to}.\nПоставить: /update confirm.\nДо /restart confirm всё работает на старом коде.',
|
|
413
415
|
'ctrl.update.current': 'Уже стоит {v} — это последняя опубликованная версия.',
|
|
@@ -680,6 +682,7 @@ const DICT = {
|
|
|
680
682
|
'ctrl.version.offline': '不可达',
|
|
681
683
|
'ctrl.version.update': '有更新:/update,然后 /update confirm',
|
|
682
684
|
'ctrl.version.root': '桥接目录:{path}',
|
|
685
|
+
'ctrl.version.stale': '文件比本进程更新({when})—— /restart confirm 后生效。',
|
|
683
686
|
'ctrl.version.hint': '新代码在 /restart confirm 之后生效;在此之前聊天照常运行。',
|
|
684
687
|
'ctrl.update.available': '当前 {from},npm 上已是 {to}。\n安装:/update confirm。\n在 /restart confirm 之前一切仍用旧代码。',
|
|
685
688
|
'ctrl.update.current': '已经是 {v} —— 最新发布版本。',
|
package/package.json
CHANGED