@llblab/pi-kit 0.12.1 → 0.14.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.
Files changed (299) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -2
  3. package/node_modules/@llblab/pi-state-flow/AGENTS.md +7 -7
  4. package/node_modules/@llblab/pi-state-flow/BACKLOG.md +8 -9
  5. package/node_modules/@llblab/pi-state-flow/CHANGELOG.md +26 -0
  6. package/node_modules/@llblab/pi-state-flow/README.md +1 -3
  7. package/node_modules/@llblab/pi-state-flow/dist/index.d.ts +21 -0
  8. package/node_modules/@llblab/pi-state-flow/dist/index.js +20 -0
  9. package/node_modules/@llblab/pi-state-flow/dist/lib/acquisition.d.ts +39 -0
  10. package/node_modules/@llblab/pi-state-flow/dist/lib/acquisition.js +78 -0
  11. package/node_modules/@llblab/pi-state-flow/dist/lib/artifact.d.ts +110 -0
  12. package/node_modules/@llblab/pi-state-flow/dist/lib/artifact.js +334 -0
  13. package/node_modules/@llblab/pi-state-flow/dist/lib/compaction.d.ts +49 -0
  14. package/node_modules/@llblab/pi-state-flow/dist/lib/compaction.js +67 -0
  15. package/node_modules/@llblab/pi-state-flow/dist/lib/config.d.ts +11 -0
  16. package/node_modules/@llblab/pi-state-flow/dist/lib/config.js +53 -0
  17. package/node_modules/@llblab/pi-state-flow/dist/lib/context.d.ts +23 -0
  18. package/node_modules/@llblab/pi-state-flow/dist/lib/context.js +109 -0
  19. package/node_modules/@llblab/pi-state-flow/dist/lib/continuation.d.ts +111 -0
  20. package/node_modules/@llblab/pi-state-flow/dist/lib/continuation.js +189 -0
  21. package/node_modules/@llblab/pi-state-flow/dist/lib/discovery.d.ts +21 -0
  22. package/node_modules/@llblab/pi-state-flow/dist/lib/discovery.js +125 -0
  23. package/node_modules/@llblab/pi-state-flow/dist/lib/durable.d.ts +102 -0
  24. package/node_modules/@llblab/pi-state-flow/dist/lib/durable.js +507 -0
  25. package/node_modules/@llblab/pi-state-flow/dist/lib/episode.d.ts +8 -0
  26. package/node_modules/@llblab/pi-state-flow/dist/lib/episode.js +27 -0
  27. package/node_modules/@llblab/pi-state-flow/dist/lib/extension.d.ts +22 -0
  28. package/node_modules/@llblab/pi-state-flow/dist/lib/extension.js +1263 -0
  29. package/node_modules/@llblab/pi-state-flow/dist/lib/git.d.ts +72 -0
  30. package/node_modules/@llblab/pi-state-flow/dist/lib/git.js +565 -0
  31. package/node_modules/@llblab/pi-state-flow/dist/lib/history.d.ts +22 -0
  32. package/node_modules/@llblab/pi-state-flow/dist/lib/history.js +79 -0
  33. package/node_modules/@llblab/pi-state-flow/dist/lib/json.d.ts +12 -0
  34. package/node_modules/@llblab/pi-state-flow/dist/lib/json.js +109 -0
  35. package/node_modules/@llblab/pi-state-flow/dist/lib/logging.d.ts +25 -0
  36. package/node_modules/@llblab/pi-state-flow/dist/lib/logging.js +24 -0
  37. package/node_modules/@llblab/pi-state-flow/dist/lib/maintenance.d.ts +36 -0
  38. package/node_modules/@llblab/pi-state-flow/dist/lib/maintenance.js +98 -0
  39. package/node_modules/@llblab/pi-state-flow/dist/lib/memory.d.ts +15 -0
  40. package/node_modules/@llblab/pi-state-flow/dist/lib/memory.js +42 -0
  41. package/node_modules/@llblab/pi-state-flow/dist/lib/migration.d.ts +13 -0
  42. package/node_modules/@llblab/pi-state-flow/dist/lib/migration.js +133 -0
  43. package/node_modules/@llblab/pi-state-flow/dist/lib/protocol.d.ts +7 -0
  44. package/node_modules/@llblab/pi-state-flow/dist/lib/protocol.js +59 -0
  45. package/node_modules/@llblab/pi-state-flow/dist/lib/publication.d.ts +69 -0
  46. package/node_modules/@llblab/pi-state-flow/dist/lib/publication.js +335 -0
  47. package/node_modules/@llblab/pi-state-flow/dist/lib/query.d.ts +27 -0
  48. package/node_modules/@llblab/pi-state-flow/dist/lib/query.js +35 -0
  49. package/node_modules/@llblab/pi-state-flow/dist/lib/recovery.d.ts +8 -0
  50. package/node_modules/@llblab/pi-state-flow/dist/lib/recovery.js +27 -0
  51. package/node_modules/@llblab/pi-state-flow/dist/lib/rehydration.d.ts +36 -0
  52. package/node_modules/@llblab/pi-state-flow/dist/lib/rehydration.js +38 -0
  53. package/node_modules/@llblab/pi-state-flow/dist/lib/runtime.d.ts +142 -0
  54. package/node_modules/@llblab/pi-state-flow/dist/lib/runtime.js +529 -0
  55. package/node_modules/@llblab/pi-state-flow/dist/lib/session.d.ts +21 -0
  56. package/node_modules/@llblab/pi-state-flow/dist/lib/session.js +44 -0
  57. package/node_modules/@llblab/pi-state-flow/dist/lib/skills.d.ts +25 -0
  58. package/node_modules/@llblab/pi-state-flow/dist/lib/skills.js +131 -0
  59. package/node_modules/@llblab/pi-state-flow/dist/lib/snapshot.d.ts +88 -0
  60. package/node_modules/@llblab/pi-state-flow/dist/lib/snapshot.js +255 -0
  61. package/node_modules/@llblab/pi-state-flow/dist/lib/state.d.ts +55 -0
  62. package/node_modules/@llblab/pi-state-flow/dist/lib/state.js +31 -0
  63. package/node_modules/@llblab/pi-state-flow/dist/lib/status.d.ts +38 -0
  64. package/node_modules/@llblab/pi-state-flow/dist/lib/status.js +79 -0
  65. package/node_modules/@llblab/pi-state-flow/dist/lib/storage.d.ts +46 -0
  66. package/node_modules/@llblab/pi-state-flow/dist/lib/storage.js +217 -0
  67. package/node_modules/@llblab/pi-state-flow/dist/lib/telegram.d.ts +98 -0
  68. package/node_modules/@llblab/pi-state-flow/dist/lib/telegram.js +231 -0
  69. package/node_modules/@llblab/pi-state-flow/dist/lib/temporal.d.ts +39 -0
  70. package/node_modules/@llblab/pi-state-flow/dist/lib/temporal.js +203 -0
  71. package/node_modules/@llblab/pi-state-flow/dist/lib/transition.d.ts +25 -0
  72. package/node_modules/@llblab/pi-state-flow/dist/lib/transition.js +204 -0
  73. package/node_modules/@llblab/pi-state-flow/dist/package.json +79 -0
  74. package/node_modules/@llblab/pi-state-flow/dist/pi-state-flow/index.js +1 -0
  75. package/node_modules/@llblab/pi-state-flow/dist/skills/state-flow-memory/SKILL.md +138 -0
  76. package/node_modules/@llblab/pi-state-flow/docs/architecture.md +11 -5
  77. package/node_modules/@llblab/pi-state-flow/docs/compatibility.md +5 -1
  78. package/node_modules/@llblab/pi-state-flow/docs/filesystem-recovery.md +3 -3
  79. package/node_modules/@llblab/pi-state-flow/docs/usage.md +6 -4
  80. package/node_modules/@llblab/pi-state-flow/index.ts +1 -0
  81. package/node_modules/@llblab/pi-state-flow/lib/compaction.ts +17 -1
  82. package/node_modules/@llblab/pi-state-flow/lib/config.ts +6 -1
  83. package/node_modules/@llblab/pi-state-flow/lib/durable.ts +88 -96
  84. package/node_modules/@llblab/pi-state-flow/lib/extension.ts +64 -12
  85. package/node_modules/@llblab/pi-state-flow/lib/git.ts +32 -188
  86. package/node_modules/@llblab/pi-state-flow/lib/migration.ts +84 -48
  87. package/node_modules/@llblab/pi-state-flow/lib/query.ts +40 -0
  88. package/node_modules/@llblab/pi-state-flow/lib/recovery.ts +7 -30
  89. package/node_modules/@llblab/pi-state-flow/lib/runtime.ts +48 -50
  90. package/node_modules/@llblab/pi-state-flow/lib/snapshot.ts +41 -97
  91. package/node_modules/@llblab/pi-state-flow/lib/storage.ts +17 -12
  92. package/node_modules/@llblab/pi-state-flow/lib/telegram.ts +4 -4
  93. package/node_modules/@llblab/pi-state-flow/package.json +23 -6
  94. package/node_modules/@llblab/pi-state-flow/skills/state-flow-memory/SKILL.md +3 -1
  95. package/node_modules/@llblab/pi-telegram/AGENTS.md +5 -3
  96. package/node_modules/@llblab/pi-telegram/BACKLOG.md +0 -6
  97. package/node_modules/@llblab/pi-telegram/CHANGELOG.md +22 -0
  98. package/node_modules/@llblab/pi-telegram/README.md +6 -3
  99. package/node_modules/@llblab/pi-telegram/dist/api/activity.d.ts +6 -0
  100. package/node_modules/@llblab/pi-telegram/dist/api/activity.js +6 -0
  101. package/node_modules/@llblab/pi-telegram/dist/api/commands.d.ts +6 -0
  102. package/node_modules/@llblab/pi-telegram/dist/api/commands.js +6 -0
  103. package/node_modules/@llblab/pi-telegram/dist/api/delivery.d.ts +6 -0
  104. package/node_modules/@llblab/pi-telegram/dist/api/delivery.js +6 -0
  105. package/node_modules/@llblab/pi-telegram/dist/api/inbound.d.ts +6 -0
  106. package/node_modules/@llblab/pi-telegram/dist/api/inbound.js +6 -0
  107. package/node_modules/@llblab/pi-telegram/dist/api/keyboard.d.ts +6 -0
  108. package/node_modules/@llblab/pi-telegram/dist/api/keyboard.js +6 -0
  109. package/node_modules/@llblab/pi-telegram/dist/api/outbound.d.ts +6 -0
  110. package/node_modules/@llblab/pi-telegram/dist/api/outbound.js +6 -0
  111. package/node_modules/@llblab/pi-telegram/dist/api/sections.d.ts +7 -0
  112. package/node_modules/@llblab/pi-telegram/dist/api/sections.js +6 -0
  113. package/node_modules/@llblab/pi-telegram/dist/api/status.d.ts +6 -0
  114. package/node_modules/@llblab/pi-telegram/dist/api/status.js +6 -0
  115. package/node_modules/@llblab/pi-telegram/dist/api/updates.d.ts +6 -0
  116. package/node_modules/@llblab/pi-telegram/dist/api/updates.js +6 -0
  117. package/node_modules/@llblab/pi-telegram/dist/api/voice.d.ts +6 -0
  118. package/node_modules/@llblab/pi-telegram/dist/api/voice.js +6 -0
  119. package/node_modules/@llblab/pi-telegram/dist/index.d.ts +6 -0
  120. package/node_modules/@llblab/pi-telegram/dist/index.js +6 -0
  121. package/node_modules/@llblab/pi-telegram/dist/lib/activity-verbosity.d.ts +52 -0
  122. package/node_modules/@llblab/pi-telegram/dist/lib/activity-verbosity.js +596 -0
  123. package/node_modules/@llblab/pi-telegram/dist/lib/activity.d.ts +220 -0
  124. package/node_modules/@llblab/pi-telegram/dist/lib/activity.js +574 -0
  125. package/node_modules/@llblab/pi-telegram/dist/lib/agent-messages.d.ts +28 -0
  126. package/node_modules/@llblab/pi-telegram/dist/lib/agent-messages.js +86 -0
  127. package/node_modules/@llblab/pi-telegram/dist/lib/bindings.d.ts +250 -0
  128. package/node_modules/@llblab/pi-telegram/dist/lib/bindings.js +936 -0
  129. package/node_modules/@llblab/pi-telegram/dist/lib/bus-api.d.ts +18 -0
  130. package/node_modules/@llblab/pi-telegram/dist/lib/bus-api.js +254 -0
  131. package/node_modules/@llblab/pi-telegram/dist/lib/bus-follower.d.ts +464 -0
  132. package/node_modules/@llblab/pi-telegram/dist/lib/bus-follower.js +1689 -0
  133. package/node_modules/@llblab/pi-telegram/dist/lib/bus-leader.d.ts +292 -0
  134. package/node_modules/@llblab/pi-telegram/dist/lib/bus-leader.js +2242 -0
  135. package/node_modules/@llblab/pi-telegram/dist/lib/bus-transport.d.ts +64 -0
  136. package/node_modules/@llblab/pi-telegram/dist/lib/bus-transport.js +140 -0
  137. package/node_modules/@llblab/pi-telegram/dist/lib/bus.d.ts +518 -0
  138. package/node_modules/@llblab/pi-telegram/dist/lib/bus.js +2055 -0
  139. package/node_modules/@llblab/pi-telegram/dist/lib/channel-posts.d.ts +170 -0
  140. package/node_modules/@llblab/pi-telegram/dist/lib/channel-posts.js +611 -0
  141. package/node_modules/@llblab/pi-telegram/dist/lib/command-templates.d.ts +70 -0
  142. package/node_modules/@llblab/pi-telegram/dist/lib/command-templates.js +744 -0
  143. package/node_modules/@llblab/pi-telegram/dist/lib/commands.d.ts +541 -0
  144. package/node_modules/@llblab/pi-telegram/dist/lib/commands.js +1155 -0
  145. package/node_modules/@llblab/pi-telegram/dist/lib/config.d.ts +252 -0
  146. package/node_modules/@llblab/pi-telegram/dist/lib/config.js +889 -0
  147. package/node_modules/@llblab/pi-telegram/dist/lib/delivery.d.ts +163 -0
  148. package/node_modules/@llblab/pi-telegram/dist/lib/delivery.js +542 -0
  149. package/node_modules/@llblab/pi-telegram/dist/lib/extension.d.ts +7 -0
  150. package/node_modules/@llblab/pi-telegram/dist/lib/extension.js +1604 -0
  151. package/node_modules/@llblab/pi-telegram/dist/lib/generative-app-worker.mjs +104 -0
  152. package/node_modules/@llblab/pi-telegram/dist/lib/generative-apps.d.ts +212 -0
  153. package/node_modules/@llblab/pi-telegram/dist/lib/generative-apps.js +1006 -0
  154. package/node_modules/@llblab/pi-telegram/dist/lib/inbound.d.ts +91 -0
  155. package/node_modules/@llblab/pi-telegram/dist/lib/inbound.js +502 -0
  156. package/node_modules/@llblab/pi-telegram/dist/lib/journal.d.ts +665 -0
  157. package/node_modules/@llblab/pi-telegram/dist/lib/journal.js +3701 -0
  158. package/node_modules/@llblab/pi-telegram/dist/lib/keyboard.d.ts +23 -0
  159. package/node_modules/@llblab/pi-telegram/dist/lib/keyboard.js +37 -0
  160. package/node_modules/@llblab/pi-telegram/dist/lib/lifecycle.d.ts +157 -0
  161. package/node_modules/@llblab/pi-telegram/dist/lib/lifecycle.js +395 -0
  162. package/node_modules/@llblab/pi-telegram/dist/lib/locks.d.ts +164 -0
  163. package/node_modules/@llblab/pi-telegram/dist/lib/locks.js +1208 -0
  164. package/node_modules/@llblab/pi-telegram/dist/lib/logging.d.ts +50 -0
  165. package/node_modules/@llblab/pi-telegram/dist/lib/logging.js +274 -0
  166. package/node_modules/@llblab/pi-telegram/dist/lib/media.d.ts +181 -0
  167. package/node_modules/@llblab/pi-telegram/dist/lib/media.js +602 -0
  168. package/node_modules/@llblab/pi-telegram/dist/lib/menu-model.d.ts +217 -0
  169. package/node_modules/@llblab/pi-telegram/dist/lib/menu-model.js +663 -0
  170. package/node_modules/@llblab/pi-telegram/dist/lib/menu-queue.d.ts +37 -0
  171. package/node_modules/@llblab/pi-telegram/dist/lib/menu-queue.js +408 -0
  172. package/node_modules/@llblab/pi-telegram/dist/lib/menu-settings.d.ts +115 -0
  173. package/node_modules/@llblab/pi-telegram/dist/lib/menu-settings.js +595 -0
  174. package/node_modules/@llblab/pi-telegram/dist/lib/menu-status.d.ts +32 -0
  175. package/node_modules/@llblab/pi-telegram/dist/lib/menu-status.js +112 -0
  176. package/node_modules/@llblab/pi-telegram/dist/lib/menu-thinking.d.ts +29 -0
  177. package/node_modules/@llblab/pi-telegram/dist/lib/menu-thinking.js +82 -0
  178. package/node_modules/@llblab/pi-telegram/dist/lib/menu.d.ts +171 -0
  179. package/node_modules/@llblab/pi-telegram/dist/lib/menu.js +323 -0
  180. package/node_modules/@llblab/pi-telegram/dist/lib/model.d.ts +127 -0
  181. package/node_modules/@llblab/pi-telegram/dist/lib/model.js +409 -0
  182. package/node_modules/@llblab/pi-telegram/dist/lib/outbound-attachments.d.ts +241 -0
  183. package/node_modules/@llblab/pi-telegram/dist/lib/outbound-attachments.js +639 -0
  184. package/node_modules/@llblab/pi-telegram/dist/lib/outbound-buttons.d.ts +69 -0
  185. package/node_modules/@llblab/pi-telegram/dist/lib/outbound-buttons.js +248 -0
  186. package/node_modules/@llblab/pi-telegram/dist/lib/outbound-markup.d.ts +42 -0
  187. package/node_modules/@llblab/pi-telegram/dist/lib/outbound-markup.js +678 -0
  188. package/node_modules/@llblab/pi-telegram/dist/lib/outbound-voice.d.ts +55 -0
  189. package/node_modules/@llblab/pi-telegram/dist/lib/outbound-voice.js +152 -0
  190. package/node_modules/@llblab/pi-telegram/dist/lib/outbound.d.ts +185 -0
  191. package/node_modules/@llblab/pi-telegram/dist/lib/outbound.js +516 -0
  192. package/node_modules/@llblab/pi-telegram/dist/lib/ownership.d.ts +77 -0
  193. package/node_modules/@llblab/pi-telegram/dist/lib/ownership.js +174 -0
  194. package/node_modules/@llblab/pi-telegram/dist/lib/paths.d.ts +40 -0
  195. package/node_modules/@llblab/pi-telegram/dist/lib/paths.js +94 -0
  196. package/node_modules/@llblab/pi-telegram/dist/lib/pi.d.ts +72 -0
  197. package/node_modules/@llblab/pi-telegram/dist/lib/pi.js +121 -0
  198. package/node_modules/@llblab/pi-telegram/dist/lib/polling.d.ts +351 -0
  199. package/node_modules/@llblab/pi-telegram/dist/lib/polling.js +1196 -0
  200. package/node_modules/@llblab/pi-telegram/dist/lib/preview.d.ts +192 -0
  201. package/node_modules/@llblab/pi-telegram/dist/lib/preview.js +614 -0
  202. package/node_modules/@llblab/pi-telegram/dist/lib/prompt-templates.d.ts +24 -0
  203. package/node_modules/@llblab/pi-telegram/dist/lib/prompt-templates.js +118 -0
  204. package/node_modules/@llblab/pi-telegram/dist/lib/prompts.d.ts +57 -0
  205. package/node_modules/@llblab/pi-telegram/dist/lib/prompts.js +167 -0
  206. package/node_modules/@llblab/pi-telegram/dist/lib/queue.d.ts +766 -0
  207. package/node_modules/@llblab/pi-telegram/dist/lib/queue.js +1965 -0
  208. package/node_modules/@llblab/pi-telegram/dist/lib/recovery.d.ts +86 -0
  209. package/node_modules/@llblab/pi-telegram/dist/lib/recovery.js +285 -0
  210. package/node_modules/@llblab/pi-telegram/dist/lib/rendering.d.ts +20 -0
  211. package/node_modules/@llblab/pi-telegram/dist/lib/rendering.js +983 -0
  212. package/node_modules/@llblab/pi-telegram/dist/lib/replies.d.ts +214 -0
  213. package/node_modules/@llblab/pi-telegram/dist/lib/replies.js +737 -0
  214. package/node_modules/@llblab/pi-telegram/dist/lib/routing.d.ts +207 -0
  215. package/node_modules/@llblab/pi-telegram/dist/lib/routing.js +2282 -0
  216. package/node_modules/@llblab/pi-telegram/dist/lib/runtime.d.ts +172 -0
  217. package/node_modules/@llblab/pi-telegram/dist/lib/runtime.js +402 -0
  218. package/node_modules/@llblab/pi-telegram/dist/lib/sections.d.ts +165 -0
  219. package/node_modules/@llblab/pi-telegram/dist/lib/sections.js +327 -0
  220. package/node_modules/@llblab/pi-telegram/dist/lib/setup.d.ts +82 -0
  221. package/node_modules/@llblab/pi-telegram/dist/lib/setup.js +150 -0
  222. package/node_modules/@llblab/pi-telegram/dist/lib/skills.d.ts +8 -0
  223. package/node_modules/@llblab/pi-telegram/dist/lib/skills.js +12 -0
  224. package/node_modules/@llblab/pi-telegram/dist/lib/status.d.ts +442 -0
  225. package/node_modules/@llblab/pi-telegram/dist/lib/status.js +1000 -0
  226. package/node_modules/@llblab/pi-telegram/dist/lib/sync.d.ts +179 -0
  227. package/node_modules/@llblab/pi-telegram/dist/lib/sync.js +782 -0
  228. package/node_modules/@llblab/pi-telegram/dist/lib/target.d.ts +20 -0
  229. package/node_modules/@llblab/pi-telegram/dist/lib/target.js +27 -0
  230. package/node_modules/@llblab/pi-telegram/dist/lib/telegram-api.d.ts +541 -0
  231. package/node_modules/@llblab/pi-telegram/dist/lib/telegram-api.js +1159 -0
  232. package/node_modules/@llblab/pi-telegram/dist/lib/text-groups.d.ts +89 -0
  233. package/node_modules/@llblab/pi-telegram/dist/lib/text-groups.js +317 -0
  234. package/node_modules/@llblab/pi-telegram/dist/lib/thread-cleanup-manager.d.ts +288 -0
  235. package/node_modules/@llblab/pi-telegram/dist/lib/thread-cleanup-manager.js +560 -0
  236. package/node_modules/@llblab/pi-telegram/dist/lib/thread-display.d.ts +46 -0
  237. package/node_modules/@llblab/pi-telegram/dist/lib/thread-display.js +257 -0
  238. package/node_modules/@llblab/pi-telegram/dist/lib/thread-naming.d.ts +46 -0
  239. package/node_modules/@llblab/pi-telegram/dist/lib/thread-naming.js +78 -0
  240. package/node_modules/@llblab/pi-telegram/dist/lib/thread-reconciler.d.ts +239 -0
  241. package/node_modules/@llblab/pi-telegram/dist/lib/thread-reconciler.js +644 -0
  242. package/node_modules/@llblab/pi-telegram/dist/lib/threads.d.ts +621 -0
  243. package/node_modules/@llblab/pi-telegram/dist/lib/threads.js +3679 -0
  244. package/node_modules/@llblab/pi-telegram/dist/lib/time-injection.d.ts +15 -0
  245. package/node_modules/@llblab/pi-telegram/dist/lib/time-injection.js +56 -0
  246. package/node_modules/@llblab/pi-telegram/dist/lib/turns.d.ts +109 -0
  247. package/node_modules/@llblab/pi-telegram/dist/lib/turns.js +500 -0
  248. package/node_modules/@llblab/pi-telegram/dist/lib/updates.d.ts +1290 -0
  249. package/node_modules/@llblab/pi-telegram/dist/lib/updates.js +3634 -0
  250. package/node_modules/@llblab/pi-telegram/dist/lib/voice.d.ts +117 -0
  251. package/node_modules/@llblab/pi-telegram/dist/lib/voice.js +174 -0
  252. package/node_modules/@llblab/pi-telegram/dist/lib/workspace-admission.d.ts +264 -0
  253. package/node_modules/@llblab/pi-telegram/dist/lib/workspace-admission.js +1136 -0
  254. package/node_modules/@llblab/pi-telegram/dist/lib/workspace-retirement.d.ts +219 -0
  255. package/node_modules/@llblab/pi-telegram/dist/lib/workspace-retirement.js +587 -0
  256. package/node_modules/@llblab/pi-telegram/dist/lib/workspace-slots.d.ts +30 -0
  257. package/node_modules/@llblab/pi-telegram/dist/lib/workspace-slots.js +54 -0
  258. package/node_modules/@llblab/pi-telegram/dist/package.json +126 -0
  259. package/node_modules/@llblab/pi-telegram/dist/pi-telegram/index.js +1 -0
  260. package/node_modules/@llblab/pi-telegram/dist/skills/generated-control-surface/SKILL.md +107 -0
  261. package/node_modules/@llblab/pi-telegram/dist/skills/generated-control-surface/references/capability-adapters.md +27 -0
  262. package/node_modules/@llblab/pi-telegram/dist/skills/generated-control-surface/references/layout-and-state.md +37 -0
  263. package/node_modules/@llblab/pi-telegram/dist/skills/generative-apps/SKILL.md +115 -0
  264. package/node_modules/@llblab/pi-telegram/dist/skills/show-me/SKILL.md +166 -0
  265. package/node_modules/@llblab/pi-telegram/dist/skills/show-me/references/telegram-surfaces.md +43 -0
  266. package/node_modules/@llblab/pi-telegram/dist/skills/telegram-bridge/SKILL.md +129 -0
  267. package/node_modules/@llblab/pi-telegram/dist/skills/telegram-bridge/references/configuration.md +15 -0
  268. package/node_modules/@llblab/pi-telegram/dist/skills/telegram-bridge/references/delivery-and-threads.md +27 -0
  269. package/node_modules/@llblab/pi-telegram/dist/skills/telegram-bridge/references/diagnosis.md +18 -0
  270. package/node_modules/@llblab/pi-telegram/docs/README.md +2 -0
  271. package/node_modules/@llblab/pi-telegram/docs/architecture.md +4 -2
  272. package/node_modules/@llblab/pi-telegram/docs/compact-matrix-literal.md +10 -3
  273. package/node_modules/@llblab/pi-telegram/docs/generative-apps.md +15 -13
  274. package/node_modules/@llblab/pi-telegram/docs/multi-instance-bus.md +6 -4
  275. package/node_modules/@llblab/pi-telegram/docs/outbound.md +1 -1
  276. package/node_modules/@llblab/pi-telegram/docs/public-api.md +3 -3
  277. package/node_modules/@llblab/pi-telegram/lib/bindings.ts +89 -6
  278. package/node_modules/@llblab/pi-telegram/lib/bus-follower.ts +12 -5
  279. package/node_modules/@llblab/pi-telegram/lib/bus-leader.ts +44 -19
  280. package/node_modules/@llblab/pi-telegram/lib/bus.ts +4 -1
  281. package/node_modules/@llblab/pi-telegram/lib/commands.ts +2 -2
  282. package/node_modules/@llblab/pi-telegram/lib/config.ts +14 -7
  283. package/node_modules/@llblab/pi-telegram/lib/delivery.ts +38 -6
  284. package/node_modules/@llblab/pi-telegram/lib/extension.ts +7 -0
  285. package/node_modules/@llblab/pi-telegram/lib/generative-apps.ts +379 -13
  286. package/node_modules/@llblab/pi-telegram/lib/menu-settings.ts +20 -6
  287. package/node_modules/@llblab/pi-telegram/lib/outbound-markup.ts +16 -7
  288. package/node_modules/@llblab/pi-telegram/lib/status.ts +9 -15
  289. package/node_modules/@llblab/pi-telegram/lib/telegram-api.ts +12 -1
  290. package/node_modules/@llblab/pi-telegram/lib/thread-display.ts +96 -18
  291. package/node_modules/@llblab/pi-telegram/package.json +56 -13
  292. package/node_modules/@llblab/pi-telegram/scripts/build-dist.mjs +44 -0
  293. package/node_modules/@llblab/pi-telegram/scripts/measure-bus.mjs +8 -1
  294. package/node_modules/@llblab/pi-telegram/scripts/measure-workspace.mjs +8 -1
  295. package/node_modules/@llblab/pi-telegram/skills/generative-apps/SKILL.md +1 -1
  296. package/node_modules/@llblab/pi-telegram/skills/show-me/SKILL.md +1 -1
  297. package/node_modules/@llblab/pi-telegram/skills/show-me/references/telegram-surfaces.md +1 -1
  298. package/node_modules/@llblab/pi-telegram/skills/telegram-bridge/SKILL.md +1 -1
  299. package/package.json +7 -7
@@ -0,0 +1,219 @@
1
+ /**
2
+ * Workspace retirement preparation
3
+ * Zones: telegram, workspace identity, lifecycle
4
+ * Owns fail-closed protection composition, pressure selection, exact-intent admission,
5
+ * successor adoption, and gated mocked deletion with durable retirement commit.
6
+ */
7
+ import type { TelegramTarget } from "./target.ts";
8
+ import type { TelegramTopicTargetStore, TelegramWorkspaceExternalProtectionEvidence, TelegramWorkspaceRetirementIntent, TelegramWorkspaceProtectionState, TelegramWorkspaceThreadBinding } from "./threads.ts";
9
+ import { type TelegramWorkspaceAdmissionLedger, type TelegramWorkspaceAdmissionScope, type TelegramWorkspaceDeletionPermit } from "./workspace-admission.ts";
10
+ export interface TelegramWorkspaceOperationGate {
11
+ runExclusive: <T>(operation: () => Promise<T>) => Promise<T>;
12
+ }
13
+ export declare function createTelegramWorkspaceOperationGate(): TelegramWorkspaceOperationGate;
14
+ export type TelegramWorkspaceOperationRunner = <T>(input: {
15
+ operationId: string;
16
+ operationKind: string;
17
+ scopes: readonly TelegramWorkspaceAdmissionScope[];
18
+ }, operation: () => Promise<T>) => Promise<T>;
19
+ export interface TelegramWorkspaceOperationRuntime extends TelegramWorkspaceOperationGate {
20
+ run: TelegramWorkspaceOperationRunner;
21
+ }
22
+ export declare function createTelegramWorkspaceOperationRuntime(input?: {
23
+ getWorkspaceAdmission?: () => Pick<TelegramWorkspaceAdmissionLedger, "acquireAdmission" | "releaseAdmission"> | undefined;
24
+ onReleaseError?: (error: unknown, operationKind: string) => void;
25
+ }): TelegramWorkspaceOperationRuntime;
26
+ export interface TelegramWorkspaceJournalProtectionCapture {
27
+ sources: TelegramWorkspaceJournalProtectionSource[];
28
+ complete: boolean;
29
+ }
30
+ interface TelegramWorkspaceJournalReader {
31
+ recoveryKey?: string;
32
+ journal: {
33
+ read: () => {
34
+ entries: readonly {
35
+ update: unknown;
36
+ }[];
37
+ };
38
+ };
39
+ }
40
+ export declare function captureTelegramWorkspaceJournalProtectionSources(input: {
41
+ binding: TelegramWorkspaceThreadBinding;
42
+ resolveLeader: () => TelegramWorkspaceJournalReader | undefined;
43
+ createFollowerResolver: (journalBindingKey: string) => () => TelegramWorkspaceJournalReader | undefined;
44
+ withJournalReference?: <T>(binding: TelegramWorkspaceJournalReader, operation: () => T) => T;
45
+ discovery?: {
46
+ paths: readonly string[];
47
+ complete: boolean;
48
+ createResolver: (path: string) => () => TelegramWorkspaceJournalReader | undefined;
49
+ };
50
+ }): TelegramWorkspaceJournalProtectionCapture;
51
+ export type TelegramWorkspaceJournalProtectionSource = {
52
+ kind: "available";
53
+ scope: {
54
+ kind: "shared";
55
+ } | {
56
+ kind: "binding";
57
+ bindingKey: string;
58
+ journalBindingKey: string;
59
+ } | {
60
+ kind: "discovered";
61
+ path: string;
62
+ };
63
+ entries: readonly {
64
+ update: unknown;
65
+ }[];
66
+ } | {
67
+ kind: "unknown";
68
+ scope: {
69
+ kind: "shared";
70
+ } | {
71
+ kind: "binding";
72
+ bindingKey: string;
73
+ journalBindingKey: string;
74
+ } | {
75
+ kind: "discovered";
76
+ path: string;
77
+ };
78
+ };
79
+ export declare function resolveTelegramWorkspaceAcceptedWorkProtection(input: {
80
+ binding: TelegramWorkspaceThreadBinding;
81
+ localAcceptedTargets: readonly {
82
+ chatId: number;
83
+ threadId?: number;
84
+ }[];
85
+ journalSources: readonly TelegramWorkspaceJournalProtectionSource[];
86
+ sourcesComplete: boolean;
87
+ }): TelegramWorkspaceProtectionState;
88
+ export type TelegramWorkspaceJournalPruneResult = {
89
+ kind: "committed";
90
+ binding: TelegramWorkspaceThreadBinding;
91
+ removedKeys: string[];
92
+ } | {
93
+ kind: "blocked";
94
+ reason: "incomplete-evidence" | "writer-not-quiescent" | "state-changed";
95
+ };
96
+ export declare function pruneTelegramWorkspaceJournalEvidence(input: {
97
+ store: Pick<TelegramTopicTargetStore, "commitWorkspaceJournalEvidence" | "persist">;
98
+ binding: TelegramWorkspaceThreadBinding;
99
+ capture: TelegramWorkspaceJournalProtectionCapture;
100
+ getJournalWriterProtection: (journalBindingKey: string) => TelegramWorkspaceProtectionState;
101
+ getLeaderEpoch: () => number | string | undefined;
102
+ getProfileKey: () => string;
103
+ admission: Pick<TelegramWorkspaceAdmissionLedger, "acquireAdmission" | "releaseAdmission">;
104
+ isCurrent?: () => boolean;
105
+ onAdmissionReleaseError?: (error: unknown) => void;
106
+ }): Promise<TelegramWorkspaceJournalPruneResult>;
107
+ export declare function captureTelegramWorkspaceExternalProtection(input: {
108
+ binding: TelegramWorkspaceThreadBinding;
109
+ getLiveOwnerProtection: (binding: TelegramWorkspaceThreadBinding) => TelegramWorkspaceProtectionState;
110
+ getLocalAcceptedTargets: (binding: TelegramWorkspaceThreadBinding) => {
111
+ targets: readonly TelegramTarget[];
112
+ complete: boolean;
113
+ };
114
+ captureJournalSources: (binding: TelegramWorkspaceThreadBinding) => TelegramWorkspaceJournalProtectionCapture;
115
+ getDeliveryAuthorityProtection?: (binding: TelegramWorkspaceThreadBinding) => TelegramWorkspaceProtectionState;
116
+ }): TelegramWorkspaceExternalProtectionEvidence;
117
+ export declare function createTelegramWorkspaceExternalProtectionCapture(deps: {
118
+ listFollowers: () => readonly {
119
+ target?: TelegramTarget;
120
+ }[];
121
+ getActiveTurnTarget: () => TelegramTarget | undefined;
122
+ getQueuedItems: () => readonly {
123
+ chatId: number;
124
+ target?: TelegramTarget;
125
+ }[];
126
+ resolveLeaderJournal: () => TelegramWorkspaceJournalReader | undefined;
127
+ createFollowerJournalResolver: (journalBindingKey: string) => () => TelegramWorkspaceJournalReader | undefined;
128
+ discoverFollowerJournals?: () => {
129
+ paths: readonly string[];
130
+ complete: boolean;
131
+ };
132
+ createJournalPathResolver?: (path: string) => () => TelegramWorkspaceJournalReader | undefined;
133
+ withJournalReference?: <T>(binding: TelegramWorkspaceJournalReader, operation: () => T) => T;
134
+ getJournalWriterProtection?: (journalBindingKey: string) => TelegramWorkspaceProtectionState;
135
+ getDeliveryAuthorityProtection?: (binding: TelegramWorkspaceThreadBinding) => TelegramWorkspaceProtectionState;
136
+ }): (binding: TelegramWorkspaceThreadBinding) => TelegramWorkspaceExternalProtectionEvidence;
137
+ export type TelegramWorkspaceRetirementAdoption = {
138
+ kind: "adopted";
139
+ intent: TelegramWorkspaceRetirementIntent;
140
+ } | {
141
+ kind: "blocked";
142
+ reason: "intent-conflict" | "profile-changed" | "binding-changed" | "protection-changed" | "commit-rejected";
143
+ };
144
+ export declare function adoptTelegramWorkspaceRetirementIntent(input: {
145
+ store: Pick<TelegramTopicTargetStore, "captureWorkspaceSlotOccupancy" | "listWorkspaceBindings" | "listWorkspaceRetirementIntents" | "replaceWorkspaceRetirementIntent">;
146
+ intent: TelegramWorkspaceRetirementIntent;
147
+ getExternalProtection: (binding: TelegramWorkspaceThreadBinding) => TelegramWorkspaceExternalProtectionEvidence;
148
+ getLeaderEpoch: () => number | string | undefined;
149
+ getProfileKey: () => string;
150
+ isCurrent?: () => boolean;
151
+ runExclusive: <T>(operation: () => Promise<T>) => Promise<T>;
152
+ }): Promise<TelegramWorkspaceRetirementAdoption>;
153
+ export type TelegramWorkspaceRetirementExecution = {
154
+ kind: "retired";
155
+ bindingKey: string;
156
+ slot: string;
157
+ } | {
158
+ kind: "retained";
159
+ reason: "stale-intent" | "protection-changed" | "admission-active" | "fence-conflict" | "delete-unconfirmed" | "authority-changed" | "commit-rejected" | "fence-release-unconfirmed";
160
+ };
161
+ export type TelegramWorkspaceRetirementAbsence = "absent" | "present" | "unknown";
162
+ export declare function executeTelegramWorkspaceRetirement(input: {
163
+ store: Pick<TelegramTopicTargetStore, "captureWorkspaceSlotOccupancy" | "listWorkspaceBindings" | "listWorkspaceRetirementIntents" | "commitWorkspaceRetirement">;
164
+ admission: Pick<TelegramWorkspaceAdmissionLedger, "getOwner" | "read" | "acquireRetirementFence" | "adoptRetirementFence" | "issueDeletionPermit" | "confirmRetirementAbsence" | "releaseUnissuedRetirementFence" | "completeRetirementFence">;
165
+ intent: TelegramWorkspaceRetirementIntent;
166
+ getExternalProtection: (binding: TelegramWorkspaceThreadBinding) => TelegramWorkspaceExternalProtectionEvidence;
167
+ getLeaderEpoch: () => number | string | undefined;
168
+ getProfileKey: () => string;
169
+ isCurrent?: () => boolean;
170
+ runExclusive: <T>(operation: () => Promise<T>) => Promise<T>;
171
+ deleteForumTopic: (permit: TelegramWorkspaceDeletionPermit, body: {
172
+ chat_id: number;
173
+ message_thread_id: number;
174
+ }, options: {
175
+ maxAttempts: 1;
176
+ }) => Promise<unknown>;
177
+ confirmTargetAbsent?: (target: TelegramTarget & {
178
+ threadId: number;
179
+ }) => Promise<TelegramWorkspaceRetirementAbsence>;
180
+ }): Promise<TelegramWorkspaceRetirementExecution>;
181
+ export type TelegramWorkspaceRetirementPreparation = {
182
+ kind: "ready";
183
+ intent: TelegramWorkspaceRetirementIntent;
184
+ } | {
185
+ kind: "not-needed";
186
+ reason: "free-capacity";
187
+ } | {
188
+ kind: "blocked";
189
+ reason: "invalid-state" | "protected-capacity" | "state-changed" | "existing-intent-conflict" | "stale-intent";
190
+ };
191
+ export interface TelegramWorkspaceRetirementPreparationDeps {
192
+ store: Pick<TelegramTopicTargetStore, "captureWorkspaceSlotOccupancy" | "listWorkspaceBindings" | "listWorkspaceRetirementIntents" | "upsertWorkspaceRetirementIntent" | "removeWorkspaceRetirementIntent" | "persist">;
193
+ getExternalProtection: (binding: TelegramWorkspaceThreadBinding) => TelegramWorkspaceExternalProtectionEvidence;
194
+ getLeaderEpoch: () => number | string | undefined;
195
+ getProfileKey: () => string;
196
+ isCurrent?: () => boolean;
197
+ getNowMs?: () => number;
198
+ }
199
+ export declare function prepareTelegramWorkspaceRetirement(deps: TelegramWorkspaceRetirementPreparationDeps): Promise<TelegramWorkspaceRetirementPreparation>;
200
+ export type TelegramWorkspaceRetirementLifecycleResult = TelegramWorkspaceRetirementExecution | Extract<TelegramWorkspaceRetirementPreparation, {
201
+ kind: "not-needed";
202
+ }> | {
203
+ kind: "blocked";
204
+ stage: "preparation" | "adoption";
205
+ reason: string;
206
+ };
207
+ export declare function runTelegramWorkspaceRetirementLifecycle(input: {
208
+ store: TelegramWorkspaceRetirementPreparationDeps["store"] & Pick<TelegramTopicTargetStore, "replaceWorkspaceRetirementIntent" | "commitWorkspaceRetirement">;
209
+ getExternalProtection: (binding: TelegramWorkspaceThreadBinding) => TelegramWorkspaceExternalProtectionEvidence;
210
+ getLeaderEpoch: () => number | string | undefined;
211
+ getProfileKey: () => string;
212
+ isCurrent?: () => boolean;
213
+ getNowMs?: () => number;
214
+ runExclusive: <T>(operation: () => Promise<T>) => Promise<T>;
215
+ admission: Parameters<typeof executeTelegramWorkspaceRetirement>[0]["admission"];
216
+ deleteForumTopic: Parameters<typeof executeTelegramWorkspaceRetirement>[0]["deleteForumTopic"];
217
+ confirmTargetAbsent?: Parameters<typeof executeTelegramWorkspaceRetirement>[0]["confirmTargetAbsent"];
218
+ }): Promise<TelegramWorkspaceRetirementLifecycleResult>;
219
+ export {};