@llblab/pi-telegram 0.9.4 → 0.9.6
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/AGENTS.md +5 -2
- package/BACKLOG.md +10 -1
- package/CHANGELOG.md +18 -0
- package/README.md +114 -116
- package/docs/README.md +1 -0
- package/docs/architecture.md +24 -27
- package/docs/callback-namespaces.md +13 -1
- package/docs/extension-sections.md +293 -0
- package/docs/external-handlers.md +33 -75
- package/docs/inbound-handlers.md +6 -6
- package/docs/outbound-handlers.md +12 -12
- package/index.ts +1 -0
- package/lib/api.ts +6 -4
- package/lib/menu-settings.ts +0 -1
- package/lib/preview.ts +37 -8
- package/lib/queue.ts +18 -10
- package/package.json +2 -2
package/lib/queue.ts
CHANGED
|
@@ -1023,20 +1023,28 @@ export async function handleTelegramAgentEndRuntime<
|
|
|
1023
1023
|
if (finalText) deps.setPreviewPendingText(finalText);
|
|
1024
1024
|
if (!finalText && hasOutboundArtifacts) await deps.clearPreview(turn.chatId);
|
|
1025
1025
|
if (endPlan.kind === "text" && finalText) {
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
finalText,
|
|
1029
|
-
turn.replyToMessageId,
|
|
1030
|
-
{ replyMarkup },
|
|
1031
|
-
);
|
|
1032
|
-
if (!finalized) {
|
|
1033
|
-
await deps.clearPreview(turn.chatId);
|
|
1034
|
-
await deps.sendMarkdownReply(
|
|
1026
|
+
try {
|
|
1027
|
+
const finalized = await deps.finalizeMarkdownPreview(
|
|
1035
1028
|
turn.chatId,
|
|
1036
|
-
turn.replyToMessageId,
|
|
1037
1029
|
finalText,
|
|
1030
|
+
turn.replyToMessageId,
|
|
1038
1031
|
{ replyMarkup },
|
|
1039
1032
|
);
|
|
1033
|
+
if (!finalized) {
|
|
1034
|
+
await deps.clearPreview(turn.chatId);
|
|
1035
|
+
await deps.sendMarkdownReply(
|
|
1036
|
+
turn.chatId,
|
|
1037
|
+
turn.replyToMessageId,
|
|
1038
|
+
finalText,
|
|
1039
|
+
{ replyMarkup },
|
|
1040
|
+
);
|
|
1041
|
+
}
|
|
1042
|
+
} catch (error) {
|
|
1043
|
+
deps.recordRuntimeEvent?.("delivery", error, {
|
|
1044
|
+
phase: "final-text",
|
|
1045
|
+
chatId: turn.chatId,
|
|
1046
|
+
replyToMessageId: turn.replyToMessageId,
|
|
1047
|
+
});
|
|
1040
1048
|
}
|
|
1041
1049
|
}
|
|
1042
1050
|
if (outboundReply && deps.sendOutboundReplyArtifacts) {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llblab/pi-telegram",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.6",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "Telegram Runtime Adapter for π",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"pi-package",
|