@llblab/pi-telegram 0.45.11 → 0.47.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/BACKLOG.md +5 -1
- package/CHANGELOG.md +12 -0
- package/README.md +6 -6
- package/dist/api/activity.d.ts +6 -0
- package/dist/api/activity.js +6 -0
- package/dist/api/commands.d.ts +6 -0
- package/dist/api/commands.js +6 -0
- package/dist/api/delivery.d.ts +6 -0
- package/dist/api/delivery.js +6 -0
- package/dist/api/inbound.d.ts +6 -0
- package/dist/api/inbound.js +6 -0
- package/dist/api/keyboard.d.ts +6 -0
- package/dist/api/keyboard.js +6 -0
- package/dist/api/outbound.d.ts +6 -0
- package/dist/api/outbound.js +6 -0
- package/dist/api/sections.d.ts +7 -0
- package/dist/api/sections.js +6 -0
- package/dist/api/status.d.ts +6 -0
- package/dist/api/status.js +6 -0
- package/dist/api/updates.d.ts +6 -0
- package/dist/api/updates.js +6 -0
- package/dist/api/voice.d.ts +6 -0
- package/dist/api/voice.js +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/lib/activity-verbosity.d.ts +52 -0
- package/dist/lib/activity-verbosity.js +596 -0
- package/dist/lib/activity.d.ts +220 -0
- package/dist/lib/activity.js +574 -0
- package/dist/lib/agent-messages.d.ts +28 -0
- package/dist/lib/agent-messages.js +86 -0
- package/dist/lib/bindings.d.ts +250 -0
- package/dist/lib/bindings.js +936 -0
- package/dist/lib/bus-api.d.ts +18 -0
- package/dist/lib/bus-api.js +254 -0
- package/dist/lib/bus-follower.d.ts +464 -0
- package/dist/lib/bus-follower.js +1686 -0
- package/dist/lib/bus-leader.d.ts +292 -0
- package/dist/lib/bus-leader.js +2242 -0
- package/dist/lib/bus-transport.d.ts +64 -0
- package/dist/lib/bus-transport.js +140 -0
- package/dist/lib/bus.d.ts +518 -0
- package/dist/lib/bus.js +2055 -0
- package/dist/lib/channel-posts.d.ts +170 -0
- package/dist/lib/channel-posts.js +611 -0
- package/dist/lib/command-templates.d.ts +70 -0
- package/dist/lib/command-templates.js +744 -0
- package/dist/lib/commands.d.ts +541 -0
- package/dist/lib/commands.js +1155 -0
- package/dist/lib/config.d.ts +252 -0
- package/dist/lib/config.js +889 -0
- package/dist/lib/delivery.d.ts +163 -0
- package/dist/lib/delivery.js +542 -0
- package/dist/lib/extension.d.ts +7 -0
- package/dist/lib/extension.js +1608 -0
- package/dist/lib/generative-app-worker.mjs +104 -0
- package/dist/lib/generative-apps.d.ts +212 -0
- package/dist/lib/generative-apps.js +1006 -0
- package/dist/lib/inbound.d.ts +91 -0
- package/dist/lib/inbound.js +502 -0
- package/dist/lib/journal.d.ts +665 -0
- package/dist/lib/journal.js +3701 -0
- package/dist/lib/keyboard.d.ts +23 -0
- package/dist/lib/keyboard.js +37 -0
- package/dist/lib/lifecycle.d.ts +157 -0
- package/dist/lib/lifecycle.js +395 -0
- package/dist/lib/locks.d.ts +164 -0
- package/dist/lib/locks.js +1208 -0
- package/dist/lib/logging.d.ts +50 -0
- package/dist/lib/logging.js +274 -0
- package/dist/lib/media.d.ts +181 -0
- package/dist/lib/media.js +602 -0
- package/dist/lib/menu-model.d.ts +217 -0
- package/dist/lib/menu-model.js +663 -0
- package/dist/lib/menu-queue.d.ts +37 -0
- package/dist/lib/menu-queue.js +408 -0
- package/dist/lib/menu-settings.d.ts +116 -0
- package/dist/lib/menu-settings.js +595 -0
- package/dist/lib/menu-status.d.ts +32 -0
- package/dist/lib/menu-status.js +112 -0
- package/dist/lib/menu-thinking.d.ts +29 -0
- package/dist/lib/menu-thinking.js +82 -0
- package/dist/lib/menu.d.ts +171 -0
- package/dist/lib/menu.js +323 -0
- package/dist/lib/model.d.ts +127 -0
- package/dist/lib/model.js +409 -0
- package/dist/lib/outbound-attachments.d.ts +241 -0
- package/dist/lib/outbound-attachments.js +639 -0
- package/dist/lib/outbound-buttons.d.ts +69 -0
- package/dist/lib/outbound-buttons.js +248 -0
- package/dist/lib/outbound-markup.d.ts +42 -0
- package/dist/lib/outbound-markup.js +678 -0
- package/dist/lib/outbound-voice.d.ts +55 -0
- package/dist/lib/outbound-voice.js +152 -0
- package/dist/lib/outbound.d.ts +185 -0
- package/dist/lib/outbound.js +516 -0
- package/dist/lib/ownership.d.ts +77 -0
- package/dist/lib/ownership.js +174 -0
- package/dist/lib/paths.d.ts +40 -0
- package/dist/lib/paths.js +94 -0
- package/dist/lib/pi.d.ts +72 -0
- package/dist/lib/pi.js +121 -0
- package/dist/lib/polling.d.ts +351 -0
- package/dist/lib/polling.js +1196 -0
- package/dist/lib/preview.d.ts +192 -0
- package/dist/lib/preview.js +614 -0
- package/dist/lib/prompt-templates.d.ts +24 -0
- package/dist/lib/prompt-templates.js +118 -0
- package/dist/lib/prompts.d.ts +57 -0
- package/dist/lib/prompts.js +167 -0
- package/dist/lib/queue.d.ts +766 -0
- package/dist/lib/queue.js +1965 -0
- package/dist/lib/recovery.d.ts +86 -0
- package/dist/lib/recovery.js +285 -0
- package/dist/lib/rendering.d.ts +20 -0
- package/dist/lib/rendering.js +983 -0
- package/dist/lib/replies.d.ts +214 -0
- package/dist/lib/replies.js +737 -0
- package/dist/lib/routing.d.ts +207 -0
- package/dist/lib/routing.js +2282 -0
- package/dist/lib/runtime.d.ts +172 -0
- package/dist/lib/runtime.js +402 -0
- package/dist/lib/sections.d.ts +165 -0
- package/dist/lib/sections.js +327 -0
- package/dist/lib/setup.d.ts +82 -0
- package/dist/lib/setup.js +150 -0
- package/dist/lib/skills.d.ts +8 -0
- package/dist/lib/skills.js +12 -0
- package/dist/lib/status.d.ts +442 -0
- package/dist/lib/status.js +1006 -0
- package/dist/lib/sync.d.ts +179 -0
- package/dist/lib/sync.js +782 -0
- package/dist/lib/target.d.ts +20 -0
- package/dist/lib/target.js +27 -0
- package/dist/lib/telegram-api.d.ts +541 -0
- package/dist/lib/telegram-api.js +1159 -0
- package/dist/lib/text-groups.d.ts +89 -0
- package/dist/lib/text-groups.js +317 -0
- package/dist/lib/thread-cleanup-manager.d.ts +288 -0
- package/dist/lib/thread-cleanup-manager.js +560 -0
- package/dist/lib/thread-display.d.ts +46 -0
- package/dist/lib/thread-display.js +257 -0
- package/dist/lib/thread-naming.d.ts +46 -0
- package/dist/lib/thread-naming.js +78 -0
- package/dist/lib/thread-reconciler.d.ts +239 -0
- package/dist/lib/thread-reconciler.js +644 -0
- package/dist/lib/threads.d.ts +621 -0
- package/dist/lib/threads.js +3679 -0
- package/dist/lib/time-injection.d.ts +15 -0
- package/dist/lib/time-injection.js +56 -0
- package/dist/lib/turns.d.ts +109 -0
- package/dist/lib/turns.js +500 -0
- package/dist/lib/updates.d.ts +1290 -0
- package/dist/lib/updates.js +3634 -0
- package/dist/lib/voice.d.ts +117 -0
- package/dist/lib/voice.js +174 -0
- package/dist/lib/workspace-admission.d.ts +264 -0
- package/dist/lib/workspace-admission.js +1136 -0
- package/dist/lib/workspace-retirement.d.ts +219 -0
- package/dist/lib/workspace-retirement.js +587 -0
- package/dist/lib/workspace-slots.d.ts +30 -0
- package/dist/lib/workspace-slots.js +54 -0
- package/dist/package.json +126 -0
- package/dist/pi-telegram/index.js +1 -0
- package/dist/skills/generated-control-surface/SKILL.md +107 -0
- package/dist/skills/generated-control-surface/references/capability-adapters.md +27 -0
- package/dist/skills/generated-control-surface/references/layout-and-state.md +37 -0
- package/dist/skills/generative-apps/SKILL.md +115 -0
- package/dist/skills/show-me/SKILL.md +166 -0
- package/dist/skills/show-me/references/telegram-surfaces.md +43 -0
- package/dist/skills/telegram-bridge/SKILL.md +129 -0
- package/dist/skills/telegram-bridge/references/configuration.md +15 -0
- package/dist/skills/telegram-bridge/references/delivery-and-threads.md +27 -0
- package/dist/skills/telegram-bridge/references/diagnosis.md +18 -0
- package/docs/architecture.md +1 -1
- package/docs/compact-matrix-literal.md +10 -3
- package/docs/generative-apps.md +15 -13
- package/docs/multi-instance-bus.md +17 -3
- package/docs/outbound.md +1 -1
- package/docs/public-api.md +2 -2
- package/lib/bindings.ts +89 -6
- package/lib/bus-follower.ts +11 -3
- package/lib/bus-leader.ts +57 -20
- package/lib/bus.ts +12 -2
- package/lib/commands.ts +2 -2
- package/lib/config.ts +14 -7
- package/lib/delivery.ts +38 -6
- package/lib/extension.ts +26 -1
- package/lib/generative-apps.ts +379 -13
- package/lib/menu-settings.ts +21 -5
- package/lib/outbound-markup.ts +16 -7
- package/lib/pi.ts +4 -0
- package/lib/sync.ts +3 -0
- package/lib/telegram-api.ts +12 -1
- package/lib/thread-cleanup-manager.ts +36 -6
- package/lib/thread-display.ts +96 -18
- package/lib/threads.ts +150 -30
- package/package.json +56 -13
- package/scripts/build-dist.mjs +44 -0
- package/scripts/measure-bus.mjs +8 -1
- package/scripts/measure-workspace.mjs +8 -1
- package/skills/generative-apps/SKILL.md +1 -1
- package/skills/show-me/SKILL.md +1 -1
- package/skills/telegram-bridge/SKILL.md +1 -1
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telegram queue menu UI helpers
|
|
3
|
+
* Zones: telegram ui, queue controls, menu composition
|
|
4
|
+
* Owns queue-menu rendering, queue item callbacks, and queue-menu runtime adapters while core queue mechanics stay in queue
|
|
5
|
+
*/
|
|
6
|
+
// --- Queue Menu ---
|
|
7
|
+
const QUEUE_ITEM_PROMPT_HTML_LIMIT = 3600;
|
|
8
|
+
const QUEUE_ITEM_PROMPT_TRUNCATION_SUFFIX = "\n… [truncated]";
|
|
9
|
+
const EMPTY_QUEUE_REFRESH_TITLES = [
|
|
10
|
+
"<b>⌛ Queue is still empty</b>",
|
|
11
|
+
"<b>🫙 Still nothing in queue</b>",
|
|
12
|
+
"<b>🍃 Queue remains empty</b>",
|
|
13
|
+
"<b>🕳 Nothing queued yet</b>",
|
|
14
|
+
"<b>🦗 Queue crickets continue</b>",
|
|
15
|
+
"<b>🌙 Queue is peacefully idle</b>",
|
|
16
|
+
"<b>🧘 Nothing waiting. Very zen</b>",
|
|
17
|
+
"<b>🪐 Queue orbit is clear</b>",
|
|
18
|
+
"<b>🧺 Basket is empty</b>",
|
|
19
|
+
"<b>🔭 No prompts on the horizon</b>",
|
|
20
|
+
"<b>🫧 Queue bubbles: none</b>",
|
|
21
|
+
"<b>🛸 No queued signals detected</b>",
|
|
22
|
+
];
|
|
23
|
+
function getTelegramQueueItemPromptText(item) {
|
|
24
|
+
if (item.kind !== "prompt")
|
|
25
|
+
return item.statusSummary;
|
|
26
|
+
return (item.content
|
|
27
|
+
.filter((block) => block.type === "text")
|
|
28
|
+
.map((block) => block.text)
|
|
29
|
+
.join("\n")
|
|
30
|
+
.trim() || item.statusSummary);
|
|
31
|
+
}
|
|
32
|
+
function toTelegramQueueMenuItems(items) {
|
|
33
|
+
return items.map((item, index) => {
|
|
34
|
+
return {
|
|
35
|
+
chatId: item.chatId,
|
|
36
|
+
replyToMessageId: item.replyToMessageId,
|
|
37
|
+
queuePosition: index + 1,
|
|
38
|
+
isPriority: item.queueLane === "priority",
|
|
39
|
+
priorityEmoji: item.kind === "prompt" ? item.priorityEmoji : undefined,
|
|
40
|
+
reactionSuppressionEmoji: item.kind === "prompt" ? item.reactionSuppressionEmoji : undefined,
|
|
41
|
+
hasAttachments: item.kind === "prompt" && item.queuedAttachments.length > 0,
|
|
42
|
+
statusSummary: item.statusSummary,
|
|
43
|
+
promptText: getTelegramQueueItemPromptText(item),
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function formatSkippedTelegramQueuePosition(position) {
|
|
48
|
+
return Array.from(String(position), (char) => `${char}\u0335`).join("");
|
|
49
|
+
}
|
|
50
|
+
function buildTelegramQueueMenuReplyMarkup(items, emptyRefreshIndex = 0) {
|
|
51
|
+
const backRow = [{ text: "⬆️ Main menu", callback_data: "menu:back" }];
|
|
52
|
+
const nextEmptyRefreshIndex = (emptyRefreshIndex + 1) % EMPTY_QUEUE_REFRESH_TITLES.length;
|
|
53
|
+
const refreshData = items.length === 0
|
|
54
|
+
? `queue:refresh:${nextEmptyRefreshIndex}`
|
|
55
|
+
: "queue:refresh";
|
|
56
|
+
const refreshRow = [{ text: "🔄 Refresh", callback_data: refreshData }];
|
|
57
|
+
if (items.length === 0)
|
|
58
|
+
return { inline_keyboard: [backRow, refreshRow] };
|
|
59
|
+
const rows = items.map((item) => {
|
|
60
|
+
const prefix = item.reactionSuppressionEmoji
|
|
61
|
+
? `${item.reactionSuppressionEmoji} `
|
|
62
|
+
: item.isPriority
|
|
63
|
+
? `${item.priorityEmoji ?? "⚡"} `
|
|
64
|
+
: item.hasAttachments
|
|
65
|
+
? "📎 "
|
|
66
|
+
: "";
|
|
67
|
+
const position = item.reactionSuppressionEmoji
|
|
68
|
+
? formatSkippedTelegramQueuePosition(item.queuePosition)
|
|
69
|
+
: String(item.queuePosition);
|
|
70
|
+
const ordinalSeparator = item.reactionSuppressionEmoji ? "\u200A" : "";
|
|
71
|
+
const label = `${position}${ordinalSeparator}. ${prefix}${item.statusSummary}`;
|
|
72
|
+
return [
|
|
73
|
+
{
|
|
74
|
+
text: label,
|
|
75
|
+
callback_data: `queue:pick:${item.chatId}:${item.replyToMessageId}`,
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
});
|
|
79
|
+
return { inline_keyboard: [backRow, refreshRow, ...rows] };
|
|
80
|
+
}
|
|
81
|
+
function findTelegramQueueItem(items, chatId, replyToMessageId) {
|
|
82
|
+
return items.find((item) => {
|
|
83
|
+
return item.chatId === chatId && item.replyToMessageId === replyToMessageId;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function findTelegramQueueMenuItem(items, chatId, replyToMessageId) {
|
|
87
|
+
return items.find((item) => {
|
|
88
|
+
return item.chatId === chatId && item.replyToMessageId === replyToMessageId;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function escapeTelegramQueueMenuHtmlChar(char) {
|
|
92
|
+
if (char === "&")
|
|
93
|
+
return "&";
|
|
94
|
+
if (char === "<")
|
|
95
|
+
return "<";
|
|
96
|
+
if (char === ">")
|
|
97
|
+
return ">";
|
|
98
|
+
return char;
|
|
99
|
+
}
|
|
100
|
+
function escapeTelegramQueueMenuHtml(text) {
|
|
101
|
+
return Array.from(text).map(escapeTelegramQueueMenuHtmlChar).join("");
|
|
102
|
+
}
|
|
103
|
+
function escapeTelegramQueueMenuHtmlPreview(text) {
|
|
104
|
+
const suffix = escapeTelegramQueueMenuHtml(QUEUE_ITEM_PROMPT_TRUNCATION_SUFFIX);
|
|
105
|
+
let escaped = "";
|
|
106
|
+
let truncated = false;
|
|
107
|
+
for (const char of text) {
|
|
108
|
+
const next = escapeTelegramQueueMenuHtmlChar(char);
|
|
109
|
+
if (escaped.length + next.length + suffix.length >
|
|
110
|
+
QUEUE_ITEM_PROMPT_HTML_LIMIT) {
|
|
111
|
+
truncated = true;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
escaped += next;
|
|
115
|
+
}
|
|
116
|
+
return truncated ? escaped + suffix : escaped;
|
|
117
|
+
}
|
|
118
|
+
function getTelegramQueueMenuItemText(item) {
|
|
119
|
+
const badge = item.reactionSuppressionEmoji
|
|
120
|
+
? ` ${item.reactionSuppressionEmoji}`
|
|
121
|
+
: item.isPriority
|
|
122
|
+
? ` ${item.priorityEmoji ?? "⚡"}`
|
|
123
|
+
: "";
|
|
124
|
+
const position = item.reactionSuppressionEmoji
|
|
125
|
+
? `<s>${item.queuePosition}</s>.`
|
|
126
|
+
: `<b>${item.queuePosition}.</b>`;
|
|
127
|
+
const heading = `${position}${badge}`;
|
|
128
|
+
const preview = `<pre>${escapeTelegramQueueMenuHtmlPreview(item.promptText)}</pre>`;
|
|
129
|
+
return `${heading}\n${preview}`;
|
|
130
|
+
}
|
|
131
|
+
function buildTelegramQueueItemSubmenuReplyMarkup(chatId, replyToMessageId, isPriority, isSkipped) {
|
|
132
|
+
return {
|
|
133
|
+
inline_keyboard: [
|
|
134
|
+
[{ text: "⬆️ Back", callback_data: "queue:list" }],
|
|
135
|
+
[
|
|
136
|
+
{
|
|
137
|
+
text: isPriority ? "🟡 Priority" : "⚫️ Priority",
|
|
138
|
+
callback_data: `queue:prio-set:${chatId}:${replyToMessageId}:priority`,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
text: isPriority ? "⚫️ Normal" : "🔵 Normal",
|
|
142
|
+
callback_data: `queue:prio-set:${chatId}:${replyToMessageId}:normal`,
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
[
|
|
146
|
+
{
|
|
147
|
+
text: isSkipped ? "⚫️ Keep" : "🟢 Keep",
|
|
148
|
+
callback_data: `queue:skip-set:${chatId}:${replyToMessageId}:keep`,
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
text: isSkipped ? "🔴 Skip" : "⚫️ Skip",
|
|
152
|
+
callback_data: `queue:skip-set:${chatId}:${replyToMessageId}:skip`,
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
],
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
async function handleTelegramQueueMenuCallback(callbackQueryId, data, replyChatId, replyMessageId, ctx, deps) {
|
|
159
|
+
if (!data.startsWith("queue:"))
|
|
160
|
+
return false;
|
|
161
|
+
if (data === "queue:noop") {
|
|
162
|
+
await deps.answerCallbackQuery(callbackQueryId);
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
165
|
+
if (data === "queue:list") {
|
|
166
|
+
await updateTelegramQueueMenuList(callbackQueryId, replyChatId, replyMessageId, deps);
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
const refreshMatch = data.match(/^queue:refresh(?::(\d+))?$/);
|
|
170
|
+
if (refreshMatch) {
|
|
171
|
+
await updateTelegramQueueMenuList(callbackQueryId, replyChatId, replyMessageId, deps, undefined, refreshMatch[1] === undefined ? 0 : Number(refreshMatch[1]));
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
const pickMatch = data.match(/^queue:pick:(\d+):(\d+)$/);
|
|
175
|
+
if (pickMatch) {
|
|
176
|
+
await handleTelegramQueueMenuPick(callbackQueryId, replyChatId, replyMessageId, Number(pickMatch[1]), Number(pickMatch[2]), deps);
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
const prioSetMatch = data.match(/^queue:prio-set:(\d+):(\d+):(priority|normal)$/);
|
|
180
|
+
if (prioSetMatch) {
|
|
181
|
+
await handleTelegramQueueMenuPrioritySet(callbackQueryId, replyChatId, replyMessageId, Number(prioSetMatch[1]), Number(prioSetMatch[2]), prioSetMatch[3] === "priority", ctx, deps);
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
const prioMatch = data.match(/^queue:prio:(\d+):(\d+)$/);
|
|
185
|
+
if (prioMatch) {
|
|
186
|
+
await handleTelegramQueueMenuPriority(callbackQueryId, replyChatId, replyMessageId, Number(prioMatch[1]), Number(prioMatch[2]), ctx, deps);
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
const skipSetMatch = data.match(/^queue:skip-set:(\d+):(\d+):(skip|keep)$/);
|
|
190
|
+
if (skipSetMatch) {
|
|
191
|
+
await handleTelegramQueueMenuSkipSet(callbackQueryId, replyChatId, replyMessageId, Number(skipSetMatch[1]), Number(skipSetMatch[2]), skipSetMatch[3] === "skip", ctx, deps);
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
function getTelegramQueueMenuListText(items, emptyRefreshIndex) {
|
|
197
|
+
if (items.length > 0)
|
|
198
|
+
return "<b>⏳ Queue:</b>";
|
|
199
|
+
if (emptyRefreshIndex === undefined)
|
|
200
|
+
return "<b>⌛ Queue is empty</b>";
|
|
201
|
+
return EMPTY_QUEUE_REFRESH_TITLES[emptyRefreshIndex % EMPTY_QUEUE_REFRESH_TITLES.length];
|
|
202
|
+
}
|
|
203
|
+
async function updateTelegramQueueMenuList(callbackQueryId, replyChatId, replyMessageId, deps, notice, emptyRefreshIndex) {
|
|
204
|
+
const items = deps.getQueuedItems();
|
|
205
|
+
await deps.updateQueueMessage(replyChatId, replyMessageId, getTelegramQueueMenuListText(items, emptyRefreshIndex), buildTelegramQueueMenuReplyMarkup(items, emptyRefreshIndex));
|
|
206
|
+
await deps.answerCallbackQuery(callbackQueryId, notice);
|
|
207
|
+
}
|
|
208
|
+
async function refreshStaleTelegramQueueMenuItem(callbackQueryId, replyChatId, replyMessageId, deps) {
|
|
209
|
+
await updateTelegramQueueMenuList(callbackQueryId, replyChatId, replyMessageId, deps, "Item no longer in queue.");
|
|
210
|
+
}
|
|
211
|
+
async function handleTelegramQueueMenuPick(callbackQueryId, replyChatId, replyMessageId, chatId, msgId, deps) {
|
|
212
|
+
const item = deps.findItem(chatId, msgId);
|
|
213
|
+
if (!item) {
|
|
214
|
+
return refreshStaleTelegramQueueMenuItem(callbackQueryId, replyChatId, replyMessageId, deps);
|
|
215
|
+
}
|
|
216
|
+
await deps.updateQueueMessage(replyChatId, replyMessageId, getTelegramQueueMenuItemText(item), buildTelegramQueueItemSubmenuReplyMarkup(chatId, msgId, item.isPriority, item.reactionSuppressionEmoji !== undefined));
|
|
217
|
+
await deps.answerCallbackQuery(callbackQueryId);
|
|
218
|
+
}
|
|
219
|
+
async function handleTelegramQueueMenuPriority(callbackQueryId, replyChatId, replyMessageId, chatId, msgId, ctx, deps) {
|
|
220
|
+
const item = deps.findItem(chatId, msgId);
|
|
221
|
+
if (!item) {
|
|
222
|
+
return refreshStaleTelegramQueueMenuItem(callbackQueryId, replyChatId, replyMessageId, deps);
|
|
223
|
+
}
|
|
224
|
+
await updateTelegramQueueMenuPriority(callbackQueryId, replyChatId, replyMessageId, chatId, msgId, !item.isPriority, ctx, deps);
|
|
225
|
+
}
|
|
226
|
+
async function handleTelegramQueueMenuPrioritySet(callbackQueryId, replyChatId, replyMessageId, chatId, msgId, enabled, ctx, deps) {
|
|
227
|
+
const item = deps.findItem(chatId, msgId);
|
|
228
|
+
if (!item) {
|
|
229
|
+
return refreshStaleTelegramQueueMenuItem(callbackQueryId, replyChatId, replyMessageId, deps);
|
|
230
|
+
}
|
|
231
|
+
await updateTelegramQueueMenuPriority(callbackQueryId, replyChatId, replyMessageId, chatId, msgId, enabled, ctx, deps);
|
|
232
|
+
}
|
|
233
|
+
async function updateTelegramQueueMenuPriority(callbackQueryId, replyChatId, replyMessageId, chatId, msgId, enabled, ctx, deps) {
|
|
234
|
+
deps.setPriority(chatId, msgId, enabled);
|
|
235
|
+
deps.updateStatus(ctx);
|
|
236
|
+
const updated = deps.findItem(chatId, msgId);
|
|
237
|
+
if (!updated) {
|
|
238
|
+
return refreshStaleTelegramQueueMenuItem(callbackQueryId, replyChatId, replyMessageId, deps);
|
|
239
|
+
}
|
|
240
|
+
await deps.updateQueueMessage(replyChatId, replyMessageId, getTelegramQueueMenuItemText(updated), buildTelegramQueueItemSubmenuReplyMarkup(chatId, msgId, updated.isPriority, updated.reactionSuppressionEmoji !== undefined));
|
|
241
|
+
await deps.answerCallbackQuery(callbackQueryId, updated.isPriority ? "Prioritized." : "Normal priority.");
|
|
242
|
+
}
|
|
243
|
+
async function handleTelegramQueueMenuSkipSet(callbackQueryId, replyChatId, replyMessageId, chatId, msgId, skipped, ctx, deps) {
|
|
244
|
+
const item = deps.findItem(chatId, msgId);
|
|
245
|
+
if (!item) {
|
|
246
|
+
return refreshStaleTelegramQueueMenuItem(callbackQueryId, replyChatId, replyMessageId, deps);
|
|
247
|
+
}
|
|
248
|
+
deps.setSkipped(chatId, msgId, skipped);
|
|
249
|
+
deps.updateStatus(ctx);
|
|
250
|
+
const updated = deps.findItem(chatId, msgId);
|
|
251
|
+
if (!updated) {
|
|
252
|
+
return refreshStaleTelegramQueueMenuItem(callbackQueryId, replyChatId, replyMessageId, deps);
|
|
253
|
+
}
|
|
254
|
+
await deps.updateQueueMessage(replyChatId, replyMessageId, getTelegramQueueMenuItemText(updated), buildTelegramQueueItemSubmenuReplyMarkup(chatId, msgId, updated.isPriority, updated.reactionSuppressionEmoji !== undefined));
|
|
255
|
+
await deps.answerCallbackQuery(callbackQueryId);
|
|
256
|
+
}
|
|
257
|
+
export function createTelegramQueueMenuRuntime(deps) {
|
|
258
|
+
const sendQueueMenuMessage = createQueueMenuSendMessageAdapter(deps.sendInteractiveMessage);
|
|
259
|
+
const editQueueMenuMessage = createQueueMenuEditMessageAdapter(deps.editInteractiveMessage);
|
|
260
|
+
return {
|
|
261
|
+
openQueueMenu: createOpenQueueMenu({
|
|
262
|
+
getQueuedItems: deps.telegramQueueStore.getQueuedItems,
|
|
263
|
+
getModelMenuState: deps.getModelMenuState,
|
|
264
|
+
storeModelMenuState: deps.storeModelMenuState,
|
|
265
|
+
sendInteractiveMessage: sendQueueMenuMessage,
|
|
266
|
+
}),
|
|
267
|
+
handleCallbackQuery: createQueueMenuCallbackHandler({
|
|
268
|
+
telegramQueueStore: deps.telegramQueueStore,
|
|
269
|
+
queueMutationRuntime: deps.queueMutationRuntime,
|
|
270
|
+
editInteractiveMessage: editQueueMenuMessage,
|
|
271
|
+
getStoredModelMenuState: deps.getStoredModelMenuState,
|
|
272
|
+
updateStatusMessage: deps.updateStatusMessage,
|
|
273
|
+
answerCallbackQuery: deps.answerCallbackQuery,
|
|
274
|
+
updateStatus: deps.updateStatus,
|
|
275
|
+
}),
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function createOpenQueueMenu(deps) {
|
|
279
|
+
return async (chatId, replyToMessageId, ctx) => {
|
|
280
|
+
const state = await deps.getModelMenuState(chatId, ctx);
|
|
281
|
+
const menuItems = toTelegramQueueMenuItems(deps.getQueuedItems());
|
|
282
|
+
const text = getTelegramQueueMenuListText(menuItems);
|
|
283
|
+
const messageId = await deps.sendInteractiveMessage(chatId, replyToMessageId, text, buildTelegramQueueMenuReplyMarkup(menuItems));
|
|
284
|
+
if (messageId === undefined)
|
|
285
|
+
return;
|
|
286
|
+
state.messageId = messageId;
|
|
287
|
+
state.mode = "queue";
|
|
288
|
+
deps.storeModelMenuState(state);
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
function createQueueMenuCallbackHandler(deps) {
|
|
292
|
+
return async (query, ctx) => {
|
|
293
|
+
const data = query.data;
|
|
294
|
+
const chatId = query.message?.chat?.id;
|
|
295
|
+
const messageId = query.message?.message_id;
|
|
296
|
+
if (!data || typeof chatId !== "number" || typeof messageId !== "number")
|
|
297
|
+
return false;
|
|
298
|
+
if (data === "menu:queue" || data === "status:queue") {
|
|
299
|
+
const state = deps.getStoredModelMenuState(messageId, chatId);
|
|
300
|
+
if (!state) {
|
|
301
|
+
await deps.answerCallbackQuery(query.id, "Interactive message expired.");
|
|
302
|
+
return true;
|
|
303
|
+
}
|
|
304
|
+
const menuItems = toTelegramQueueMenuItems(deps.telegramQueueStore.getQueuedItems());
|
|
305
|
+
await deps.editInteractiveMessage(chatId, messageId, getTelegramQueueMenuListText(menuItems), buildTelegramQueueMenuReplyMarkup(menuItems));
|
|
306
|
+
state.mode = "queue";
|
|
307
|
+
await deps.answerCallbackQuery(query.id);
|
|
308
|
+
return true;
|
|
309
|
+
}
|
|
310
|
+
if (!data.startsWith("queue:"))
|
|
311
|
+
return false;
|
|
312
|
+
const getQueueSnapshot = () => {
|
|
313
|
+
return deps.telegramQueueStore.getQueuedItems();
|
|
314
|
+
};
|
|
315
|
+
const toMenuItems = () => {
|
|
316
|
+
return toTelegramQueueMenuItems(getQueueSnapshot());
|
|
317
|
+
};
|
|
318
|
+
const findItem = (cId, rId) => {
|
|
319
|
+
return findTelegramQueueMenuItem(toMenuItems(), cId, rId);
|
|
320
|
+
};
|
|
321
|
+
return handleTelegramQueueMenuCallback(query.id, data, chatId, messageId, ctx, {
|
|
322
|
+
getQueuedItems: toMenuItems,
|
|
323
|
+
findItem,
|
|
324
|
+
togglePriority: (cId, rId) => {
|
|
325
|
+
return toggleQueuedTelegramPromptPriority(cId, rId, ctx, {
|
|
326
|
+
getQueueSnapshot,
|
|
327
|
+
queueMutationRuntime: deps.queueMutationRuntime,
|
|
328
|
+
});
|
|
329
|
+
},
|
|
330
|
+
setPriority: (cId, rId, enabled) => {
|
|
331
|
+
return setQueuedTelegramPromptPriority(cId, rId, enabled, ctx, {
|
|
332
|
+
getQueueSnapshot,
|
|
333
|
+
queueMutationRuntime: deps.queueMutationRuntime,
|
|
334
|
+
});
|
|
335
|
+
},
|
|
336
|
+
setSkipped: (cId, rId, skipped) => {
|
|
337
|
+
return setQueuedTelegramPromptSkipped(cId, rId, skipped, ctx, {
|
|
338
|
+
getQueueSnapshot,
|
|
339
|
+
queueMutationRuntime: deps.queueMutationRuntime,
|
|
340
|
+
});
|
|
341
|
+
},
|
|
342
|
+
updateQueueMessage: deps.editInteractiveMessage,
|
|
343
|
+
answerCallbackQuery: deps.answerCallbackQuery,
|
|
344
|
+
updateStatus: deps.updateStatus,
|
|
345
|
+
});
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
function getQueueMenuReactionDisposition(item, priority, skipped) {
|
|
349
|
+
if (priority && skipped) {
|
|
350
|
+
return {
|
|
351
|
+
kind: "priority-suppressed",
|
|
352
|
+
priorityEmoji: item.kind === "prompt" ? item.priorityEmoji ?? "⚡" : "⚡",
|
|
353
|
+
suppressionEmoji: item.kind === "prompt"
|
|
354
|
+
? item.reactionSuppressionEmoji ?? "👎"
|
|
355
|
+
: "👎",
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
if (priority) {
|
|
359
|
+
return {
|
|
360
|
+
kind: "priority",
|
|
361
|
+
emoji: item.kind === "prompt" ? item.priorityEmoji ?? "⚡" : "⚡",
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
if (skipped) {
|
|
365
|
+
return {
|
|
366
|
+
kind: "suppressed",
|
|
367
|
+
emoji: item.kind === "prompt"
|
|
368
|
+
? item.reactionSuppressionEmoji ?? "👎"
|
|
369
|
+
: "👎",
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
return { kind: "default" };
|
|
373
|
+
}
|
|
374
|
+
function toggleQueuedTelegramPromptPriority(chatId, replyToMessageId, ctx, deps) {
|
|
375
|
+
const item = findTelegramQueueItem(deps.getQueueSnapshot(), chatId, replyToMessageId);
|
|
376
|
+
if (!item)
|
|
377
|
+
return false;
|
|
378
|
+
deps.queueMutationRuntime.applyReactionByMessageId(replyToMessageId, getQueueMenuReactionDisposition(item, item.queueLane !== "priority", item.kind === "prompt" &&
|
|
379
|
+
item.reactionSuppressionEmoji !== undefined), ctx);
|
|
380
|
+
return true;
|
|
381
|
+
}
|
|
382
|
+
function setQueuedTelegramPromptPriority(chatId, replyToMessageId, enabled, ctx, deps) {
|
|
383
|
+
const item = findTelegramQueueItem(deps.getQueueSnapshot(), chatId, replyToMessageId);
|
|
384
|
+
if (!item)
|
|
385
|
+
return false;
|
|
386
|
+
deps.queueMutationRuntime.applyReactionByMessageId(replyToMessageId, getQueueMenuReactionDisposition(item, enabled, item.kind === "prompt" &&
|
|
387
|
+
item.reactionSuppressionEmoji !== undefined), ctx);
|
|
388
|
+
return true;
|
|
389
|
+
}
|
|
390
|
+
function setQueuedTelegramPromptSkipped(chatId, replyToMessageId, skipped, ctx, deps) {
|
|
391
|
+
const item = findTelegramQueueItem(deps.getQueueSnapshot(), chatId, replyToMessageId);
|
|
392
|
+
if (!item || item.kind !== "prompt")
|
|
393
|
+
return false;
|
|
394
|
+
deps.queueMutationRuntime.applyReactionByMessageId(replyToMessageId, getQueueMenuReactionDisposition(item, item.queueLane === "priority", skipped), ctx);
|
|
395
|
+
return true;
|
|
396
|
+
}
|
|
397
|
+
function createQueueMenuSendMessageAdapter(sendInteractiveMessage) {
|
|
398
|
+
return (chatId, _replyToMessageId, text, replyMarkup) => {
|
|
399
|
+
return sendInteractiveMessage(chatId, text, "html", replyMarkup);
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
function createQueueMenuEditMessageAdapter(editInteractiveMessage) {
|
|
403
|
+
return (chatId, messageId, text, replyMarkup) => {
|
|
404
|
+
return editInteractiveMessage(chatId, messageId, text, "html", replyMarkup).then(() => {
|
|
405
|
+
return undefined;
|
|
406
|
+
});
|
|
407
|
+
};
|
|
408
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telegram settings menu UI helpers
|
|
3
|
+
* Zones: telegram ui, settings controls, menu composition
|
|
4
|
+
* Owns hidden settings-menu rendering, settings callbacks, and persisted toggle wiring
|
|
5
|
+
*/
|
|
6
|
+
import type { TelegramActivityVerbosity, TelegramAssistantRenderingMode, TelegramTimeMode, TelegramThreadDisplayMode } from "./config.ts";
|
|
7
|
+
import type { TelegramInlineKeyboardMarkup } from "./keyboard.ts";
|
|
8
|
+
import type { TelegramModelMenuState } from "./menu-model.ts";
|
|
9
|
+
import type { MenuModel } from "./model.ts";
|
|
10
|
+
import { type TelegramSectionRegistry } from "./sections.ts";
|
|
11
|
+
import type { TelegramVoiceReplyMode } from "./voice.ts";
|
|
12
|
+
export type TelegramSettingsMenuReplyMarkup = TelegramInlineKeyboardMarkup;
|
|
13
|
+
export interface TelegramSettingsStateDeps {
|
|
14
|
+
getThreadDisplayMode?: () => TelegramThreadDisplayMode | undefined;
|
|
15
|
+
getThreadDisplayPreview?: (mode: TelegramThreadDisplayMode) => readonly string[];
|
|
16
|
+
areDraftPreviewsEnabled: () => boolean;
|
|
17
|
+
getAssistantRenderingMode: () => TelegramAssistantRenderingMode;
|
|
18
|
+
getActivityVerbosity: () => TelegramActivityVerbosity;
|
|
19
|
+
getTimeInjectionMode: () => TelegramTimeMode;
|
|
20
|
+
getVoiceReplyMode: () => TelegramVoiceReplyMode;
|
|
21
|
+
isVoiceReplyModeConfigured: () => boolean;
|
|
22
|
+
isAutomaticThreadCleanupEnabled: () => boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface TelegramSettingsMutationDeps extends TelegramSettingsStateDeps {
|
|
25
|
+
setThreadDisplayMode?: (mode: TelegramThreadDisplayMode) => Promise<void>;
|
|
26
|
+
setDraftPreviewsEnabled: (enabled: boolean) => Promise<void>;
|
|
27
|
+
setAssistantRenderingMode: (mode: TelegramAssistantRenderingMode) => Promise<void>;
|
|
28
|
+
setActivityVerbosity: (verbosity: TelegramActivityVerbosity) => Promise<void>;
|
|
29
|
+
setVoiceReplyMode: (mode: TelegramVoiceReplyMode | undefined) => Promise<void>;
|
|
30
|
+
setTimeInjectionMode: (mode: TelegramTimeMode) => Promise<void>;
|
|
31
|
+
setAutomaticThreadCleanupEnabled: (enabled: boolean) => Promise<void>;
|
|
32
|
+
reviewInactiveThreads?: () => Promise<{
|
|
33
|
+
count: number;
|
|
34
|
+
operationId?: string;
|
|
35
|
+
}>;
|
|
36
|
+
cleanInactiveThreads?: (operationId: string) => Promise<{
|
|
37
|
+
deleted: number;
|
|
38
|
+
outcomeUnknown: number;
|
|
39
|
+
blocked?: number;
|
|
40
|
+
recovery?: "commit-ready" | "deletion-outcome-unknown" | "authority-blocked";
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
export interface TelegramSettingsMenuOpenDeps<TModel extends MenuModel = MenuModel> extends TelegramSettingsStateDeps {
|
|
44
|
+
getModelMenuState: () => Promise<TelegramModelMenuState<TModel>>;
|
|
45
|
+
sendSettingsMenu: (state: TelegramModelMenuState<TModel>, text: string, replyMarkup: TelegramSettingsMenuReplyMarkup) => Promise<number | undefined>;
|
|
46
|
+
storeModelMenuState: (state: TelegramModelMenuState<TModel>) => void;
|
|
47
|
+
}
|
|
48
|
+
export interface TelegramSettingsMenuCallbackDeps extends TelegramSettingsMutationDeps {
|
|
49
|
+
updateSettingsMessage: (text: string, replyMarkup: TelegramSettingsMenuReplyMarkup) => Promise<void>;
|
|
50
|
+
answerCallbackQuery: (callbackQueryId: string, text?: string) => Promise<void>;
|
|
51
|
+
sectionRegistry?: TelegramSectionRegistry;
|
|
52
|
+
}
|
|
53
|
+
export interface TelegramSettingsMenuRuntime<TContext> {
|
|
54
|
+
openSettingsMenu: (chatId: number, replyToMessageId: number, ctx: TContext) => Promise<void>;
|
|
55
|
+
handleCallbackQuery: (query: {
|
|
56
|
+
id: string;
|
|
57
|
+
data?: string;
|
|
58
|
+
message?: {
|
|
59
|
+
message_id?: number;
|
|
60
|
+
message_thread_id?: number;
|
|
61
|
+
chat?: {
|
|
62
|
+
id?: number;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
}, ctx: TContext) => Promise<boolean>;
|
|
66
|
+
updateSettingsMenuMessage: (state: TelegramModelMenuState, ctx: TContext) => Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
export interface TelegramSettingsMenuMessageUpdateDeps extends TelegramSettingsStateDeps {
|
|
69
|
+
updateSettingsMessage: (text: string, replyMarkup: TelegramSettingsMenuReplyMarkup) => Promise<void>;
|
|
70
|
+
}
|
|
71
|
+
export interface TelegramSettingsMenuRuntimeDeps<TContext, TModel extends MenuModel = MenuModel> extends TelegramSettingsMutationDeps {
|
|
72
|
+
reloadConfig?: () => Promise<void>;
|
|
73
|
+
getModelMenuState: (chatId: number, ctx: TContext, threadId?: number) => Promise<TelegramModelMenuState<TModel>>;
|
|
74
|
+
getStoredModelMenuState: (messageId: number | undefined, chatId?: number) => TelegramModelMenuState<TModel> | undefined;
|
|
75
|
+
storeModelMenuState: (state: TelegramModelMenuState<TModel>) => void;
|
|
76
|
+
editInteractiveMessage: (chatId: number, messageId: number, text: string, mode: "markdown" | "html" | "plain", replyMarkup: TelegramSettingsMenuReplyMarkup) => Promise<void>;
|
|
77
|
+
sendInteractiveMessage: (chatId: number, text: string, mode: "markdown" | "html" | "plain", replyMarkup: TelegramSettingsMenuReplyMarkup) => Promise<number | undefined>;
|
|
78
|
+
answerCallbackQuery: (callbackQueryId: string, text?: string) => Promise<void>;
|
|
79
|
+
}
|
|
80
|
+
export declare const SETTINGS_MENU_TITLE = "<b>\u2699\uFE0F Settings:</b>";
|
|
81
|
+
export declare const AUTOMATIC_THREAD_CLEANUP_SETTINGS_TITLE = "<b>\uD83E\uDDF9 Thread cleanup:</b>";
|
|
82
|
+
export declare const INACTIVE_THREAD_REVIEW_TITLE = "<b>\uD83D\uDD0E Inactive tabs review:</b>";
|
|
83
|
+
export declare const DRAFT_PREVIEWS_SETTINGS_TITLE = "<b>\uD83D\uDCDD Draft previews:</b>";
|
|
84
|
+
export declare const ASSISTANT_RENDERING_SETTINGS_TITLE = "<b>\uD83E\uDDFE Assistant rendering:</b>";
|
|
85
|
+
export declare const ACTIVITY_VERBOSITY_SETTINGS_TITLE = "<b>\uD83D\uDD2C Activity:</b>";
|
|
86
|
+
export declare const TIME_INJECTION_MODE_SETTINGS_TITLE = "<b>\uD83D\uDD52 Time injection mode:</b>";
|
|
87
|
+
export declare const VOICE_REPLY_MODE_SETTINGS_TITLE = "<b>\uD83D\uDC44 Voice reply mode:</b>";
|
|
88
|
+
export declare const THREAD_DISPLAY_SETTINGS_TITLE = "<b>\uD83E\uDDF5 Thread display:</b>";
|
|
89
|
+
export declare function buildTelegramSettingsMenuText(): string;
|
|
90
|
+
export declare function buildThreadDisplaySettingsText(mode: TelegramThreadDisplayMode, preview?: readonly string[]): string;
|
|
91
|
+
export declare function buildAutomaticThreadCleanupSettingsText(enabled: boolean): string;
|
|
92
|
+
export declare function buildInactiveThreadReviewText(count: number): string;
|
|
93
|
+
export declare function buildInactiveThreadReviewReplyMarkup(operationId?: string, canCleanInactiveThreads?: boolean): TelegramSettingsMenuReplyMarkup;
|
|
94
|
+
export declare function buildDraftPreviewsSettingsText(enabled: boolean): string;
|
|
95
|
+
export declare function buildAssistantRenderingSettingsText(mode: TelegramAssistantRenderingMode): string;
|
|
96
|
+
export declare function buildActivityVerbositySettingsText(verbosity: TelegramActivityVerbosity): string;
|
|
97
|
+
export declare function buildVoiceReplyModeSettingsText(mode: TelegramVoiceReplyMode, configured?: boolean): string;
|
|
98
|
+
export declare function buildTimeInjectionModeSettingsText(mode: TelegramTimeMode): string;
|
|
99
|
+
export declare function buildTelegramSettingsMenuReplyMarkup(draftPreviewsEnabled: boolean, assistantRenderingModeOrVoiceReplyMode: TelegramAssistantRenderingMode | TelegramVoiceReplyMode, voiceReplyModeOrTimeInjectionMode: TelegramVoiceReplyMode | TelegramTimeMode, timeInjectionModeOrSectionRegistry?: TelegramTimeMode | TelegramSectionRegistry, sectionRegistryOrVoiceReplyModeConfigured?: TelegramSectionRegistry | boolean, voiceReplyModeConfigured?: boolean, automaticThreadCleanupEnabled?: boolean, activityVerbosity?: TelegramActivityVerbosity, threadDisplayMode?: TelegramThreadDisplayMode): TelegramSettingsMenuReplyMarkup;
|
|
100
|
+
export declare function openTelegramSettingsMenu<TModel extends MenuModel = MenuModel>(deps: TelegramSettingsMenuOpenDeps<TModel>, sectionRegistry?: TelegramSectionRegistry): Promise<void>;
|
|
101
|
+
export declare function buildThreadDisplaySettingsReplyMarkup(mode: TelegramThreadDisplayMode): TelegramSettingsMenuReplyMarkup;
|
|
102
|
+
export declare function buildAutomaticThreadCleanupSettingsReplyMarkup(enabled: boolean, canReviewInactiveThreads?: boolean): TelegramSettingsMenuReplyMarkup;
|
|
103
|
+
export declare function buildDraftPreviewsSettingsReplyMarkup(enabled: boolean): TelegramSettingsMenuReplyMarkup;
|
|
104
|
+
export declare function buildAssistantRenderingSettingsReplyMarkup(mode: TelegramAssistantRenderingMode): TelegramSettingsMenuReplyMarkup;
|
|
105
|
+
export declare function buildActivityVerbositySettingsReplyMarkup(verbosity: TelegramActivityVerbosity): TelegramSettingsMenuReplyMarkup;
|
|
106
|
+
export declare function buildTimeInjectionModeSettingsReplyMarkup(mode: TelegramTimeMode): TelegramSettingsMenuReplyMarkup;
|
|
107
|
+
export declare function buildVoiceReplyModeSettingsReplyMarkup(mode: TelegramVoiceReplyMode, configured?: boolean): TelegramSettingsMenuReplyMarkup;
|
|
108
|
+
export declare function updateTelegramSettingsMenuMessage(deps: TelegramSettingsMenuMessageUpdateDeps, sectionRegistry?: TelegramSectionRegistry): Promise<void>;
|
|
109
|
+
export declare function updateAutomaticThreadCleanupSettingsMessage(deps: TelegramSettingsMenuCallbackDeps): Promise<void>;
|
|
110
|
+
export declare function updateDraftPreviewsSettingsMessage(deps: TelegramSettingsMenuCallbackDeps): Promise<void>;
|
|
111
|
+
export declare function updateAssistantRenderingSettingsMessage(deps: TelegramSettingsMenuCallbackDeps): Promise<void>;
|
|
112
|
+
export declare function updateActivityVerbositySettingsMessage(deps: TelegramSettingsMenuCallbackDeps): Promise<void>;
|
|
113
|
+
export declare function updateTimeInjectionModeSettingsMessage(deps: TelegramSettingsMenuCallbackDeps): Promise<void>;
|
|
114
|
+
export declare function updateVoiceReplyModeSettingsMessage(deps: TelegramSettingsMenuCallbackDeps): Promise<void>;
|
|
115
|
+
export declare function handleTelegramSettingsMenuCallbackAction(callbackQueryId: string, data: string | undefined, deps: TelegramSettingsMenuCallbackDeps): Promise<boolean>;
|
|
116
|
+
export declare function createTelegramSettingsMenuRuntime<TContext, TModel extends MenuModel = MenuModel>(deps: TelegramSettingsMenuRuntimeDeps<TContext, TModel>, sectionRegistry?: TelegramSectionRegistry): TelegramSettingsMenuRuntime<TContext>;
|