@llblab/pi-telegram 0.44.0 → 0.45.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 (56) hide show
  1. package/AGENTS.md +14 -9
  2. package/BACKLOG.md +23 -5
  3. package/CHANGELOG.md +18 -0
  4. package/README.md +13 -9
  5. package/docs/README.md +1 -0
  6. package/docs/architecture.md +227 -23
  7. package/docs/generative-apps.md +1 -1
  8. package/docs/multi-instance-bus.md +70 -19
  9. package/docs/outbound.md +6 -6
  10. package/docs/public-api.md +13 -6
  11. package/docs/ui-style.md +3 -1
  12. package/index.ts +4 -1418
  13. package/lib/agent-messages.ts +6 -3
  14. package/lib/bindings.ts +46 -1
  15. package/lib/bus-api.ts +32 -19
  16. package/lib/bus-follower.ts +600 -135
  17. package/lib/bus-leader.ts +962 -55
  18. package/lib/bus.ts +355 -26
  19. package/lib/channel-posts.ts +718 -0
  20. package/lib/commands.ts +237 -11
  21. package/lib/config.ts +242 -26
  22. package/lib/extension.ts +1851 -0
  23. package/lib/generative-apps.ts +20 -2
  24. package/lib/journal.ts +2184 -126
  25. package/lib/locks.ts +44 -2
  26. package/lib/menu-settings.ts +152 -13
  27. package/lib/outbound-attachments.ts +97 -10
  28. package/lib/paths.ts +29 -0
  29. package/lib/polling.ts +85 -17
  30. package/lib/preview.ts +17 -0
  31. package/lib/prompts.ts +6 -2
  32. package/lib/queue.ts +118 -26
  33. package/lib/rendering.ts +4 -1
  34. package/lib/replies.ts +21 -2
  35. package/lib/routing.ts +344 -112
  36. package/lib/setup.ts +44 -4
  37. package/lib/status.ts +51 -4
  38. package/lib/sync.ts +308 -39
  39. package/lib/telegram-api.ts +353 -22
  40. package/lib/thread-cleanup-manager.ts +664 -0
  41. package/lib/thread-display.ts +226 -0
  42. package/lib/thread-naming.ts +118 -0
  43. package/lib/threads.ts +1686 -129
  44. package/lib/turns.ts +7 -0
  45. package/lib/updates.ts +1319 -97
  46. package/lib/workspace-admission.ts +1643 -0
  47. package/lib/workspace-retirement.ts +968 -0
  48. package/lib/workspace-slots.ts +84 -0
  49. package/package.json +1 -1
  50. package/screenshot.png +0 -0
  51. package/scripts/measure-bus.mjs +83 -0
  52. package/scripts/measure-workspace.mjs +101 -0
  53. package/skills/show-me/SKILL.md +166 -0
  54. package/skills/show-me/references/telegram-surfaces.md +43 -0
  55. package/skills/telegram-bridge/references/delivery-and-threads.md +1 -1
  56. /package/lib/{logs.ts → logging.ts} +0 -0
@@ -862,6 +862,22 @@ export function formatGenerativeAppToolError(error: unknown): Error {
862
862
  return new Error(`\n${message.replace(/^\n+/u, "") || "Generative App operation failed."}`);
863
863
  }
864
864
 
865
+ const TELEGRAM_BIND_JSON_ARGUMENT_REFERENCE = "#/$defs/TelegramBindJsonValue";
866
+ const TELEGRAM_BIND_JSON_ARGUMENT_SCHEMA = {
867
+ $ref: TELEGRAM_BIND_JSON_ARGUMENT_REFERENCE,
868
+ } as unknown as ReturnType<typeof Type.Unknown>;
869
+ const TELEGRAM_BIND_JSON_ARGUMENT_DEFINITION = {
870
+ anyOf: [
871
+ { type: "null" },
872
+ { type: "boolean" },
873
+ { type: "number" },
874
+ { type: "string" },
875
+ { type: "array", items: { $ref: TELEGRAM_BIND_JSON_ARGUMENT_REFERENCE } },
876
+ { type: "object", properties: {},
877
+ additionalProperties: { $ref: TELEGRAM_BIND_JSON_ARGUMENT_REFERENCE } },
878
+ ],
879
+ };
880
+
865
881
  export function registerTelegramBindTool(
866
882
  pi: ExtensionAPI,
867
883
  deps: TelegramBindToolRegistrationDeps,
@@ -877,8 +893,10 @@ export function registerTelegramBindTool(
877
893
  method: Type.Optional(Type.String()),
878
894
  replace: Type.Optional(Type.Boolean()),
879
895
  display: Type.Optional(Type.Boolean()),
880
- argument: Type.Optional(Type.Unknown()),
881
- }, { additionalProperties: false }),
896
+ argument: Type.Optional(TELEGRAM_BIND_JSON_ARGUMENT_SCHEMA),
897
+ }, { additionalProperties: false,
898
+ $defs: { TelegramBindJsonValue: TELEGRAM_BIND_JSON_ARGUMENT_DEFINITION },
899
+ }),
882
900
  async execute(_toolCallId, params) {
883
901
  try {
884
902
  const result = await bindGenerativeApp({