@llblab/pi-kit 0.6.0 → 0.7.1

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.
Files changed (129) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +4 -4
  3. package/node_modules/@llblab/pi-actors/AGENTS.md +1 -1
  4. package/node_modules/@llblab/pi-actors/CHANGELOG.md +6 -0
  5. package/node_modules/@llblab/pi-actors/README.md +1 -1
  6. package/node_modules/@llblab/pi-actors/dist/lib/async-runs.d.ts +3 -0
  7. package/node_modules/@llblab/pi-actors/dist/lib/async-runs.js +14 -1
  8. package/node_modules/@llblab/pi-actors/dist/lib/command-templates.js +45 -3
  9. package/node_modules/@llblab/pi-actors/dist/lib/extension-runtime.js +1 -1
  10. package/node_modules/@llblab/pi-actors/dist/lib/observability.d.ts +16 -3
  11. package/node_modules/@llblab/pi-actors/dist/lib/observability.js +92 -7
  12. package/node_modules/@llblab/pi-actors/dist/lib/pi.d.ts +0 -1
  13. package/node_modules/@llblab/pi-actors/dist/lib/pi.js +15 -24
  14. package/node_modules/@llblab/pi-actors/dist/lib/run-delivery-lineage.d.ts +17 -0
  15. package/node_modules/@llblab/pi-actors/dist/lib/run-delivery-lineage.js +44 -0
  16. package/node_modules/@llblab/pi-actors/dist/lib/run-delivery.d.ts +4 -0
  17. package/node_modules/@llblab/pi-actors/dist/lib/run-delivery.js +102 -4
  18. package/node_modules/@llblab/pi-actors/dist/lib/run-ui-runtime.js +58 -39
  19. package/node_modules/@llblab/pi-actors/dist/lib/runtime.js +14 -6
  20. package/node_modules/@llblab/pi-actors/dist/skills/actors/SKILL.md +1 -1
  21. package/node_modules/@llblab/pi-actors/docs/async-runs.md +1 -1
  22. package/node_modules/@llblab/pi-actors/docs/coordinator-delivery.md +18 -23
  23. package/node_modules/@llblab/pi-actors/lib/async-runs.ts +18 -1
  24. package/node_modules/@llblab/pi-actors/lib/command-templates.ts +41 -3
  25. package/node_modules/@llblab/pi-actors/lib/extension-runtime.ts +1 -1
  26. package/node_modules/@llblab/pi-actors/lib/observability.ts +119 -5
  27. package/node_modules/@llblab/pi-actors/lib/pi.ts +15 -28
  28. package/node_modules/@llblab/pi-actors/lib/run-delivery-lineage.ts +68 -0
  29. package/node_modules/@llblab/pi-actors/lib/run-delivery.ts +120 -4
  30. package/node_modules/@llblab/pi-actors/lib/run-ui-runtime.ts +69 -44
  31. package/node_modules/@llblab/pi-actors/lib/runtime.ts +17 -6
  32. package/node_modules/@llblab/pi-actors/package.json +1 -1
  33. package/node_modules/@llblab/pi-actors/skills/actors/SKILL.md +1 -1
  34. package/node_modules/@llblab/pi-state-flow/AGENTS.md +33 -12
  35. package/node_modules/@llblab/pi-state-flow/BACKLOG.md +125 -2
  36. package/node_modules/@llblab/pi-state-flow/CHANGELOG.md +87 -45
  37. package/node_modules/@llblab/pi-state-flow/README.md +203 -107
  38. package/node_modules/@llblab/pi-state-flow/docs/README.md +4 -0
  39. package/node_modules/@llblab/pi-state-flow/docs/architecture.md +188 -0
  40. package/node_modules/@llblab/pi-state-flow/docs/temporal-acceptance.md +42 -0
  41. package/node_modules/@llblab/pi-state-flow/index.ts +164 -2
  42. package/node_modules/@llblab/pi-state-flow/lib/acquisition.ts +138 -0
  43. package/node_modules/@llblab/pi-state-flow/lib/artifact.ts +273 -0
  44. package/node_modules/@llblab/pi-state-flow/lib/config.ts +48 -0
  45. package/node_modules/@llblab/pi-state-flow/lib/context.ts +18 -5
  46. package/node_modules/@llblab/pi-state-flow/lib/continuation.ts +268 -0
  47. package/node_modules/@llblab/pi-state-flow/lib/discovery.ts +117 -0
  48. package/node_modules/@llblab/pi-state-flow/lib/durable.ts +562 -0
  49. package/node_modules/@llblab/pi-state-flow/lib/episode.ts +24 -12
  50. package/node_modules/@llblab/pi-state-flow/lib/extension.ts +606 -70
  51. package/node_modules/@llblab/pi-state-flow/lib/git.ts +666 -0
  52. package/node_modules/@llblab/pi-state-flow/lib/history.ts +95 -0
  53. package/node_modules/@llblab/pi-state-flow/lib/json.ts +24 -0
  54. package/node_modules/@llblab/pi-state-flow/lib/maintenance.ts +141 -0
  55. package/node_modules/@llblab/pi-state-flow/lib/memory.ts +52 -0
  56. package/node_modules/@llblab/pi-state-flow/lib/migration.ts +88 -0
  57. package/node_modules/@llblab/pi-state-flow/lib/publication.ts +296 -0
  58. package/node_modules/@llblab/pi-state-flow/lib/recovery.ts +23 -7
  59. package/node_modules/@llblab/pi-state-flow/lib/rehydration.ts +79 -0
  60. package/node_modules/@llblab/pi-state-flow/lib/runtime.ts +264 -0
  61. package/node_modules/@llblab/pi-state-flow/lib/session.ts +6 -0
  62. package/node_modules/@llblab/pi-state-flow/lib/skills.ts +99 -7
  63. package/node_modules/@llblab/pi-state-flow/lib/snapshot.ts +305 -48
  64. package/node_modules/@llblab/pi-state-flow/lib/state.ts +74 -7
  65. package/node_modules/@llblab/pi-state-flow/lib/status.ts +125 -6
  66. package/node_modules/@llblab/pi-state-flow/lib/storage.ts +196 -0
  67. package/node_modules/@llblab/pi-state-flow/lib/temporal.ts +233 -0
  68. package/node_modules/@llblab/pi-state-flow/lib/terminal.ts +70 -24
  69. package/node_modules/@llblab/pi-state-flow/lib/transition.ts +254 -29
  70. package/node_modules/@llblab/pi-state-flow/package.json +8 -2
  71. package/node_modules/@llblab/pi-state-flow/skills/state-flow-memory/SKILL.md +128 -0
  72. package/node_modules/@llblab/pi-telegram/AGENTS.md +14 -9
  73. package/node_modules/@llblab/pi-telegram/BACKLOG.md +23 -5
  74. package/node_modules/@llblab/pi-telegram/CHANGELOG.md +18 -0
  75. package/node_modules/@llblab/pi-telegram/README.md +13 -9
  76. package/node_modules/@llblab/pi-telegram/docs/README.md +1 -0
  77. package/node_modules/@llblab/pi-telegram/docs/architecture.md +227 -23
  78. package/node_modules/@llblab/pi-telegram/docs/generative-apps.md +1 -1
  79. package/node_modules/@llblab/pi-telegram/docs/multi-instance-bus.md +70 -19
  80. package/node_modules/@llblab/pi-telegram/docs/outbound.md +6 -6
  81. package/node_modules/@llblab/pi-telegram/docs/public-api.md +13 -6
  82. package/node_modules/@llblab/pi-telegram/docs/ui-style.md +3 -1
  83. package/node_modules/@llblab/pi-telegram/index.ts +4 -1418
  84. package/node_modules/@llblab/pi-telegram/lib/agent-messages.ts +6 -3
  85. package/node_modules/@llblab/pi-telegram/lib/bindings.ts +46 -1
  86. package/node_modules/@llblab/pi-telegram/lib/bus-api.ts +32 -19
  87. package/node_modules/@llblab/pi-telegram/lib/bus-follower.ts +600 -135
  88. package/node_modules/@llblab/pi-telegram/lib/bus-leader.ts +962 -55
  89. package/node_modules/@llblab/pi-telegram/lib/bus.ts +355 -26
  90. package/node_modules/@llblab/pi-telegram/lib/channel-posts.ts +718 -0
  91. package/node_modules/@llblab/pi-telegram/lib/commands.ts +237 -11
  92. package/node_modules/@llblab/pi-telegram/lib/config.ts +242 -26
  93. package/node_modules/@llblab/pi-telegram/lib/extension.ts +1851 -0
  94. package/node_modules/@llblab/pi-telegram/lib/generative-apps.ts +20 -2
  95. package/node_modules/@llblab/pi-telegram/lib/journal.ts +2184 -126
  96. package/node_modules/@llblab/pi-telegram/lib/locks.ts +44 -2
  97. package/node_modules/@llblab/pi-telegram/lib/menu-settings.ts +152 -13
  98. package/node_modules/@llblab/pi-telegram/lib/outbound-attachments.ts +97 -10
  99. package/node_modules/@llblab/pi-telegram/lib/paths.ts +29 -0
  100. package/node_modules/@llblab/pi-telegram/lib/polling.ts +85 -17
  101. package/node_modules/@llblab/pi-telegram/lib/preview.ts +17 -0
  102. package/node_modules/@llblab/pi-telegram/lib/prompts.ts +6 -2
  103. package/node_modules/@llblab/pi-telegram/lib/queue.ts +118 -26
  104. package/node_modules/@llblab/pi-telegram/lib/rendering.ts +4 -1
  105. package/node_modules/@llblab/pi-telegram/lib/replies.ts +21 -2
  106. package/node_modules/@llblab/pi-telegram/lib/routing.ts +344 -112
  107. package/node_modules/@llblab/pi-telegram/lib/setup.ts +44 -4
  108. package/node_modules/@llblab/pi-telegram/lib/status.ts +51 -4
  109. package/node_modules/@llblab/pi-telegram/lib/sync.ts +308 -39
  110. package/node_modules/@llblab/pi-telegram/lib/telegram-api.ts +353 -22
  111. package/node_modules/@llblab/pi-telegram/lib/thread-cleanup-manager.ts +664 -0
  112. package/node_modules/@llblab/pi-telegram/lib/thread-display.ts +226 -0
  113. package/node_modules/@llblab/pi-telegram/lib/thread-naming.ts +118 -0
  114. package/node_modules/@llblab/pi-telegram/lib/threads.ts +1686 -129
  115. package/node_modules/@llblab/pi-telegram/lib/turns.ts +7 -0
  116. package/node_modules/@llblab/pi-telegram/lib/updates.ts +1319 -97
  117. package/node_modules/@llblab/pi-telegram/lib/workspace-admission.ts +1643 -0
  118. package/node_modules/@llblab/pi-telegram/lib/workspace-retirement.ts +968 -0
  119. package/node_modules/@llblab/pi-telegram/lib/workspace-slots.ts +84 -0
  120. package/node_modules/@llblab/pi-telegram/package.json +1 -1
  121. package/node_modules/@llblab/pi-telegram/screenshot.png +0 -0
  122. package/node_modules/@llblab/pi-telegram/scripts/measure-bus.mjs +83 -0
  123. package/node_modules/@llblab/pi-telegram/scripts/measure-workspace.mjs +101 -0
  124. package/node_modules/@llblab/{skills → pi-telegram/skills}/show-me/SKILL.md +28 -6
  125. package/node_modules/@llblab/pi-telegram/skills/show-me/references/telegram-surfaces.md +43 -0
  126. package/node_modules/@llblab/pi-telegram/skills/telegram-bridge/references/delivery-and-threads.md +1 -1
  127. package/node_modules/@llblab/skills/package.json +2 -3
  128. package/package.json +6 -5
  129. /package/node_modules/@llblab/pi-telegram/lib/{logs.ts → logging.ts} +0 -0
@@ -18,6 +18,7 @@ export interface TelegramAgentMessageRuntimeDeps<TContext, TUpdate> {
18
18
  getAllowedChatId: () => number | undefined;
19
19
  getLeaderTarget: () => TelegramTarget | undefined;
20
20
  getLeaderThreadName: () => string | undefined;
21
+ getDisplayTitle?: (target: TelegramTarget) => string | undefined;
21
22
  followerRegistry: TelegramBusFollowerRegistry;
22
23
  getContext: () => TContext | undefined;
23
24
  handleUpdate: (update: TUpdate, ctx: TContext) => Promise<void>;
@@ -39,7 +40,7 @@ export function createTelegramAgentMessageRuntime<TContext, TUpdate>(
39
40
  if (leaderTarget?.threadId) {
40
41
  targets.push({
41
42
  target: { chatId: leaderTarget.chatId, threadId: leaderTarget.threadId },
42
- threadName: deps.getLeaderThreadName(),
43
+ threadName: deps.getDisplayTitle?.(leaderTarget) ?? deps.getLeaderThreadName(),
43
44
  });
44
45
  }
45
46
  for (const follower of deps.followerRegistry.list()) {
@@ -49,7 +50,7 @@ export function createTelegramAgentMessageRuntime<TContext, TUpdate>(
49
50
  chatId: follower.target.chatId,
50
51
  threadId: follower.target.threadId,
51
52
  },
52
- threadName: follower.threadName,
53
+ threadName: deps.getDisplayTitle?.(follower.target) ?? follower.threadName,
53
54
  });
54
55
  }
55
56
  return targets;
@@ -98,8 +99,10 @@ export function createTelegramAgentMessageRuntime<TContext, TUpdate>(
98
99
  if (allowedChatId === undefined || !ctx) {
99
100
  throw new Error("Telegram agent turn routing is unavailable.");
100
101
  }
102
+ const sourceTitle = (input.sourceTarget ? deps.getDisplayTitle?.(input.sourceTarget) : undefined)
103
+ ?? input.sourceThreadName;
101
104
  const sourceLabel =
102
- input.sourceThreadName
105
+ sourceTitle
103
106
  ?.replace(/[\r\n\[\]]+/g, " ")
104
107
  .trim()
105
108
  .slice(0, 64) || "Pi";
@@ -6,6 +6,7 @@
6
6
 
7
7
  import * as Activity from "./activity.ts";
8
8
  import * as ActivityVerbosity from "./activity-verbosity.ts";
9
+ import * as ChannelPosts from "./channel-posts.ts";
9
10
  import * as CommandTemplates from "./command-templates.ts";
10
11
  import * as Commands from "./commands.ts";
11
12
  import * as Config from "./config.ts";
@@ -498,6 +499,10 @@ interface TelegramCommandsAndToolsBindingDeps {
498
499
  stopPolling?: () => Promise<void | string>;
499
500
  recoverPollingStart?: Commands.TelegramBridgeCommandRegistrationDeps["recoverPollingStart"];
500
501
  getDisconnectThreadName?: () => string | undefined;
502
+ setRequestedThreadNameForPollingStart?: (
503
+ threadName: string | undefined,
504
+ ) => void;
505
+ validateThreadName?: Commands.TelegramBridgeCommandRegistrationDeps["validateThreadName"];
501
506
  onTransportChanged?: () => Promise<void> | void;
502
507
  getStatusLines: (
503
508
  options?: Status.TelegramBridgeStatusLineOptions,
@@ -512,6 +517,15 @@ interface TelegramCommandsAndToolsBindingDeps {
512
517
  target?: { chatId: number; threadId?: number };
513
518
  },
514
519
  ) => Promise<number | undefined>;
520
+ sendChannelMarkdownMessage: NonNullable<
521
+ OutboundAttachments.TelegramOutboundMessageToolRegistrationDeps["sendChannelMarkdownMessage"]
522
+ >;
523
+ sendChannelMediaMessage: NonNullable<
524
+ OutboundAttachments.TelegramOutboundMessageToolRegistrationDeps["sendChannelMediaMessage"]
525
+ >;
526
+ listChannelPosts: ChannelPosts.TelegramChannelPostJournalStore["list"];
527
+ mutateChannelPost(input: { action: "edit" | "delete"; operationId: string;
528
+ mutationId: string; markdown?: string }): Promise<ChannelPosts.TelegramChannelPostRecord>;
515
529
  callMultipart: OutboundHandlers.TelegramVoiceReplySenderDeps["sendMultipart"];
516
530
  getDefaultChatId: () => number | undefined;
517
531
  getDefaultTarget?: () => OutboundAttachments.TelegramQueuedOutboundAttachmentTurnView["target"];
@@ -533,10 +547,16 @@ export function registerTelegramCommandsAndTools({
533
547
  stopPolling,
534
548
  recoverPollingStart,
535
549
  getDisconnectThreadName,
550
+ setRequestedThreadNameForPollingStart,
551
+ validateThreadName,
536
552
  onTransportChanged,
537
553
  getStatusLines,
538
554
  buttonActionStore,
539
555
  sendMarkdownReply,
556
+ sendChannelMarkdownMessage,
557
+ sendChannelMediaMessage,
558
+ listChannelPosts,
559
+ mutateChannelPost,
540
560
  callMultipart,
541
561
  getDefaultChatId,
542
562
  getDefaultTarget,
@@ -556,6 +576,8 @@ export function registerTelegramCommandsAndTools({
556
576
  sendMarkdownReply,
557
577
  recordRuntimeEvent,
558
578
  });
579
+ ChannelPosts.registerTelegramChannelPostMutationTool(pi, { mutate: mutateChannelPost });
580
+ ChannelPosts.registerTelegramChannelPostListTool(pi, { list: listChannelPosts });
559
581
  OutboundAttachments.registerTelegramOutboundAttachmentTool(pi, {
560
582
  getActiveTurn: activeTurnRuntime.get,
561
583
  getDefaultChatId,
@@ -578,6 +600,8 @@ export function registerTelegramCommandsAndTools({
578
600
  ),
579
601
  sendMarkdownMessage: (chatId, markdown, options) =>
580
602
  sendMarkdownReply(chatId, undefined, markdown, options),
603
+ sendChannelMarkdownMessage,
604
+ sendChannelMediaMessage,
581
605
  recordRuntimeEvent,
582
606
  });
583
607
  const queueAgentConnectionContext = (connected: boolean): void => {
@@ -636,7 +660,11 @@ export function registerTelegramCommandsAndTools({
636
660
  );
637
661
  }
638
662
  await configStore.load();
639
- configStore.setProfile(profileName, profile);
663
+ const latestProfile = configStore.getStoredConfig().profiles?.[profileName];
664
+ configStore.setProfile(profileName, {
665
+ ...profile,
666
+ threadDisplayMode: latestProfile?.threadDisplayMode,
667
+ });
640
668
  configStore.activateProfile(profileName);
641
669
  await onTransportChanged?.();
642
670
  await persistConfig(configStore.get());
@@ -653,6 +681,10 @@ export function registerTelegramCommandsAndTools({
653
681
  setConfig: setupConfigStore.set,
654
682
  setupGuard: setup,
655
683
  getMe: TelegramApi.fetchTelegramBotIdentity,
684
+ resolveBotToken: (value) =>
685
+ Config.resolveTelegramBotToken(value, process.env),
686
+ describeBotToken: (value) =>
687
+ Config.getTelegramBotTokenDiagnostic(value, process.env),
656
688
  persistConfig: persistSetupConfig,
657
689
  startPolling: lockedPollingRuntime.start,
658
690
  updateStatus,
@@ -669,17 +701,22 @@ export function registerTelegramCommandsAndTools({
669
701
  getStatusLines,
670
702
  reloadConfig: configStore.load,
671
703
  hasBotToken: configStore.hasBotToken,
704
+ getBotTokenDiagnostic: configStore.getBotTokenDiagnostic,
672
705
  startPolling: async (ctx, options) => {
706
+ setRequestedThreadNameForPollingStart?.(options?.requestedThreadName);
673
707
  try {
674
708
  return await lockedPollingRuntime.start(ctx, options);
675
709
  } catch (error) {
676
710
  recordRuntimeEvent("recovery", error, { phase: "polling-start" });
677
711
  throw error;
712
+ } finally {
713
+ setRequestedThreadNameForPollingStart?.(undefined);
678
714
  }
679
715
  },
680
716
  stopPolling: stopPolling ?? lockedPollingRuntime.stop,
681
717
  recoverPollingStart,
682
718
  getDisconnectThreadName,
719
+ validateThreadName,
683
720
  queueAgentConnectionContext,
684
721
  updateStatus,
685
722
  getProfileNames: () =>
@@ -780,6 +817,12 @@ interface TelegramLifecycleBindingDeps {
780
817
  Keyboard.TelegramInlineKeyboardMarkup
781
818
  >["sendGuestReply"]
782
819
  >;
820
+ editGuestReply?: Queue.TelegramAgentEndHookRuntimeDeps<
821
+ Queue.PendingTelegramTurn,
822
+ Pi.ExtensionContext,
823
+ Pi.AgentEndEvent["messages"][number],
824
+ Keyboard.TelegramInlineKeyboardMarkup
825
+ >["editGuestReply"];
783
826
  preparePreviewDelivery?: Queue.TelegramAgentEndRuntimeDeps<Queue.PendingTelegramTurn>["preparePreviewDelivery"];
784
827
  finalizeMarkdownPreview: Queue.TelegramAgentEndHookRuntimeDeps<
785
828
  Queue.PendingTelegramTurn,
@@ -832,6 +875,7 @@ export function registerTelegramLifecycleRuntimeHooks({
832
875
  answerGuestQuery,
833
876
  deleteMessage,
834
877
  sendGuestReply,
878
+ editGuestReply,
835
879
  preparePreviewDelivery,
836
880
  finalizeMarkdownPreview,
837
881
  proactivePushTargetGetter,
@@ -1045,6 +1089,7 @@ export function registerTelegramLifecycleRuntimeHooks({
1045
1089
  sendRichAttachmentReply: richAttachmentSender,
1046
1090
  answerGuestQuery,
1047
1091
  sendGuestReply,
1092
+ editGuestReply,
1048
1093
  sendGuestAttachment,
1049
1094
  sendGuestVoiceReply,
1050
1095
  planOutboundReply: outboundReplyPlanner,
@@ -8,11 +8,15 @@ import {
8
8
  markTelegramBusCrossTargetDelivery,
9
9
  stripTelegramBusApiMetadata,
10
10
  } from "./bus.ts";
11
- import { isTelegramMessageNotModifiedError } from "./telegram-api.ts";
11
+ import {
12
+ buildTelegramAnswerGuestQueryBody,
13
+ isTelegramMessageNotModifiedError,
14
+ } from "./telegram-api.ts";
12
15
  import type {
13
16
  TelegramAnswerGuestQueryOptions,
14
17
  TelegramApiCallOptions,
15
18
  TelegramBridgeApiRuntime,
19
+ TelegramEditGuestInlineMessageContent,
16
20
  TelegramEditMessageTextBody,
17
21
  TelegramSendMessageBody,
18
22
  TelegramSendMessageDraftBody,
@@ -342,24 +346,33 @@ export function createTelegramBusAwareApiRuntime(
342
346
  await deps.directRuntime.answerGuestQuery(guestQueryId, text, options);
343
347
  return;
344
348
  }
345
- const body: Record<string, unknown> = { guest_query_id: guestQueryId };
346
- if (options?.result) {
347
- body.result = options.result;
348
- } else if (text !== undefined || options?.richMessage) {
349
- const inputContent: Record<string, unknown> = options?.richMessage
350
- ? { rich_message: options.richMessage }
351
- : { message_text: text };
352
- if (!options?.richMessage && options?.parseMode) {
353
- inputContent.parse_mode = options.parseMode;
354
- }
355
- body.result = {
356
- type: "article",
357
- id: "1",
358
- title: "Response",
359
- input_message_content: inputContent,
360
- };
361
- }
362
- await deps.callFollowerApi("call", ["answerGuestQuery", body]);
349
+ await deps.callFollowerApi("call", [
350
+ "answerGuestQuery",
351
+ buildTelegramAnswerGuestQueryBody(guestQueryId, text, options),
352
+ ]);
353
+ },
354
+ answerGuestQueryForInlineMessage(
355
+ guestQueryId: string,
356
+ text?: string,
357
+ options?: TelegramAnswerGuestQueryOptions,
358
+ ): Promise<string | undefined> {
359
+ // Guest answers can only be edited while this instance owns direct
360
+ // transport; follower forwarding cannot preserve the inline message id.
361
+ return deps.ownsDirect()
362
+ ? deps.directRuntime.answerGuestQueryForInlineMessage(
363
+ guestQueryId,
364
+ text,
365
+ options,
366
+ )
367
+ : rejectTelegramDirectOwnership("answerGuestQueryForInlineMessage");
368
+ },
369
+ editGuestInlineMessage(
370
+ inlineMessageId: string,
371
+ content: TelegramEditGuestInlineMessageContent,
372
+ ): Promise<void> {
373
+ return deps.ownsDirect()
374
+ ? deps.directRuntime.editGuestInlineMessage(inlineMessageId, content)
375
+ : rejectTelegramDirectOwnership("editGuestInlineMessage");
363
376
  },
364
377
  async deleteMessage(chatId: number, messageId: number): Promise<void> {
365
378
  if (deps.ownsDirect())