dsh-tg-bridge 1.19.4 → 1.19.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/README.md +1 -1
- package/bridge.mjs +4 -0
- package/control.mjs +3 -2
- package/i18n.mjs +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -370,7 +370,7 @@ so a chatty research topic and a terse deploy topic can differ.
|
|
|
370
370
|
|
|
371
371
|
The reasoning block itself is model output; `/thoughts` is what reads it back:
|
|
372
372
|
|
|
373
|
-
- `/thoughts` — the last turn as a message, in parts, deleted after
|
|
373
|
+
- `/thoughts` — the last turn as a message, in parts, deleted after three minutes;
|
|
374
374
|
- `/thoughts file` — the **whole** last turn as `reasoning-<date>-file.md`, sent as a document
|
|
375
375
|
(a five-hour turn is tens of thousands of characters, which no chat message can hold);
|
|
376
376
|
- `/thoughts all` — every turn of the session in one file (a long session is a couple of MB);
|
package/bridge.mjs
CHANGED
|
@@ -865,6 +865,10 @@ async function runCommandFromButton(typed, { chatId, threadId, key }) {
|
|
|
865
865
|
}),
|
|
866
866
|
api: tg,
|
|
867
867
|
sendFile: (p, caption = '') => sendFile(chatId, threadId, p, caption),
|
|
868
|
+
// A report meant to be read once (/thoughts) can ask for a message that
|
|
869
|
+
// removes itself. Without this the chat is told it will disappear while the
|
|
870
|
+
// message is a normal one — a promise nothing was keeping.
|
|
871
|
+
ephemeral: (out) => sendEphemeral(chatId, out, threadId),
|
|
868
872
|
seedTopic: ensureTopicSeed,
|
|
869
873
|
profile: profileOf(key),
|
|
870
874
|
reply: (out, extra = {}) => sendWithMarkup(chatId, threadId, out, extra),
|
package/control.mjs
CHANGED
|
@@ -2297,13 +2297,14 @@ export async function handleControl(ctx) {
|
|
|
2297
2297
|
}
|
|
2298
2298
|
}
|
|
2299
2299
|
|
|
2300
|
+
const brief = ctx.ephemeral || ((out) => say(out));
|
|
2300
2301
|
const text = file ? lastTurnReasoning(file, { maxChars: 20000 }) : '';
|
|
2301
2302
|
if (!text) {
|
|
2302
2303
|
// Not every turn plans: a one-word answer has no reasoning part at all.
|
|
2303
2304
|
// Saying "here is what the last turn answered" beats a dead end that
|
|
2304
2305
|
// looks like a broken command.
|
|
2305
2306
|
const answered = file ? lastTurnText(file, { maxChars: 1200 }) : '';
|
|
2306
|
-
|
|
2307
|
+
brief(answered
|
|
2307
2308
|
? `${t(lang, 'ctrl.thoughts.none')}\n\n${t(lang, 'ctrl.thoughts.lastAnswer')}\n\n${answered}\n\n${t(lang, 'ctrl.thoughts.hint')}`
|
|
2308
2309
|
: `${t(lang, 'ctrl.thoughts.none')}\n\n${t(lang, 'ctrl.thoughts.hint')}`);
|
|
2309
2310
|
return true;
|
|
@@ -2316,7 +2317,7 @@ export async function handleControl(ctx) {
|
|
|
2316
2317
|
parts.forEach((part, index) => {
|
|
2317
2318
|
const last = index === parts.length - 1;
|
|
2318
2319
|
const head = parts.length > 1 ? `${title} (${index + 1}/${parts.length})` : title;
|
|
2319
|
-
|
|
2320
|
+
brief(`${head}\n\n${part}${last ? `\n\n${t(lang, 'ctrl.thoughts.hint')}` : ''}`);
|
|
2320
2321
|
});
|
|
2321
2322
|
return true;
|
|
2322
2323
|
}
|
package/i18n.mjs
CHANGED
|
@@ -447,7 +447,7 @@ const DICT = {
|
|
|
447
447
|
'ctrl.logs.title': 'Log ({shown} of {total})',
|
|
448
448
|
'ctrl.logs.fileCaption': 'bridge.log, {mb} MB — the whole file',
|
|
449
449
|
'ctrl.logs.noFileChannel': 'This bridge build cannot send files; use /logs 200.',
|
|
450
|
-
'ctrl.thoughts.title': '🧠 Reasoning of the last turn ({chars} chars,
|
|
450
|
+
'ctrl.thoughts.title': '🧠 Reasoning of the last turn ({chars} chars, this message disappears in 3 minutes):',
|
|
451
451
|
'ctrl.thoughts.none': 'The last turn stored no reasoning plan.',
|
|
452
452
|
'ctrl.thoughts.lastAnswer': 'What the last turn answered:',
|
|
453
453
|
'ctrl.thoughts.noSession': 'This topic has no session yet: send a task first.',
|
|
@@ -1086,7 +1086,7 @@ const DICT = {
|
|
|
1086
1086
|
'ctrl.logs.title': 'Лог ({shown} из {total})',
|
|
1087
1087
|
'ctrl.logs.fileCaption': 'bridge.log, {mb} МБ — файл целиком',
|
|
1088
1088
|
'ctrl.logs.noFileChannel': 'Эта сборка моста не умеет отправлять файлы; используй /logs 200.',
|
|
1089
|
-
'ctrl.thoughts.title': '🧠 Рассуждения последнего хода ({chars} символов,
|
|
1089
|
+
'ctrl.thoughts.title': '🧠 Рассуждения последнего хода ({chars} символов, сообщение исчезнет через 3 минуты):',
|
|
1090
1090
|
'ctrl.thoughts.none': 'В последнем ходе не сохранилось плана рассуждений.',
|
|
1091
1091
|
'ctrl.thoughts.lastAnswer': 'Последний ход ответил так:',
|
|
1092
1092
|
'ctrl.thoughts.noSession': 'В этой теме ещё нет сессии: сначала отправь задачу.',
|
|
@@ -1725,7 +1725,7 @@ const DICT = {
|
|
|
1725
1725
|
'ctrl.logs.title': '日志({shown}/{total})',
|
|
1726
1726
|
'ctrl.logs.fileCaption': 'bridge.log,{mb} MB —— 完整文件',
|
|
1727
1727
|
'ctrl.logs.noFileChannel': '这个桥接版本无法发送文件;请用 /logs 200。',
|
|
1728
|
-
'ctrl.thoughts.title': '🧠 上一轮的推理({chars}
|
|
1728
|
+
'ctrl.thoughts.title': '🧠 上一轮的推理({chars} 字符,本消息 3 分钟后自动消失):',
|
|
1729
1729
|
'ctrl.thoughts.none': '上一轮没有保存推理过程。',
|
|
1730
1730
|
'ctrl.thoughts.lastAnswer': '上一轮的回答:',
|
|
1731
1731
|
'ctrl.thoughts.noSession': '本话题还没有会话:先发一个任务。',
|
package/package.json
CHANGED