@rubytech/create-maxy-code 0.1.592 → 0.1.594

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 (339) hide show
  1. package/package.json +2 -2
  2. package/payload/platform/package.json +1 -0
  3. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +11 -5
  4. package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +11 -0
  5. package/payload/platform/plugins/cloudflare/PLUGIN.md +2 -0
  6. package/payload/platform/plugins/docs/references/internals.md +5 -3
  7. package/payload/platform/plugins/docs/references/telegram-guide.md +5 -1
  8. package/payload/platform/plugins/scheduling/PLUGIN.md +1 -1
  9. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/agent-turn-dispatch.test.js +15 -2
  10. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/agent-turn-dispatch.test.js.map +1 -1
  11. package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.d.ts.map +1 -1
  12. package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.js +7 -2
  13. package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.js.map +1 -1
  14. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/scheduling-gate.test.js +125 -1
  15. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/scheduling-gate.test.js.map +1 -1
  16. package/payload/platform/plugins/scheduling/mcp/dist/tools/scheduling-gate.d.ts +28 -0
  17. package/payload/platform/plugins/scheduling/mcp/dist/tools/scheduling-gate.d.ts.map +1 -1
  18. package/payload/platform/plugins/scheduling/mcp/dist/tools/scheduling-gate.js +72 -12
  19. package/payload/platform/plugins/scheduling/mcp/dist/tools/scheduling-gate.js.map +1 -1
  20. package/payload/platform/plugins/telegram/PLUGIN.md +12 -5
  21. package/payload/platform/plugins/telegram/mcp/dist/__tests__/ask-tool.test.js +31 -0
  22. package/payload/platform/plugins/telegram/mcp/dist/__tests__/ask-tool.test.js.map +1 -1
  23. package/payload/platform/plugins/telegram/mcp/dist/__tests__/card-tool.test.js +30 -0
  24. package/payload/platform/plugins/telegram/mcp/dist/__tests__/card-tool.test.js.map +1 -1
  25. package/payload/platform/plugins/telegram/mcp/dist/__tests__/media-fetch-tool.test.js +24 -0
  26. package/payload/platform/plugins/telegram/mcp/dist/__tests__/media-fetch-tool.test.js.map +1 -1
  27. package/payload/platform/plugins/telegram/mcp/dist/__tests__/media-send-tool.test.js +31 -0
  28. package/payload/platform/plugins/telegram/mcp/dist/__tests__/media-send-tool.test.js.map +1 -1
  29. package/payload/platform/plugins/telegram/mcp/dist/__tests__/public-pin-registry.test.d.ts +2 -0
  30. package/payload/platform/plugins/telegram/mcp/dist/__tests__/public-pin-registry.test.d.ts.map +1 -0
  31. package/payload/platform/plugins/telegram/mcp/dist/__tests__/public-pin-registry.test.js +55 -0
  32. package/payload/platform/plugins/telegram/mcp/dist/__tests__/public-pin-registry.test.js.map +1 -0
  33. package/payload/platform/plugins/telegram/mcp/dist/__tests__/public-pin.test.d.ts +2 -0
  34. package/payload/platform/plugins/telegram/mcp/dist/__tests__/public-pin.test.d.ts.map +1 -0
  35. package/payload/platform/plugins/telegram/mcp/dist/__tests__/public-pin.test.js +89 -0
  36. package/payload/platform/plugins/telegram/mcp/dist/__tests__/public-pin.test.js.map +1 -0
  37. package/payload/platform/plugins/telegram/mcp/dist/index.js +13 -42
  38. package/payload/platform/plugins/telegram/mcp/dist/index.js.map +1 -1
  39. package/payload/platform/plugins/telegram/mcp/dist/lib/public-pin.d.ts +80 -0
  40. package/payload/platform/plugins/telegram/mcp/dist/lib/public-pin.d.ts.map +1 -0
  41. package/payload/platform/plugins/telegram/mcp/dist/lib/public-pin.js +96 -0
  42. package/payload/platform/plugins/telegram/mcp/dist/lib/public-pin.js.map +1 -0
  43. package/payload/platform/plugins/telegram/mcp/dist/tools/ask.d.ts +5 -0
  44. package/payload/platform/plugins/telegram/mcp/dist/tools/ask.d.ts.map +1 -1
  45. package/payload/platform/plugins/telegram/mcp/dist/tools/ask.js.map +1 -1
  46. package/payload/platform/plugins/telegram/mcp/dist/tools/card.d.ts +5 -0
  47. package/payload/platform/plugins/telegram/mcp/dist/tools/card.d.ts.map +1 -1
  48. package/payload/platform/plugins/telegram/mcp/dist/tools/card.js.map +1 -1
  49. package/payload/platform/plugins/telegram/mcp/dist/tools/media-fetch.d.ts +5 -0
  50. package/payload/platform/plugins/telegram/mcp/dist/tools/media-fetch.d.ts.map +1 -1
  51. package/payload/platform/plugins/telegram/mcp/dist/tools/media-fetch.js.map +1 -1
  52. package/payload/platform/plugins/telegram/mcp/dist/tools/media-send.d.ts +5 -0
  53. package/payload/platform/plugins/telegram/mcp/dist/tools/media-send.d.ts.map +1 -1
  54. package/payload/platform/plugins/telegram/mcp/dist/tools/media-send.js.map +1 -1
  55. package/payload/platform/plugins/telegram/mcp/dist/tools/thread.d.ts +5 -0
  56. package/payload/platform/plugins/telegram/mcp/dist/tools/thread.d.ts.map +1 -1
  57. package/payload/platform/plugins/telegram/mcp/dist/tools/thread.js.map +1 -1
  58. package/payload/platform/scripts/__tests__/agent-identity-reconcile.test.sh +110 -0
  59. package/payload/platform/scripts/__tests__/check-orphan-dist.test.sh +87 -0
  60. package/payload/platform/scripts/check-orphan-dist.mjs +143 -0
  61. package/payload/platform/scripts/lib/agent-identity-reconcile.sh +122 -0
  62. package/payload/platform/scripts/lib/provision-account-dir.sh +8 -26
  63. package/payload/platform/scripts/setup-account.sh +15 -0
  64. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts +37 -0
  65. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  66. package/payload/platform/services/claude-session-manager/dist/http-server.js +178 -13
  67. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  68. package/payload/platform/services/claude-session-manager/dist/index.js +5 -0
  69. package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
  70. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts +5 -0
  71. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts.map +1 -1
  72. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js +42 -1
  73. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js.map +1 -1
  74. package/payload/platform/services/claude-session-manager/dist/rc-public-lockdown.d.ts +13 -5
  75. package/payload/platform/services/claude-session-manager/dist/rc-public-lockdown.d.ts.map +1 -1
  76. package/payload/platform/services/claude-session-manager/dist/rc-public-lockdown.js +23 -9
  77. package/payload/platform/services/claude-session-manager/dist/rc-public-lockdown.js.map +1 -1
  78. package/payload/platform/services/claude-session-manager/dist/telegram-channel-mcp.d.ts +7 -4
  79. package/payload/platform/services/claude-session-manager/dist/telegram-channel-mcp.d.ts.map +1 -1
  80. package/payload/platform/services/claude-session-manager/dist/telegram-channel-mcp.js +5 -3
  81. package/payload/platform/services/claude-session-manager/dist/telegram-channel-mcp.js.map +1 -1
  82. package/payload/platform/services/claude-session-manager/dist/telegram-channel-store.d.ts +15 -1
  83. package/payload/platform/services/claude-session-manager/dist/telegram-channel-store.d.ts.map +1 -1
  84. package/payload/platform/services/claude-session-manager/dist/telegram-channel-store.js +16 -7
  85. package/payload/platform/services/claude-session-manager/dist/telegram-channel-store.js.map +1 -1
  86. package/payload/platform/services/claude-session-manager/dist/telegram-plugin-mcp.d.ts +28 -0
  87. package/payload/platform/services/claude-session-manager/dist/telegram-plugin-mcp.d.ts.map +1 -0
  88. package/payload/platform/services/claude-session-manager/dist/telegram-plugin-mcp.js +53 -0
  89. package/payload/platform/services/claude-session-manager/dist/telegram-plugin-mcp.js.map +1 -0
  90. package/payload/platform/services/claude-session-manager/dist/wa-channel-mcp.d.ts +9 -5
  91. package/payload/platform/services/claude-session-manager/dist/wa-channel-mcp.d.ts.map +1 -1
  92. package/payload/platform/services/claude-session-manager/dist/wa-channel-mcp.js +12 -6
  93. package/payload/platform/services/claude-session-manager/dist/wa-channel-mcp.js.map +1 -1
  94. package/payload/platform/services/claude-session-manager/dist/webchat-channel-mcp.d.ts +7 -3
  95. package/payload/platform/services/claude-session-manager/dist/webchat-channel-mcp.d.ts.map +1 -1
  96. package/payload/platform/services/claude-session-manager/dist/webchat-channel-mcp.js +5 -1
  97. package/payload/platform/services/claude-session-manager/dist/webchat-channel-mcp.js.map +1 -1
  98. package/payload/platform/services/telegram-channel/dist/instructions.d.ts +14 -2
  99. package/payload/platform/services/telegram-channel/dist/instructions.d.ts.map +1 -1
  100. package/payload/platform/services/telegram-channel/dist/instructions.js +34 -3
  101. package/payload/platform/services/telegram-channel/dist/instructions.js.map +1 -1
  102. package/payload/platform/templates/agents/public/IDENTITY.md +3 -3
  103. package/payload/server/server.js +74 -9
  104. package/payload/platform/lib/anthropic-key/dist/index.d.ts +0 -22
  105. package/payload/platform/lib/anthropic-key/dist/index.d.ts.map +0 -1
  106. package/payload/platform/lib/anthropic-key/dist/index.js +0 -232
  107. package/payload/platform/lib/anthropic-key/dist/index.js.map +0 -1
  108. package/payload/platform/lib/graph-search/dist/query-expansion.d.ts +0 -37
  109. package/payload/platform/lib/graph-search/dist/query-expansion.d.ts.map +0 -1
  110. package/payload/platform/lib/graph-search/dist/query-expansion.js +0 -101
  111. package/payload/platform/lib/graph-search/dist/query-expansion.js.map +0 -1
  112. package/payload/platform/lib/oauth-llm/dist/index.d.ts +0 -116
  113. package/payload/platform/lib/oauth-llm/dist/index.d.ts.map +0 -1
  114. package/payload/platform/lib/oauth-llm/dist/index.js +0 -386
  115. package/payload/platform/lib/oauth-llm/dist/index.js.map +0 -1
  116. package/payload/platform/lib/screening-patterns/dist/index.d.ts +0 -29
  117. package/payload/platform/lib/screening-patterns/dist/index.d.ts.map +0 -1
  118. package/payload/platform/lib/screening-patterns/dist/index.js +0 -48
  119. package/payload/platform/lib/screening-patterns/dist/index.js.map +0 -1
  120. package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.d.ts +0 -2
  121. package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.d.ts.map +0 -1
  122. package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.js +0 -34
  123. package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.js.map +0 -1
  124. package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.d.ts +0 -39
  125. package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.d.ts.map +0 -1
  126. package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.js +0 -249
  127. package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.js.map +0 -1
  128. package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.d.ts +0 -6
  129. package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.d.ts.map +0 -1
  130. package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.js +0 -32
  131. package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.js.map +0 -1
  132. package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.d.ts +0 -283
  133. package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.d.ts.map +0 -1
  134. package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.js +0 -1155
  135. package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.js.map +0 -1
  136. package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.d.ts +0 -90
  137. package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.d.ts.map +0 -1
  138. package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.js +0 -551
  139. package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.js.map +0 -1
  140. package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.d.ts +0 -17
  141. package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.d.ts.map +0 -1
  142. package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.js +0 -186
  143. package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.js.map +0 -1
  144. package/payload/platform/plugins/email/mcp/dist/lib/screening.d.ts +0 -29
  145. package/payload/platform/plugins/email/mcp/dist/lib/screening.d.ts.map +0 -1
  146. package/payload/platform/plugins/email/mcp/dist/lib/screening.js +0 -105
  147. package/payload/platform/plugins/email/mcp/dist/lib/screening.js.map +0 -1
  148. package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.d.ts +0 -38
  149. package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.d.ts.map +0 -1
  150. package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.js +0 -817
  151. package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.js.map +0 -1
  152. package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.d.ts +0 -30
  153. package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.d.ts.map +0 -1
  154. package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.js +0 -215
  155. package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.js.map +0 -1
  156. package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.d.ts +0 -19
  157. package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.d.ts.map +0 -1
  158. package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.js +0 -151
  159. package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.js.map +0 -1
  160. package/payload/platform/plugins/email/mcp/dist/tools/email-classify.d.ts +0 -6
  161. package/payload/platform/plugins/email/mcp/dist/tools/email-classify.d.ts.map +0 -1
  162. package/payload/platform/plugins/email/mcp/dist/tools/email-classify.js +0 -89
  163. package/payload/platform/plugins/email/mcp/dist/tools/email-classify.js.map +0 -1
  164. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.d.ts +0 -2
  165. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.d.ts.map +0 -1
  166. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.js +0 -90
  167. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.js.map +0 -1
  168. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.d.ts +0 -2
  169. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.d.ts.map +0 -1
  170. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.js +0 -226
  171. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.js.map +0 -1
  172. package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.d.ts +0 -60
  173. package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.d.ts.map +0 -1
  174. package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.js +0 -169
  175. package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.js.map +0 -1
  176. package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts +0 -248
  177. package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts.map +0 -1
  178. package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js +0 -824
  179. package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js.map +0 -1
  180. package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.d.ts +0 -63
  181. package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.d.ts.map +0 -1
  182. package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.js +0 -210
  183. package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.js.map +0 -1
  184. package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.d.ts +0 -35
  185. package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.d.ts.map +0 -1
  186. package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.js +0 -28
  187. package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.js.map +0 -1
  188. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.d.ts +0 -2
  189. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.d.ts.map +0 -1
  190. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.js +0 -68
  191. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.js.map +0 -1
  192. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.d.ts +0 -2
  193. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.d.ts.map +0 -1
  194. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.js +0 -88
  195. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.js.map +0 -1
  196. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.d.ts +0 -2
  197. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.d.ts.map +0 -1
  198. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.js +0 -58
  199. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.js.map +0 -1
  200. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.d.ts +0 -2
  201. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.d.ts.map +0 -1
  202. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.js +0 -64
  203. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.js.map +0 -1
  204. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.d.ts +0 -2
  205. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.d.ts.map +0 -1
  206. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.js +0 -70
  207. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.js.map +0 -1
  208. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.d.ts +0 -2
  209. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.d.ts.map +0 -1
  210. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.js +0 -48
  211. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.js.map +0 -1
  212. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.d.ts +0 -2
  213. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.d.ts.map +0 -1
  214. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.js +0 -74
  215. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.js.map +0 -1
  216. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.d.ts +0 -2
  217. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.d.ts.map +0 -1
  218. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.js +0 -47
  219. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.js.map +0 -1
  220. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.d.ts +0 -2
  221. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.d.ts.map +0 -1
  222. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.js +0 -65
  223. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.js.map +0 -1
  224. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.d.ts +0 -2
  225. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.d.ts.map +0 -1
  226. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.js +0 -43
  227. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.js.map +0 -1
  228. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.d.ts +0 -2
  229. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.d.ts.map +0 -1
  230. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.js +0 -65
  231. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.js.map +0 -1
  232. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.d.ts +0 -2
  233. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.d.ts.map +0 -1
  234. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.js +0 -49
  235. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.js.map +0 -1
  236. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.d.ts +0 -2
  237. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.d.ts.map +0 -1
  238. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.js +0 -79
  239. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.js.map +0 -1
  240. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.d.ts +0 -2
  241. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.d.ts.map +0 -1
  242. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.js +0 -329
  243. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.js.map +0 -1
  244. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.d.ts +0 -2
  245. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.d.ts.map +0 -1
  246. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.js +0 -81
  247. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.js.map +0 -1
  248. package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.d.ts +0 -34
  249. package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.d.ts.map +0 -1
  250. package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.js +0 -62
  251. package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.js.map +0 -1
  252. package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.d.ts +0 -61
  253. package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.d.ts.map +0 -1
  254. package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.js +0 -102
  255. package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.js.map +0 -1
  256. package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.d.ts +0 -35
  257. package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.d.ts.map +0 -1
  258. package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.js +0 -73
  259. package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.js.map +0 -1
  260. package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.d.ts +0 -29
  261. package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.d.ts.map +0 -1
  262. package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.js +0 -22
  263. package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.js.map +0 -1
  264. package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.d.ts +0 -30
  265. package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.d.ts.map +0 -1
  266. package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.js +0 -130
  267. package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.js.map +0 -1
  268. package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.d.ts +0 -65
  269. package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.d.ts.map +0 -1
  270. package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.js +0 -262
  271. package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.js.map +0 -1
  272. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/normalise-start-date.test.d.ts +0 -2
  273. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/normalise-start-date.test.d.ts.map +0 -1
  274. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/normalise-start-date.test.js +0 -100
  275. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/normalise-start-date.test.js.map +0 -1
  276. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/scheduled-seat-id.test.d.ts +0 -2
  277. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/scheduled-seat-id.test.d.ts.map +0 -1
  278. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/scheduled-seat-id.test.js +0 -22
  279. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/scheduled-seat-id.test.js.map +0 -1
  280. package/payload/platform/plugins/scheduling/mcp/dist/lib/scheduled-seat-id.d.ts +0 -11
  281. package/payload/platform/plugins/scheduling/mcp/dist/lib/scheduled-seat-id.d.ts.map +0 -1
  282. package/payload/platform/plugins/scheduling/mcp/dist/lib/scheduled-seat-id.js +0 -19
  283. package/payload/platform/plugins/scheduling/mcp/dist/lib/scheduled-seat-id.js.map +0 -1
  284. package/payload/platform/plugins/telegram/mcp/dist/__tests__/invoice-tool.test.d.ts +0 -2
  285. package/payload/platform/plugins/telegram/mcp/dist/__tests__/invoice-tool.test.d.ts.map +0 -1
  286. package/payload/platform/plugins/telegram/mcp/dist/__tests__/invoice-tool.test.js +0 -196
  287. package/payload/platform/plugins/telegram/mcp/dist/__tests__/invoice-tool.test.js.map +0 -1
  288. package/payload/platform/plugins/telegram/mcp/dist/tools/invoice.d.ts +0 -70
  289. package/payload/platform/plugins/telegram/mcp/dist/tools/invoice.d.ts.map +0 -1
  290. package/payload/platform/plugins/telegram/mcp/dist/tools/invoice.js +0 -247
  291. package/payload/platform/plugins/telegram/mcp/dist/tools/invoice.js.map +0 -1
  292. package/payload/platform/plugins/telegram/mcp/dist/tools/message.d.ts +0 -21
  293. package/payload/platform/plugins/telegram/mcp/dist/tools/message.d.ts.map +0 -1
  294. package/payload/platform/plugins/telegram/mcp/dist/tools/message.js +0 -40
  295. package/payload/platform/plugins/telegram/mcp/dist/tools/message.js.map +0 -1
  296. package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.d.ts +0 -8
  297. package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.d.ts.map +0 -1
  298. package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.js +0 -83
  299. package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.js.map +0 -1
  300. package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.d.ts +0 -151
  301. package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.d.ts.map +0 -1
  302. package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.js +0 -299
  303. package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.js.map +0 -1
  304. package/payload/platform/services/claude-session-manager/dist/account-admin-census.d.ts +0 -39
  305. package/payload/platform/services/claude-session-manager/dist/account-admin-census.d.ts.map +0 -1
  306. package/payload/platform/services/claude-session-manager/dist/account-admin-census.js +0 -122
  307. package/payload/platform/services/claude-session-manager/dist/account-admin-census.js.map +0 -1
  308. package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.d.ts +0 -39
  309. package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.d.ts.map +0 -1
  310. package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.js +0 -133
  311. package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.js.map +0 -1
  312. package/payload/platform/services/claude-session-manager/dist/input-postcondition.d.ts +0 -22
  313. package/payload/platform/services/claude-session-manager/dist/input-postcondition.d.ts.map +0 -1
  314. package/payload/platform/services/claude-session-manager/dist/input-postcondition.js +0 -50
  315. package/payload/platform/services/claude-session-manager/dist/input-postcondition.js.map +0 -1
  316. package/payload/platform/services/claude-session-manager/dist/jsonl-observer.d.ts +0 -30
  317. package/payload/platform/services/claude-session-manager/dist/jsonl-observer.d.ts.map +0 -1
  318. package/payload/platform/services/claude-session-manager/dist/jsonl-observer.js +0 -204
  319. package/payload/platform/services/claude-session-manager/dist/jsonl-observer.js.map +0 -1
  320. package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.d.ts +0 -80
  321. package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.d.ts.map +0 -1
  322. package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.js +0 -306
  323. package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.js.map +0 -1
  324. package/payload/platform/services/claude-session-manager/dist/session-store.d.ts +0 -49
  325. package/payload/platform/services/claude-session-manager/dist/session-store.d.ts.map +0 -1
  326. package/payload/platform/services/claude-session-manager/dist/session-store.js +0 -52
  327. package/payload/platform/services/claude-session-manager/dist/session-store.js.map +0 -1
  328. package/payload/platform/services/claude-session-manager/dist/systemd-spawn.d.ts +0 -83
  329. package/payload/platform/services/claude-session-manager/dist/systemd-spawn.d.ts.map +0 -1
  330. package/payload/platform/services/claude-session-manager/dist/systemd-spawn.js +0 -345
  331. package/payload/platform/services/claude-session-manager/dist/systemd-spawn.js.map +0 -1
  332. package/payload/platform/services/telegram-channel/dist/turn-follow.d.ts +0 -104
  333. package/payload/platform/services/telegram-channel/dist/turn-follow.d.ts.map +0 -1
  334. package/payload/platform/services/telegram-channel/dist/turn-follow.js +0 -408
  335. package/payload/platform/services/telegram-channel/dist/turn-follow.js.map +0 -1
  336. package/payload/platform/services/whatsapp-channel/dist/turn-follow.d.ts +0 -104
  337. package/payload/platform/services/whatsapp-channel/dist/turn-follow.d.ts.map +0 -1
  338. package/payload/platform/services/whatsapp-channel/dist/turn-follow.js +0 -393
  339. package/payload/platform/services/whatsapp-channel/dist/turn-follow.js.map +0 -1
@@ -23,7 +23,13 @@ function isValidBinding(v) {
23
23
  const o = v;
24
24
  return (typeof o.senderId === 'string' && o.senderId.length > 0 &&
25
25
  typeof o.gatewayUrl === 'string' && o.gatewayUrl.length > 0 &&
26
- typeof o.serverPath === 'string' && o.serverPath.length > 0);
26
+ typeof o.serverPath === 'string' && o.serverPath.length > 0 &&
27
+ // Task 2666 — absent is valid, present-and-wrong is not. A numeric botId
28
+ // would reach the plugin env as the string "111" and still pin, so the
29
+ // shape is checked rather than coerced: a record this store cannot vouch
30
+ // for is skipped, and the spawn falls back to the closed surface.
31
+ (o.botId === undefined || (typeof o.botId === 'string' && o.botId.length > 0)) &&
32
+ (o.chatId === undefined || (typeof o.chatId === 'string' && o.chatId.length > 0)));
27
33
  }
28
34
  export class TelegramChannelStore {
29
35
  bySessionId = new Map();
@@ -71,12 +77,15 @@ export class TelegramChannelStore {
71
77
  continue;
72
78
  const rawBoundAt = value.boundAt;
73
79
  const boundAt = typeof rawBoundAt === 'string' && rawBoundAt.length > 0 ? rawBoundAt : new Date(0).toISOString();
74
- this.bySessionId.set(sessionId, {
75
- senderId: value.senderId,
76
- gatewayUrl: value.gatewayUrl,
77
- serverPath: value.serverPath,
78
- boundAt,
79
- });
80
+ // Task 2666 — the pin fields are spread rather than named, because a
81
+ // hand-listed reconstruction drops any field added later in silence:
82
+ // `set` already spreads, so a listed load and a spread write disagreed
83
+ // about what a binding is, and the pin survived a write and died on the
84
+ // next boot. The cost is that an unrecognised key in a hand-edited file
85
+ // is now kept in memory rather than dropped; nothing reads one, and the
86
+ // argv rebuild names the fields it wants.
87
+ const { senderId, gatewayUrl, serverPath, ...rest } = value;
88
+ this.bySessionId.set(sessionId, { senderId, gatewayUrl, serverPath, ...rest, boundAt });
80
89
  loaded += 1;
81
90
  }
82
91
  this.logger(`[claude-session-manager] telegram-channel-store-load ok entries=${loaded} path=${this.filePath}`);
@@ -1 +1 @@
1
- {"version":3,"file":"telegram-channel-store.js","sourceRoot":"","sources":["../src/telegram-channel-store.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,iFAAiF;AACjF,+EAA+E;AAC/E,iFAAiF;AACjF,6EAA6E;AAC7E,6CAA6C;AAC7C,EAAE;AACF,aAAa;AACb,6EAA6E;AAC7E,+EAA+E;AAC/E,0EAA0E;AAC1E,yEAAyE;AACzE,6DAA6D;AAC7D,2EAA2E;AAC3E,mEAAmE;AACnE,EAAE;AACF,4BAA4B;AAC5B,8GAA8G;AAE9G,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAc7E,SAAS,cAAc,CAAC,CAAU;IAChC,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC7C,MAAM,CAAC,GAAG,CAA4B,CAAA;IACtC,OAAO,CACL,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;QACvD,OAAO,CAAC,CAAC,UAAU,KAAK,QAAQ,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;QAC3D,OAAO,CAAC,CAAC,UAAU,KAAK,QAAQ,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAC5D,CAAA;AACH,CAAC;AAED,MAAM,OAAO,oBAAoB;IACd,WAAW,GAA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,CAAC,GAAG,CAAC,CAAA;YAC/D,IAAI,CAAC,MAAM,CAAC,yEAAyE,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAA;YAC5G,yEAAyE;QAC3E,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,28 @@
1
+ /** Must equal the plugin directory basename: `qualifyShortToolName` builds
2
+ * `mcp__<plugin>__<tool>` and the allowlist entries have to name a server that
3
+ * is actually registered. */
4
+ export declare const TELEGRAM_PLUGIN_SERVER_NAME = "telegram";
5
+ export interface TelegramPluginMcpParams {
6
+ sessionId: string;
7
+ /** The one bot this session may act as. */
8
+ botId: string;
9
+ /** The one chat this session may send to. */
10
+ chatId: string;
11
+ /** The account whose `account.json` holds the bot token. `toolDeps()` in the
12
+ * plugin reads this as ACCOUNT_ID; without it every tool refuses with
13
+ * `op=no-account`. */
14
+ accountId: string;
15
+ /** Absolute path to the node binary. On darwin the launchd server PATH
16
+ * excludes an nvm node, so a bare `node` fails to spawn (Task 1402). */
17
+ nodeBin: string;
18
+ platformRoot: string;
19
+ logDir: string;
20
+ platformPort: string;
21
+ }
22
+ export interface TelegramPluginMcpServerEntry {
23
+ command: string;
24
+ args: string[];
25
+ env: Record<string, string>;
26
+ }
27
+ export declare function buildTelegramPluginMcpServers(p: TelegramPluginMcpParams): Record<string, TelegramPluginMcpServerEntry>;
28
+ //# sourceMappingURL=telegram-plugin-mcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telegram-plugin-mcp.d.ts","sourceRoot":"","sources":["../src/telegram-plugin-mcp.ts"],"names":[],"mappings":"AAqBA;;8BAE8B;AAC9B,eAAO,MAAM,2BAA2B,aAAa,CAAA;AAErD,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAA;IACjB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAA;IACb,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAA;IACd;;2BAEuB;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB;6EACyE;IACzE,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC5B;AAED,wBAAgB,6BAA6B,CAC3C,CAAC,EAAE,uBAAuB,GACzB,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAAC,CA4B9C"}
@@ -0,0 +1,53 @@
1
+ // Task 2666 — the per-spawn registration of the telegram PLUGIN server for a
2
+ // public telegram spawn.
3
+ //
4
+ // Why this exists at all. A public spawn passes `--strict-mcp-config`, so the
5
+ // only MCP servers it holds are the ones its own `--mcp-config` file names.
6
+ // Admin and specialist spawns take the same plugin from the installed-plugin
7
+ // channel under the LONG prefix (`mcp__plugin_telegram_telegram__…`); a public
8
+ // spawn cannot, so it registers the identical entrypoint here under the SHORT
9
+ // prefix `qualifyShortToolName` produces. The server name is therefore not a
10
+ // free choice: it must equal the plugin directory basename, `telegram`, or
11
+ // every granted tool name points at a server that is not registered — the
12
+ // failure the Task 2403 comment in pty-spawner.ts records, where a spawn was
13
+ // handed `--allowed-tools mcp__telegram-channel__reply` for a server nothing
14
+ // registered and sat alive and idle with no way to answer.
15
+ //
16
+ // Pure (no fs, no process.env), like telegram-channel-mcp.ts, so it unit-tests
17
+ // without node-pty and the caller owns the file write.
18
+ import { join } from 'node:path';
19
+ import { buildChannelSpawnTee } from './channel-spawn-tee.js';
20
+ /** Must equal the plugin directory basename: `qualifyShortToolName` builds
21
+ * `mcp__<plugin>__<tool>` and the allowlist entries have to name a server that
22
+ * is actually registered. */
23
+ export const TELEGRAM_PLUGIN_SERVER_NAME = 'telegram';
24
+ export function buildTelegramPluginMcpServers(p) {
25
+ const tee = buildChannelSpawnTee({
26
+ nodeBin: p.nodeBin,
27
+ platformRoot: p.platformRoot,
28
+ logDir: p.logDir,
29
+ platformPort: p.platformPort,
30
+ sessionId: p.sessionId,
31
+ serverName: TELEGRAM_PLUGIN_SERVER_NAME,
32
+ serverPath: join(p.platformRoot, 'plugins', 'telegram', 'mcp', 'dist', 'index.js'),
33
+ });
34
+ return {
35
+ [TELEGRAM_PLUGIN_SERVER_NAME]: {
36
+ command: tee.command,
37
+ args: tee.args,
38
+ env: {
39
+ ...tee.env,
40
+ PLATFORM_ROOT: p.platformRoot,
41
+ ACCOUNT_ID: p.accountId,
42
+ // Task 2666 — the pin. Present ONLY on a public spawn, which is what
43
+ // makes its presence the plugin's own public-spawn signal: an admin
44
+ // spawn takes this plugin from the installed-plugin channel and never
45
+ // reaches this builder, so its tools see neither variable and behave
46
+ // exactly as they did before this task.
47
+ TG_PUBLIC_BOT_ID: p.botId,
48
+ TG_PUBLIC_CHAT_ID: p.chatId,
49
+ },
50
+ },
51
+ };
52
+ }
53
+ //# sourceMappingURL=telegram-plugin-mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telegram-plugin-mcp.js","sourceRoot":"","sources":["../src/telegram-plugin-mcp.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,yBAAyB;AACzB,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,6EAA6E;AAC7E,+EAA+E;AAC/E,8EAA8E;AAC9E,6EAA6E;AAC7E,2EAA2E;AAC3E,0EAA0E;AAC1E,6EAA6E;AAC7E,6EAA6E;AAC7E,2DAA2D;AAC3D,EAAE;AACF,+EAA+E;AAC/E,uDAAuD;AAEvD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D;;8BAE8B;AAC9B,MAAM,CAAC,MAAM,2BAA2B,GAAG,UAAU,CAAA;AA0BrD,MAAM,UAAU,6BAA6B,CAC3C,CAA0B;IAE1B,MAAM,GAAG,GAAG,oBAAoB,CAAC;QAC/B,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,YAAY,EAAE,CAAC,CAAC,YAAY;QAC5B,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,YAAY,EAAE,CAAC,CAAC,YAAY;QAC5B,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,UAAU,EAAE,2BAA2B;QACvC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC;KACnF,CAAC,CAAA;IACF,OAAO;QACL,CAAC,2BAA2B,CAAC,EAAE;YAC7B,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,GAAG,EAAE;gBACH,GAAG,GAAG,CAAC,GAAG;gBACV,aAAa,EAAE,CAAC,CAAC,YAAY;gBAC7B,UAAU,EAAE,CAAC,CAAC,SAAS;gBACvB,qEAAqE;gBACrE,oEAAoE;gBACpE,sEAAsE;gBACtE,qEAAqE;gBACrE,wCAAwC;gBACxC,gBAAgB,EAAE,CAAC,CAAC,KAAK;gBACzB,iBAAiB,EAAE,CAAC,CAAC,MAAM;aAC5B;SACF;KACF,CAAA;AACH,CAAC"}
@@ -18,11 +18,15 @@ export interface WaChannelMcpParams {
18
18
  accountId: string;
19
19
  /** Task 2458 — which role this session's channel server serves. The gateway
20
20
  * branches its turn-end delivery on it: a public turn goes back down the
21
- * posting key, an admin turn fans out. Optional here and defaulted to 'admin'
22
- * at the stamp, so a caller that names no role produces the admin spawn it
23
- * already produced; the channel server itself refuses an ABSENT value, which
24
- * is what makes a missed stamp loud rather than silently admin. */
25
- role?: 'admin' | 'public';
21
+ * posting key, an admin turn fans out.
22
+ *
23
+ * Task 2666 REQUIRED. It was optional and defaulted to 'admin' at the
24
+ * stamp, and the comment here claimed the channel server's refusal of an
25
+ * absent value made a missed stamp loud. It could not: the default filled
26
+ * the value in before the server ever saw it, so the refusal was
27
+ * unreachable and a caller that named no role got the highest-privilege
28
+ * framing in silence. Required means the compiler asks each caller. */
29
+ role: 'admin' | 'public';
26
30
  /** Task 2356 — the three values the spawn-tee shim needs. Supplied by the
27
31
  * caller because this module is pure: `deps.platformRoot`, `deps.logDir`,
28
32
  * and the manager's own PLATFORM_PORT. */
@@ -1 +1 @@
1
- {"version":3,"file":"wa-channel-mcp.d.ts","sourceRoot":"","sources":["../src/wa-channel-mcp.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,sBAAsB,qBAAqB,CAAA;AAExD,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAA;IAChB,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAA;IAClB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAA;IAClB;;;uCAGmC;IACnC,OAAO,EAAE,MAAM,CAAA;IACf;;yEAEqE;IACrE,SAAS,EAAE,MAAM,CAAA;IACjB;;;;;wEAKoE;IACpE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IACzB;;+CAE2C;IAC3C,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC5B;AAED,wBAAgB,wBAAwB,CACtC,CAAC,EAAE,kBAAkB,GACpB,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAmCzC;AAED,uEAAuE;AACvE,wBAAgB,wBAAwB,IAAI,MAAM,EAAE,CAEnD;AAED;;;kCAGkC;AAClC,wBAAgB,sBAAsB,CAAC,SAAS,EAA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E7E;AAED;4EAC4E;AAC5E,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,CAElE;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAU7D"}
@@ -39,12 +39,18 @@ export function buildWaChannelMcpServers(p) {
39
39
  // Task 2290 — without this the gateway refuses the attach, because a
40
40
  // nameless subscriber would receive every account's payloads for this phone.
41
41
  WA_CHANNEL_ACCOUNT_ID: p.accountId,
42
- // Task 2458 — stamped on BOTH roles, unlike the telegram twin. The
43
- // channel server's resolveChannelRole throws on an absent or
44
- // unrecognised value rather than defaulting to admin, because that
45
- // default is exactly what sent a visitor's answer into the admin
46
- // identity fan-out, which resolves no target for a visitor.
47
- WA_CHANNEL_ROLE: p.role === 'public' ? 'public' : 'admin',
42
+ // Task 2458 — stamped on BOTH roles. The channel server's
43
+ // resolveChannelRole throws on an absent or unrecognised value rather
44
+ // than defaulting to admin, because that default is exactly what sent a
45
+ // visitor's answer into the admin identity fan-out, which resolves no
46
+ // target for a visitor.
47
+ //
48
+ // Task 2666 — passed through verbatim. The ternary here read as a
49
+ // narrowing but was a fallback: it turned an absent role into the
50
+ // string 'admin' BEFORE the server saw it, so the throw above could
51
+ // never fire and the strictness was decorative. `role` is required now,
52
+ // so there is nothing left to collapse.
53
+ WA_CHANNEL_ROLE: p.role,
48
54
  },
49
55
  },
50
56
  };
@@ -1 +1 @@
1
- {"version":3,"file":"wa-channel-mcp.js","sourceRoot":"","sources":["../src/wa-channel-mcp.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,yEAAyE;AACzE,2EAA2E;AAC3E,mBAAmB;AACnB,EAAE;AACF,yEAAyE;AACzE,4EAA4E;AAC5E,+EAA+E;AAC/E,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAC5E,+CAA+C;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAA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ACtD,OAAO,CAAC,cAAc,EAAE,aAAa,EAAE,GAAG,wBAAwB,EAAE,CAAC,CAAA;AACvE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAClD,MAAM,IAAI,GAAG,SAAS;QACpB,0EAA0E;QAC1E,wEAAwE;QACxE,8DAA8D;SAC7D,OAAO,CAAC,4BAA4B,EAAE,EAAE,CAAC;SACzC,OAAO,CAAC,qCAAqC,EAAE,EAAE,CAAC;SAClD,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;SACzB,WAAW,EAAE,CAAA;IAChB,OAAO,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAA;AAChF,CAAC"}
@@ -17,9 +17,13 @@ export interface WebchatChannelMcpParams {
17
17
  * installer-resolved NODE_BIN. */
18
18
  nodeBin: string;
19
19
  /** Task 756 — 'public' frames the channel server's instructions + reply-tool
20
- * copy for an anonymous visitor; omitted/'admin' keeps the operator framing
21
- * (Task 772). Carried to the server as WEBCHAT_CHANNEL_ROLE. */
22
- role?: 'admin' | 'public';
20
+ * copy for an anonymous visitor; 'admin' keeps the operator framing (Task
21
+ * 772). Carried to the server as WEBCHAT_CHANNEL_ROLE.
22
+ *
23
+ * Task 2666 — REQUIRED. Optional plus an 'admin' default at the stamp meant
24
+ * a caller that named no role silently got the operator framing, and the
25
+ * server's strict resolver never saw the absence. */
26
+ role: 'admin' | 'public';
23
27
  /** Task 2356 — spawn-tee inputs; see channel-spawn-tee.ts. Supplied by the
24
28
  * caller because this module is pure. */
25
29
  platformRoot: string;
@@ -1 +1 @@
1
- {"version":3,"file":"webchat-channel-mcp.d.ts","sourceRoot":"","sources":["../src/webchat-channel-mcp.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,2BAA2B,oBAAoB,CAAA;AAE5D;;uDAEuD;AACvD,eAAO,MAAM,0BAA0B,gCAA+C,CAAA;AAEtF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AAU,EAAE,MAAM,CAAA;IAClB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAA;IAClB;;;uCAGmC;IACnC,OAAO,EAAE,MAAM,CAAA;IACf;;;;;;0DAMsD;IACtD,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAA;IACxB;8CAC0C;IAC1C,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC5B;AAED,wBAAgB,6BAA6B,CAC3C,CAAC,EAAE,uBAAuB,GACzB,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAkC9C;AAED,uEAAuE;AACvE,wBAAgB,6BAA6B,IAAI,MAAM,EAAE,CAExD;AAED;;;kCAGkC;AAClC,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAElF;AAED;4EAC4E;AAC5E,wBAAgB,uBAAuB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,CAEvE"}
@@ -44,7 +44,11 @@ export function buildWebchatChannelMcpServers(p) {
44
44
  // for BOTH roles: resolveChannelRole now throws on an absent or
45
45
  // unrecognised value rather than defaulting to admin, because that
46
46
  // default is what would silently re-register the retired reply tool.
47
- WEBCHAT_CHANNEL_ROLE: p.role === 'public' ? 'public' : 'admin',
47
+ //
48
+ // Task 2666 — passed through verbatim. The ternary read as a narrowing
49
+ // but was a fallback: it turned an absent role into 'admin' BEFORE the
50
+ // server saw it, so the throw above could never fire.
51
+ WEBCHAT_CHANNEL_ROLE: p.role,
48
52
  },
49
53
  },
50
54
  };
@@ -1 +1 @@
1
- {"version":3,"file":"webchat-channel-mcp.js","sourceRoot":"","sources":["../src/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awn env (TG_CHANNEL_ROLE). Anything
3
- * other than the literal 'public' is admin — the safe default. */
2
+ /** Resolve the channel role from the spawn env (TG_CHANNEL_ROLE). Strict, like
3
+ * the whatsapp and webchat twins.
4
+ *
5
+ * Task 2666 — this used to return 'admin' for anything that was not the
6
+ * literal 'public', and called that the safe default. It is the opposite of
7
+ * safe: admin is the HIGHEST-privilege framing on this door, and reaching it
8
+ * by exclusion means every way of getting the role wrong lands there. A resume
9
+ * that omitted the role booted a stranger's conversation with the block that
10
+ * says the message "is a message the operator has typed to you directly" and
11
+ * to act on it as their instruction, and it emitted nothing while doing so: a
12
+ * spawn that silently became admin is byte-identical to a correct admin spawn.
13
+ *
14
+ * Both spawn paths stamp the env, so an absent or unrecognised value means the
15
+ * spawn is wrong and the channel must not boot. */
4
16
  export declare function resolveChannelRole(raw: string | undefined): TelegramChannelRole;
5
17
  export declare function channelInstructions(role: TelegramChannelRole): string;
6
18
  export declare function replyToolDescription(role: TelegramChannelRole): string;
@@ -1 +1 @@
1
- {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEpD;mEACmE;AACnE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,mBAAmB,CAE/E;AAmDD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAErE;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAItE;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAEtE;AAoBD,eAAO,MAAM,yBAAyB,QAkEiE,CAAA"}
1
+ {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEpD;;;;;;;;;;;;;oDAaoD;AACpD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,mBAAmB,CAM/E;AAkED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAErE;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAItE;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAEtE;AAoBD,eAAO,MAAM,yBAAyB,QAkEiE,CAAA"}
@@ -4,10 +4,26 @@
4
4
  // as an operator instruction — it answers a visitor. The black-box +
5
5
  // no-internals guardrails apply to both. Pure so the framing is unit-testable
6
6
  // without booting the MCP server.
7
- /** Resolve the channel role from the spawn env (TG_CHANNEL_ROLE). Anything
8
- * other than the literal 'public' is admin — the safe default. */
7
+ /** Resolve the channel role from the spawn env (TG_CHANNEL_ROLE). Strict, like
8
+ * the whatsapp and webchat twins.
9
+ *
10
+ * Task 2666 — this used to return 'admin' for anything that was not the
11
+ * literal 'public', and called that the safe default. It is the opposite of
12
+ * safe: admin is the HIGHEST-privilege framing on this door, and reaching it
13
+ * by exclusion means every way of getting the role wrong lands there. A resume
14
+ * that omitted the role booted a stranger's conversation with the block that
15
+ * says the message "is a message the operator has typed to you directly" and
16
+ * to act on it as their instruction, and it emitted nothing while doing so: a
17
+ * spawn that silently became admin is byte-identical to a correct admin spawn.
18
+ *
19
+ * Both spawn paths stamp the env, so an absent or unrecognised value means the
20
+ * spawn is wrong and the channel must not boot. */
9
21
  export function resolveChannelRole(raw) {
10
- return raw === 'public' ? 'public' : 'admin';
22
+ if (raw === 'public')
23
+ return 'public';
24
+ if (raw === 'admin')
25
+ return 'admin';
26
+ throw new Error(`telegram-channel: TG_CHANNEL_ROLE must be 'admin' or 'public' (got ${raw === undefined ? 'undefined' : JSON.stringify(raw)})`);
11
27
  }
12
28
  const NO_INTERNALS = `The platform you run on is a black box: never read, grep, or edit the platform install or its ` +
13
29
  `server bundle, and never restart platform services. If the platform itself is broken, describe ` +
@@ -49,6 +65,21 @@ const PUBLIC_INSTRUCTIONS = SPECIALIST_AUDIENCE +
49
65
  `question or do what the visitor asked within your remit, then (2) write that answer as the ` +
50
66
  `final text of your turn. That text is what reaches the visitor's chat, so never end a turn ` +
51
67
  `without it and never wait for confirmation before answering. ` +
68
+ // Task 2666 — a public spawn holds four Telegram tools now. Without this
69
+ // paragraph the agent keeps answering in plain text, because the block above
70
+ // tells it to write its answer as final text and names no tool: the surface
71
+ // would ship and nothing would use it.
72
+ `You can do more than write sentences in this chat, and a good answer often is not a paragraph. ` +
73
+ `Use telegram-card when the visitor is choosing between a small number of things: it posts your ` +
74
+ `text with tappable buttons under it, a button can open a web page inside Telegram, and giving ` +
75
+ `the same card a key lets you update that one message later instead of stacking new ones below ` +
76
+ `it. When you send a card, the card IS your answer — do not repeat it as your final text. ` +
77
+ `Use telegram-ask for a poll, a quiz, a checklist, a map pin, a venue or a contact card. ` +
78
+ `Use telegram-media-send for a photo, document, video, voice note or a set of images. ` +
79
+ `Use telegram-media-fetch to open a file the visitor sent you. ` +
80
+ `Beside a poll or a photo, still write the sentence that says what the visitor is looking at. ` +
81
+ `You act only as this bot and only in this chat: both are fixed for you, so never try to reach ` +
82
+ `another person or another conversation. ` +
52
83
  NO_INTERNALS;
53
84
  export function channelInstructions(role) {
54
85
  return role === 'public' ? PUBLIC_INSTRUCTIONS : ADMIN_INSTRUCTIONS;
@@ -1 +1 @@
1
- {"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,+EAA+E;AAC/E,+EAA+E;AAC/E,qEAAqE;AACrE,8EAA8E;AAC9E,kCAAkC;AAIlC;mEACmE;AACnE,MAAM,UAAU,kBAAkB,CAAC,GAAuB;IACxD,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAA;AAC9C,C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AAuG;IACvG,8EAA8E;IAC9E,0EAA0E;IAC1E,uGAAuG;IACvG,iDAAiD;IACjD,gFAAgF;IAChF,mFAAmF;IACnF,oHAAoH;IACpH,yBAAyB;IACzB,+EAA+E;IAC/E,iFAAiF;IACjF,iFAAiF;IACjF,mBAAmB;IACnB,8GAA8G;IAC9G,gHAAgH;IAChH,6BAA6B;IAC7B,2EAA2E;IAC3E,2EAA2E;IAC3E,6EAA6E;IAC7E,2EAA2E;IAC3E,2EAA2E;IAC3E,2EAA2E;IAC3E,+EAA+E;IAC/E,4EAA4E;IAC5E,2DAA2D;IAC3D,iHAAiH;IACjH,0EAA0E;IAC1E,2EAA2E;IAC3E,iFAAiF;IACjF,2EAA2E;IAC3E,8EAA8E;IAC9E,6EAA6E;IAC7E,qEAAqE;IACrE,qEAAqE;IACrE,+EAA+E;IAC/E,6EAA6E;IAC7E,YAAY;IACZ,8GAA8G;IAC9G,6HAA6H;IAC7H,kIAAkI;IAClI,4EAA4E;IAC5E,qFAAqF;IACrF,qGAAqG,CAAA"}
@@ -6,15 +6,15 @@ You are a public-facing agent for a business. Your soul and your knowledge are p
6
6
 
7
7
  Everything you know is in this prompt — your soul and the knowledge given with it. Answer only from it. If the answer is not there, say plainly that it is outside what you can help with, and offer to pass the question to the business. Never fill a gap from general training knowledge, and never invent a fact about the business, its products, prices, or people.
8
8
 
9
- ## You have one tool
9
+ ## Your tools
10
10
 
11
- You have exactly one tool: the reply tool for the channel you are talking on. It is how your answer reaches the visitor, so you call it for every reply you make. There is nothing else to call. You cannot search, look anything up, read files, run commands, or load skills, and there is no tool for any of it, so do not try. If a visitor asks for something that would need a lookup or an action, treat it as outside what you can help with and offer to pass it on. You answer; you do not act.
11
+ Your tools are the ones this channel names for you, and there are no others. One of them is always the reply tool for the channel you are talking on: it is how your answer reaches the visitor, so you call it for every reply you make. Do not reach for a search, a lookup, a file, a command or a skill that is not on your list. If a visitor asks for something none of your tools can do, treat it as outside what you can help with and offer to pass it on.
12
12
 
13
13
  ## How you behave
14
14
 
15
15
  In your first message of every conversation, make clear in a natural way that the visitor is talking to an AI, not a human. This is a trust obligation, not optional, and it belongs in the greeting rather than bolted on after. Never impersonate a human at any point.
16
16
 
17
- You are read-only. You cannot create, change, or delete anything. If a visitor uploads a file, it is saved for the business to review you cannot read it or act on its contents, so say so honestly.
17
+ You are read-only over the business. You cannot create, change, or delete any of its records. A file a visitor sends is saved for the business to review, and you can open it only if one of your tools does that.
18
18
 
19
19
  Never describe your own workings, limits, or what you can and cannot call unless a visitor asks. Visitors care about the business, not how you are built. Stay within the scope of the knowledge you were given, and decline politely when a request falls outside it.
20
20
 
@@ -7177,11 +7177,29 @@ function createScheduleInjectRoutes(deps) {
7177
7177
  console.error(`${TAG6} op=schedule-telegram-reject eventId=${eventId} destination=${destination} reason=unresolved-effective-account`);
7178
7178
  return c.json({ ok: false, error: "unresolved-effective-account" }, 403);
7179
7179
  }
7180
- if (resolution.kind === "ambiguous") {
7181
- console.error(`${TAG6} op=telegram-destination-ambiguous eventId=${eventId} destination=${destination} accounts=${resolution.count} dispatched=no`);
7182
- return c.json({ ok: false, error: "telegram-destination-ambiguous" }, 403);
7180
+ let claimant;
7181
+ if (resolution.kind === "one") {
7182
+ claimant = resolution;
7183
+ } else {
7184
+ const mine = resolution.claimants.filter((c2) => c2.accountId === eventAccountId);
7185
+ if (mine.length === 0) {
7186
+ console.error(
7187
+ `${TAG6} op=event-account-scope-mismatch eventId=${eventId} eventAccount=${eventAccountId ?? "-"} effectiveAccount=none claimants=${resolution.claimants.length} destination=${destination} dispatched=no`
7188
+ );
7189
+ return c.json({ ok: false, error: "event-account-scope-mismatch" }, 403);
7190
+ }
7191
+ if (mine.length > 1) {
7192
+ console.error(
7193
+ `${TAG6} op=telegram-destination-ambiguous eventId=${eventId} destination=${destination} accounts=${mine.length} scope=within-account dispatched=no`
7194
+ );
7195
+ return c.json({ ok: false, error: "telegram-destination-ambiguous" }, 403);
7196
+ }
7197
+ claimant = mine[0];
7198
+ console.error(
7199
+ `${TAG6} op=telegram-destination-narrowed eventId=${eventId} destination=${destination} claimants=${resolution.claimants.length} account=${claimant.accountId} botId=${claimant.botId}`
7200
+ );
7183
7201
  }
7184
- const { accountId: effectiveAccount, botId, botToken } = resolution;
7202
+ const { accountId: effectiveAccount, botId, botToken } = claimant;
7185
7203
  console.error(`${TAG6} op=effective-account eventId=${eventId} effectiveAccount=${effectiveAccount} botId=${botId}`);
7186
7204
  if (eventAccountId === null || eventAccountId !== effectiveAccount) {
7187
7205
  console.error(`${TAG6} op=event-account-scope-mismatch eventId=${eventId} eventAccount=${eventAccountId ?? "-"} effectiveAccount=${effectiveAccount} destination=${destination} dispatched=no`);
@@ -7189,8 +7207,8 @@ function createScheduleInjectRoutes(deps) {
7189
7207
  }
7190
7208
  const sendVerdict = checkTelegramChatSend({
7191
7209
  chatId: Number(destination),
7192
- allowChannels: resolution.allowChannels,
7193
- allowGroups: resolution.allowGroups
7210
+ allowChannels: claimant.allowChannels,
7211
+ allowGroups: claimant.allowGroups
7194
7212
  });
7195
7213
  console.error(
7196
7214
  `[telegram-outbound] op=channel-send botId=${botId} chatId=${destination} allowed=${sendVerdict.allowed ? "yes" : "no"} reason=${sendVerdict.reason} messageId=none`
@@ -39977,6 +39995,16 @@ function startEmitter(opts) {
39977
39995
  }
39978
39996
  continue;
39979
39997
  }
39998
+ if (opts.onToolUse && !suppressing && event.type === "assistant") {
39999
+ const pre = event.message;
40000
+ if (pre && Array.isArray(pre.content)) {
40001
+ for (const block of pre.content) {
40002
+ if (block?.type === "tool_use" && typeof block.name === "string") {
40003
+ opts.onToolUse(block.name);
40004
+ }
40005
+ }
40006
+ }
40007
+ }
39980
40008
  for (const answer of answers.push(line)) {
39981
40009
  if (suppressing) {
39982
40010
  discardedAnswers += 1;
@@ -41215,7 +41243,17 @@ function buildTelegramSpawnRequest(input) {
41215
41243
  // session resolve under that account, not the manager's boot-time house
41216
41244
  // default. Mirror of the WhatsApp builder.
41217
41245
  targetAccountId: input.accountId,
41218
- telegramChannel: { senderId: channelKey, gatewayUrl: input.gatewayUrl, serverPath: input.serverPath },
41246
+ // Task 2666 the pin travels with the channel binding. Sent on EVERY role,
41247
+ // not just public: the manager grants the rich tool surface only on
41248
+ // role:'public', and putting a role branch here would be a second place
41249
+ // that has to be kept in step with the manager's own gate.
41250
+ telegramChannel: {
41251
+ senderId: channelKey,
41252
+ gatewayUrl: input.gatewayUrl,
41253
+ serverPath: input.serverPath,
41254
+ botId: input.botId,
41255
+ chatId: input.chatId
41256
+ },
41219
41257
  logContext: `channel=telegram-native role=${input.role} botId=${input.botId} senderId=${input.senderId}`
41220
41258
  };
41221
41259
  }
@@ -41239,6 +41277,10 @@ function buildTelegramEnsureSession(deps) {
41239
41277
  gatewayUrl: input.gatewayUrl,
41240
41278
  serverPath: input.serverPath,
41241
41279
  botId: input.botId,
41280
+ // Task 2666 — the chat the public spawn's tools are pinned to. The same
41281
+ // value handed to the file follower below, so a group answers into the
41282
+ // group and a business chat into the customer's chat.
41283
+ chatId: input.chatId,
41242
41284
  // Task 2615 — the builder keys both the channel key and the session id on
41243
41285
  // this when present, instead of on the sender.
41244
41286
  businessChatId: input.businessChatId ?? null,
@@ -41510,6 +41552,7 @@ function runTelegramPresenceCensus() {
41510
41552
  }
41511
41553
 
41512
41554
  // app/lib/telegram/gateway/native-file-follower.ts
41555
+ var TELEGRAM_CARD_TOOL = "mcp__telegram__telegram-card";
41513
41556
  var CHAT_ACTION_REFRESH_MS = 4e3;
41514
41557
  function startTelegramNativeFileFollower(input) {
41515
41558
  const entry2 = {
@@ -41532,6 +41575,7 @@ function startTelegramNativeFileFollower(input) {
41532
41575
  };
41533
41576
  let lastChatActionAt = Number.NEGATIVE_INFINITY;
41534
41577
  let turnOpen = false;
41578
+ let cardSentThisTurn = false;
41535
41579
  let heartbeat = null;
41536
41580
  const send = (driver2) => {
41537
41581
  lastChatActionAt = Date.now();
@@ -41568,6 +41612,7 @@ function startTelegramNativeFileFollower(input) {
41568
41612
  };
41569
41613
  const onTurnComplete = () => {
41570
41614
  turnOpen = false;
41615
+ cardSentThisTurn = false;
41571
41616
  if (input.backgroundActive?.() === true) return;
41572
41617
  stopHeartbeat();
41573
41618
  lastChatActionAt = Number.NEGATIVE_INFINITY;
@@ -41596,10 +41641,30 @@ function startTelegramNativeFileFollower(input) {
41596
41641
  onActivity,
41597
41642
  onTurnComplete,
41598
41643
  onTurnStart,
41644
+ // Task 2666 — which tools this turn used. Only `telegram-card` matters: it
41645
+ // posts the answer's own words WITH its buttons, so delivering the turn's
41646
+ // final text beside it shows the visitor the same answer twice. A poll or a
41647
+ // photo is a separate object and its accompanying sentence is usually the
41648
+ // part that explains what it is, so those are left alone.
41649
+ //
41650
+ // Every card call posts or edits a message: `text` is required in
41651
+ // CARD_SHAPE and card.ts always issues sendMessage or editMessageText
41652
+ // before it reaches the optional answerCallbackQuery, so there is no card
41653
+ // call that posts nothing and no bare acknowledgement to keep the text for.
41654
+ onToolUse: (name) => {
41655
+ if (name === TELEGRAM_CARD_TOOL) cardSentThisTurn = true;
41656
+ },
41599
41657
  // Task 2521 — the answer reaches every bound door through the one fan-out.
41600
41658
  // Ungated by design: whatever woke the turn, the reader and the chats show
41601
- // the same thing.
41659
+ // the same thing. Task 2666 adds the one exception above.
41602
41660
  onAnswer: async (answer) => {
41661
+ if (cardSentThisTurn) {
41662
+ cardSentThisTurn = false;
41663
+ console.error(
41664
+ `[telegram-public] op=text-suppressed sessionId=${input.sessionId.slice(0, 8)} messageId=${answer.messageId} reason=card-sent`
41665
+ );
41666
+ return;
41667
+ }
41603
41668
  const targets = input.fanTargets?.() ?? [];
41604
41669
  if (targets.length === 0) return;
41605
41670
  noteAnswer(input.sessionId, answer.messageId);
@@ -43481,7 +43546,7 @@ var scheduleInjectRoutes = createScheduleInjectRoutes({
43481
43546
  }
43482
43547
  }
43483
43548
  if (hits.length === 0) return { kind: "none" };
43484
- if (hits.length > 1) return { kind: "ambiguous", count: hits.length };
43549
+ if (hits.length > 1) return { kind: "ambiguous", claimants: hits };
43485
43550
  return { kind: "one", ...hits[0] };
43486
43551
  }
43487
43552
  // Task 2078 — the same binding the live inbound resolves. Without it a
@@ -1,22 +0,0 @@
1
- /**
2
- * Centralised Anthropic API key management.
3
- *
4
- * Provides read/write/validate operations for the Anthropic API key
5
- * used by the public agent. All consumers import from this module
6
- * instead of inlining the env-var-then-file lookup pattern.
7
- *
8
- * Follows the same shape as cloudflare/mcp/src/lib/cloudflared.ts
9
- * (readToken, writeToken, hasToken, validateToken).
10
- */
11
- export declare function readKey(): string | null;
12
- export declare function writeKey(key: string): void;
13
- export declare function hasKey(): boolean;
14
- export declare function deleteKey(): void;
15
- export type KeyStatus = "valid" | "billing" | "auth_error" | "missing" | "error";
16
- export interface KeyValidation {
17
- status: KeyStatus;
18
- message: string;
19
- }
20
- export declare function validateKey(key?: string): Promise<KeyValidation>;
21
- export declare function keyFilePath(): string;
22
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAoEH,wBAAgB,OAAO,IAAI,MAAM,GAAG,IAAI,CAiDvC;AAMD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAiB1C;AAMD,wBAAgB,MAAM,IAAI,OAAO,CAEhC;AAaD,wBAAgB,SAAS,IAAI,IAAI,CAsBhC;AAUD,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,OAAO,CAAC;AAEjF,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAsFtE;AAOD,wBAAgB,WAAW,IAAI,MAAM,CAEpC"}