@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
package/lib/turns.ts CHANGED
@@ -41,6 +41,9 @@ import {
41
41
 
42
42
  export const TELEGRAM_PREFIX = "[telegram]";
43
43
 
44
+ export const TELEGRAM_GUEST_TURN_NOTE =
45
+ "[guest] delivery: answer quickly with one concise, self-contained reply";
46
+
44
47
  export interface TelegramTurnTarget {
45
48
  chatId: number;
46
49
  threadId?: number;
@@ -198,6 +201,7 @@ export function buildTelegramTurnPrompt(options: {
198
201
  historyTurns?: Pick<PendingTelegramTurn, "historyText">[];
199
202
  timeLine?: string | null;
200
203
  voiceContext?: Record<string, string>;
204
+ guestTurn?: boolean;
201
205
  }): string {
202
206
  let prompt = options.telegramPrefix;
203
207
  if ((options.historyTurns?.length ?? 0) > 0) {
@@ -229,6 +233,9 @@ export function buildTelegramTurnPrompt(options: {
229
233
  if (options.timeLine) {
230
234
  prompt = `${prompt}\n\n[time] ${options.timeLine}`;
231
235
  }
236
+ if (options.guestTurn) {
237
+ prompt = `${prompt}\n\n${TELEGRAM_GUEST_TURN_NOTE}`;
238
+ }
232
239
  return prompt;
233
240
  }
234
241