@rubytech/create-maxy-code 0.1.593 → 0.1.595

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 (270) hide show
  1. package/package.json +2 -2
  2. package/payload/platform/lib/telegram-button-labels/dist/index.d.ts +19 -0
  3. package/payload/platform/lib/telegram-button-labels/dist/index.d.ts.map +1 -0
  4. package/payload/platform/lib/telegram-button-labels/dist/index.js +84 -0
  5. package/payload/platform/lib/telegram-button-labels/dist/index.js.map +1 -0
  6. package/payload/platform/lib/telegram-button-labels/src/__tests__/store.test.ts +67 -0
  7. package/payload/platform/lib/telegram-button-labels/src/index.ts +88 -0
  8. package/payload/platform/lib/telegram-button-labels/tsconfig.json +9 -0
  9. package/payload/platform/lib/telegram-button-labels/vitest.config.ts +9 -0
  10. package/payload/platform/package.json +3 -2
  11. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +12 -3
  12. package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +10 -0
  13. package/payload/platform/plugins/cloudflare/PLUGIN.md +2 -0
  14. package/payload/platform/plugins/docs/references/internals.md +1 -1
  15. package/payload/platform/plugins/docs/references/telegram-guide.md +10 -1
  16. package/payload/platform/plugins/telegram/mcp/dist/__tests__/card-tool.test.js +43 -0
  17. package/payload/platform/plugins/telegram/mcp/dist/__tests__/card-tool.test.js.map +1 -1
  18. package/payload/platform/plugins/telegram/mcp/dist/tools/card.d.ts.map +1 -1
  19. package/payload/platform/plugins/telegram/mcp/dist/tools/card.js +21 -0
  20. package/payload/platform/plugins/telegram/mcp/dist/tools/card.js.map +1 -1
  21. package/payload/platform/scripts/__tests__/agent-identity-reconcile.test.sh +110 -0
  22. package/payload/platform/scripts/__tests__/check-orphan-dist.test.sh +87 -0
  23. package/payload/platform/scripts/check-orphan-dist.mjs +143 -0
  24. package/payload/platform/scripts/lib/agent-identity-reconcile.sh +122 -0
  25. package/payload/platform/scripts/lib/provision-account-dir.sh +8 -26
  26. package/payload/platform/scripts/setup-account.sh +15 -0
  27. package/payload/platform/services/claude-session-manager/dist/index.js +5 -0
  28. package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
  29. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts +5 -0
  30. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts.map +1 -1
  31. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js +42 -1
  32. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js.map +1 -1
  33. package/payload/platform/templates/agents/public/IDENTITY.md +3 -3
  34. package/payload/server/server.js +543 -409
  35. package/payload/platform/lib/anthropic-key/dist/index.d.ts +0 -22
  36. package/payload/platform/lib/anthropic-key/dist/index.d.ts.map +0 -1
  37. package/payload/platform/lib/anthropic-key/dist/index.js +0 -232
  38. package/payload/platform/lib/anthropic-key/dist/index.js.map +0 -1
  39. package/payload/platform/lib/graph-search/dist/query-expansion.d.ts +0 -37
  40. package/payload/platform/lib/graph-search/dist/query-expansion.d.ts.map +0 -1
  41. package/payload/platform/lib/graph-search/dist/query-expansion.js +0 -101
  42. package/payload/platform/lib/graph-search/dist/query-expansion.js.map +0 -1
  43. package/payload/platform/lib/oauth-llm/dist/index.d.ts +0 -116
  44. package/payload/platform/lib/oauth-llm/dist/index.d.ts.map +0 -1
  45. package/payload/platform/lib/oauth-llm/dist/index.js +0 -386
  46. package/payload/platform/lib/oauth-llm/dist/index.js.map +0 -1
  47. package/payload/platform/lib/screening-patterns/dist/index.d.ts +0 -29
  48. package/payload/platform/lib/screening-patterns/dist/index.d.ts.map +0 -1
  49. package/payload/platform/lib/screening-patterns/dist/index.js +0 -48
  50. package/payload/platform/lib/screening-patterns/dist/index.js.map +0 -1
  51. package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.d.ts +0 -2
  52. package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.d.ts.map +0 -1
  53. package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.js +0 -34
  54. package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.js.map +0 -1
  55. package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.d.ts +0 -39
  56. package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.d.ts.map +0 -1
  57. package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.js +0 -249
  58. package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.js.map +0 -1
  59. package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.d.ts +0 -6
  60. package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.d.ts.map +0 -1
  61. package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.js +0 -32
  62. package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.js.map +0 -1
  63. package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.d.ts +0 -283
  64. package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.d.ts.map +0 -1
  65. package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.js +0 -1155
  66. package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.js.map +0 -1
  67. package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.d.ts +0 -90
  68. package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.d.ts.map +0 -1
  69. package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.js +0 -551
  70. package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.js.map +0 -1
  71. package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.d.ts +0 -17
  72. package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.d.ts.map +0 -1
  73. package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.js +0 -186
  74. package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.js.map +0 -1
  75. package/payload/platform/plugins/email/mcp/dist/lib/screening.d.ts +0 -29
  76. package/payload/platform/plugins/email/mcp/dist/lib/screening.d.ts.map +0 -1
  77. package/payload/platform/plugins/email/mcp/dist/lib/screening.js +0 -105
  78. package/payload/platform/plugins/email/mcp/dist/lib/screening.js.map +0 -1
  79. package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.d.ts +0 -38
  80. package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.d.ts.map +0 -1
  81. package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.js +0 -817
  82. package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.js.map +0 -1
  83. package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.d.ts +0 -30
  84. package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.d.ts.map +0 -1
  85. package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.js +0 -215
  86. package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.js.map +0 -1
  87. package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.d.ts +0 -19
  88. package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.d.ts.map +0 -1
  89. package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.js +0 -151
  90. package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.js.map +0 -1
  91. package/payload/platform/plugins/email/mcp/dist/tools/email-classify.d.ts +0 -6
  92. package/payload/platform/plugins/email/mcp/dist/tools/email-classify.d.ts.map +0 -1
  93. package/payload/platform/plugins/email/mcp/dist/tools/email-classify.js +0 -89
  94. package/payload/platform/plugins/email/mcp/dist/tools/email-classify.js.map +0 -1
  95. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.d.ts +0 -2
  96. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.d.ts.map +0 -1
  97. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.js +0 -90
  98. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.js.map +0 -1
  99. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.d.ts +0 -2
  100. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.d.ts.map +0 -1
  101. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.js +0 -226
  102. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.js.map +0 -1
  103. package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.d.ts +0 -60
  104. package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.d.ts.map +0 -1
  105. package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.js +0 -169
  106. package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.js.map +0 -1
  107. package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts +0 -248
  108. package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts.map +0 -1
  109. package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js +0 -824
  110. package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js.map +0 -1
  111. package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.d.ts +0 -63
  112. package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.d.ts.map +0 -1
  113. package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.js +0 -210
  114. package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.js.map +0 -1
  115. package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.d.ts +0 -35
  116. package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.d.ts.map +0 -1
  117. package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.js +0 -28
  118. package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.js.map +0 -1
  119. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.d.ts +0 -2
  120. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.d.ts.map +0 -1
  121. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.js +0 -68
  122. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.js.map +0 -1
  123. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.d.ts +0 -2
  124. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.d.ts.map +0 -1
  125. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.js +0 -88
  126. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.js.map +0 -1
  127. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.d.ts +0 -2
  128. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.d.ts.map +0 -1
  129. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.js +0 -58
  130. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.js.map +0 -1
  131. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.d.ts +0 -2
  132. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.d.ts.map +0 -1
  133. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.js +0 -64
  134. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.js.map +0 -1
  135. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.d.ts +0 -2
  136. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.d.ts.map +0 -1
  137. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.js +0 -70
  138. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.js.map +0 -1
  139. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.d.ts +0 -2
  140. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.d.ts.map +0 -1
  141. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.js +0 -48
  142. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.js.map +0 -1
  143. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.d.ts +0 -2
  144. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.d.ts.map +0 -1
  145. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.js +0 -74
  146. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.js.map +0 -1
  147. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.d.ts +0 -2
  148. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.d.ts.map +0 -1
  149. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.js +0 -47
  150. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.js.map +0 -1
  151. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.d.ts +0 -2
  152. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.d.ts.map +0 -1
  153. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.js +0 -65
  154. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.js.map +0 -1
  155. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.d.ts +0 -2
  156. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.d.ts.map +0 -1
  157. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.js +0 -43
  158. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.js.map +0 -1
  159. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.d.ts +0 -2
  160. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.d.ts.map +0 -1
  161. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.js +0 -65
  162. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.js.map +0 -1
  163. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.d.ts +0 -2
  164. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.d.ts.map +0 -1
  165. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.js +0 -49
  166. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.js.map +0 -1
  167. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.d.ts +0 -2
  168. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.d.ts.map +0 -1
  169. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.js +0 -79
  170. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.js.map +0 -1
  171. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.d.ts +0 -2
  172. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.d.ts.map +0 -1
  173. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.js +0 -329
  174. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.js.map +0 -1
  175. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.d.ts +0 -2
  176. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.d.ts.map +0 -1
  177. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.js +0 -81
  178. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.js.map +0 -1
  179. package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.d.ts +0 -34
  180. package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.d.ts.map +0 -1
  181. package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.js +0 -62
  182. package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.js.map +0 -1
  183. package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.d.ts +0 -61
  184. package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.d.ts.map +0 -1
  185. package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.js +0 -102
  186. package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.js.map +0 -1
  187. package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.d.ts +0 -35
  188. package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.d.ts.map +0 -1
  189. package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.js +0 -73
  190. package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.js.map +0 -1
  191. package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.d.ts +0 -29
  192. package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.d.ts.map +0 -1
  193. package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.js +0 -22
  194. package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.js.map +0 -1
  195. package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.d.ts +0 -30
  196. package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.d.ts.map +0 -1
  197. package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.js +0 -130
  198. package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.js.map +0 -1
  199. package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.d.ts +0 -65
  200. package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.d.ts.map +0 -1
  201. package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.js +0 -262
  202. package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.js.map +0 -1
  203. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/normalise-start-date.test.d.ts +0 -2
  204. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/normalise-start-date.test.d.ts.map +0 -1
  205. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/normalise-start-date.test.js +0 -100
  206. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/normalise-start-date.test.js.map +0 -1
  207. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/scheduled-seat-id.test.d.ts +0 -2
  208. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/scheduled-seat-id.test.d.ts.map +0 -1
  209. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/scheduled-seat-id.test.js +0 -22
  210. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/scheduled-seat-id.test.js.map +0 -1
  211. package/payload/platform/plugins/scheduling/mcp/dist/lib/scheduled-seat-id.d.ts +0 -11
  212. package/payload/platform/plugins/scheduling/mcp/dist/lib/scheduled-seat-id.d.ts.map +0 -1
  213. package/payload/platform/plugins/scheduling/mcp/dist/lib/scheduled-seat-id.js +0 -19
  214. package/payload/platform/plugins/scheduling/mcp/dist/lib/scheduled-seat-id.js.map +0 -1
  215. package/payload/platform/plugins/telegram/mcp/dist/__tests__/invoice-tool.test.d.ts +0 -2
  216. package/payload/platform/plugins/telegram/mcp/dist/__tests__/invoice-tool.test.d.ts.map +0 -1
  217. package/payload/platform/plugins/telegram/mcp/dist/__tests__/invoice-tool.test.js +0 -196
  218. package/payload/platform/plugins/telegram/mcp/dist/__tests__/invoice-tool.test.js.map +0 -1
  219. package/payload/platform/plugins/telegram/mcp/dist/tools/invoice.d.ts +0 -70
  220. package/payload/platform/plugins/telegram/mcp/dist/tools/invoice.d.ts.map +0 -1
  221. package/payload/platform/plugins/telegram/mcp/dist/tools/invoice.js +0 -247
  222. package/payload/platform/plugins/telegram/mcp/dist/tools/invoice.js.map +0 -1
  223. package/payload/platform/plugins/telegram/mcp/dist/tools/message.d.ts +0 -21
  224. package/payload/platform/plugins/telegram/mcp/dist/tools/message.d.ts.map +0 -1
  225. package/payload/platform/plugins/telegram/mcp/dist/tools/message.js +0 -40
  226. package/payload/platform/plugins/telegram/mcp/dist/tools/message.js.map +0 -1
  227. package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.d.ts +0 -8
  228. package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.d.ts.map +0 -1
  229. package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.js +0 -83
  230. package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.js.map +0 -1
  231. package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.d.ts +0 -151
  232. package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.d.ts.map +0 -1
  233. package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.js +0 -299
  234. package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.js.map +0 -1
  235. package/payload/platform/services/claude-session-manager/dist/account-admin-census.d.ts +0 -39
  236. package/payload/platform/services/claude-session-manager/dist/account-admin-census.d.ts.map +0 -1
  237. package/payload/platform/services/claude-session-manager/dist/account-admin-census.js +0 -122
  238. package/payload/platform/services/claude-session-manager/dist/account-admin-census.js.map +0 -1
  239. package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.d.ts +0 -39
  240. package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.d.ts.map +0 -1
  241. package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.js +0 -133
  242. package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.js.map +0 -1
  243. package/payload/platform/services/claude-session-manager/dist/input-postcondition.d.ts +0 -22
  244. package/payload/platform/services/claude-session-manager/dist/input-postcondition.d.ts.map +0 -1
  245. package/payload/platform/services/claude-session-manager/dist/input-postcondition.js +0 -50
  246. package/payload/platform/services/claude-session-manager/dist/input-postcondition.js.map +0 -1
  247. package/payload/platform/services/claude-session-manager/dist/jsonl-observer.d.ts +0 -30
  248. package/payload/platform/services/claude-session-manager/dist/jsonl-observer.d.ts.map +0 -1
  249. package/payload/platform/services/claude-session-manager/dist/jsonl-observer.js +0 -204
  250. package/payload/platform/services/claude-session-manager/dist/jsonl-observer.js.map +0 -1
  251. package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.d.ts +0 -80
  252. package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.d.ts.map +0 -1
  253. package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.js +0 -306
  254. package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.js.map +0 -1
  255. package/payload/platform/services/claude-session-manager/dist/session-store.d.ts +0 -49
  256. package/payload/platform/services/claude-session-manager/dist/session-store.d.ts.map +0 -1
  257. package/payload/platform/services/claude-session-manager/dist/session-store.js +0 -52
  258. package/payload/platform/services/claude-session-manager/dist/session-store.js.map +0 -1
  259. package/payload/platform/services/claude-session-manager/dist/systemd-spawn.d.ts +0 -83
  260. package/payload/platform/services/claude-session-manager/dist/systemd-spawn.d.ts.map +0 -1
  261. package/payload/platform/services/claude-session-manager/dist/systemd-spawn.js +0 -345
  262. package/payload/platform/services/claude-session-manager/dist/systemd-spawn.js.map +0 -1
  263. package/payload/platform/services/telegram-channel/dist/turn-follow.d.ts +0 -104
  264. package/payload/platform/services/telegram-channel/dist/turn-follow.d.ts.map +0 -1
  265. package/payload/platform/services/telegram-channel/dist/turn-follow.js +0 -408
  266. package/payload/platform/services/telegram-channel/dist/turn-follow.js.map +0 -1
  267. package/payload/platform/services/whatsapp-channel/dist/turn-follow.d.ts +0 -104
  268. package/payload/platform/services/whatsapp-channel/dist/turn-follow.d.ts.map +0 -1
  269. package/payload/platform/services/whatsapp-channel/dist/turn-follow.js +0 -393
  270. package/payload/platform/services/whatsapp-channel/dist/turn-follow.js.map +0 -1
@@ -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"}
@@ -1,232 +0,0 @@
1
- "use strict";
2
- /**
3
- * Centralised Anthropic API key management.
4
- *
5
- * Provides read/write/validate operations for the Anthropic API key
6
- * used by the public agent. All consumers import from this module
7
- * instead of inlining the env-var-then-file lookup pattern.
8
- *
9
- * Follows the same shape as cloudflare/mcp/src/lib/cloudflared.ts
10
- * (readToken, writeToken, hasToken, validateToken).
11
- */
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.readKey = readKey;
14
- exports.writeKey = writeKey;
15
- exports.hasKey = hasKey;
16
- exports.deleteKey = deleteKey;
17
- exports.validateKey = validateKey;
18
- exports.keyFilePath = keyFilePath;
19
- const index_js_1 = require("../../models/dist/index.js");
20
- const node_fs_1 = require("node:fs");
21
- const node_path_1 = require("node:path");
22
- const node_os_1 = require("node:os");
23
- // ---------------------------------------------------------------------------
24
- // Path resolution — lazy, cached
25
- //
26
- // The key file lives at ~/{configDir}/.anthropic-api-key where configDir
27
- // is read from brand.json. Resolution strategy:
28
- // 1. PLATFORM_ROOT env var → brand.json → configDir (MCP servers)
29
- // 2. MAXY_PLATFORM_ROOT env var → brand.json → configDir (UI/Next.js)
30
- // 3. Fall back to .maxy (dev environment, neither env var set)
31
- // ---------------------------------------------------------------------------
32
- let cachedKeyFilePath = null;
33
- function resolveKeyFilePath() {
34
- if (cachedKeyFilePath)
35
- return cachedKeyFilePath;
36
- let configDirName = ".maxy"; // default for dev
37
- const platformRoot = process.env.PLATFORM_ROOT ?? process.env.MAXY_PLATFORM_ROOT;
38
- if (platformRoot) {
39
- const brandPath = (0, node_path_1.join)(platformRoot, "config", "brand.json");
40
- if (!(0, node_fs_1.existsSync)(brandPath)) {
41
- throw new Error(`brand.json not found at ${brandPath} — platform not properly installed`);
42
- }
43
- try {
44
- const brand = JSON.parse((0, node_fs_1.readFileSync)(brandPath, "utf-8"));
45
- if (!brand.configDir) {
46
- throw new Error(`brand.json at ${brandPath} is missing the configDir field`);
47
- }
48
- configDirName = brand.configDir;
49
- }
50
- catch (err) {
51
- if (err instanceof SyntaxError) {
52
- throw new Error(`brand.json at ${brandPath} is not valid JSON: ${err.message}`);
53
- }
54
- throw err;
55
- }
56
- }
57
- cachedKeyFilePath = (0, node_path_1.resolve)((0, node_os_1.homedir)(), configDirName, ".anthropic-api-key");
58
- return cachedKeyFilePath;
59
- }
60
- // ---------------------------------------------------------------------------
61
- // readKey — two-tier lookup: env var → file
62
- //
63
- // Returns the key string or null if unavailable. Never throws on
64
- // missing/unreadable key — callers handle null per their context.
65
- // ---------------------------------------------------------------------------
66
- function readKey() {
67
- const envKey = process.env.ANTHROPIC_API_KEY;
68
- if (envKey && envKey.trim()) {
69
- return envKey.trim();
70
- }
71
- let keyFilePath;
72
- try {
73
- keyFilePath = resolveKeyFilePath();
74
- }
75
- catch (err) {
76
- const msg = err instanceof Error ? err.message : String(err);
77
- console.error(`[anthropic-key] path resolution failed: ${msg}`);
78
- return null;
79
- }
80
- if (envKey !== undefined) {
81
- // env var was set but empty — log and fall through to file
82
- console.error(`[anthropic-key] ANTHROPIC_API_KEY env var is set but empty, falling back to file`);
83
- }
84
- try {
85
- const raw = (0, node_fs_1.readFileSync)(keyFilePath, "utf-8").trim();
86
- if (!raw) {
87
- console.error(`[anthropic-key] key file exists but is empty: ${keyFilePath}`);
88
- return null;
89
- }
90
- return raw;
91
- }
92
- catch (err) {
93
- const code = err instanceof Error && "code" in err
94
- ? err.code
95
- : undefined;
96
- if (code === "ENOENT") {
97
- // File does not exist — expected on fresh installs
98
- console.error(`[anthropic-key] no key available (env var unset, file not found: ${keyFilePath})`);
99
- }
100
- else {
101
- const msg = err instanceof Error ? err.message : String(err);
102
- console.error(`[anthropic-key] failed to read key file ${keyFilePath}: ${msg}`);
103
- }
104
- return null;
105
- }
106
- }
107
- // ---------------------------------------------------------------------------
108
- // writeKey — validate format and write with restricted permissions
109
- // ---------------------------------------------------------------------------
110
- function writeKey(key) {
111
- const trimmed = key.trim();
112
- if (!trimmed.startsWith("sk-ant-")) {
113
- throw new Error("Invalid key format. Must start with sk-ant-.");
114
- }
115
- if (trimmed.length < 90) {
116
- throw new Error("Invalid key format. Must be at least 90 characters.");
117
- }
118
- const keyFilePath = resolveKeyFilePath();
119
- (0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(keyFilePath), { recursive: true });
120
- (0, node_fs_1.writeFileSync)(keyFilePath, trimmed, { mode: 0o600 });
121
- console.error(`[anthropic-key] key written to ${keyFilePath}`);
122
- }
123
- // ---------------------------------------------------------------------------
124
- // hasKey — thin check, no validation
125
- // ---------------------------------------------------------------------------
126
- function hasKey() {
127
- return readKey() !== null;
128
- }
129
- // ---------------------------------------------------------------------------
130
- // deleteKey — remove the stored key file; idempotent on ENOENT
131
- //
132
- // Throws on unexpected fs errors (EACCES, EBUSY, EPERM) so callers can
133
- // surface a structured failure. ENOENT is treated as a no-op because the
134
- // intended post-condition ("no key file on disk") is already satisfied.
135
- // Per Task 531 learning, never use `{ force: true }` — it swallows the
136
- // error classes that matter (permission, busy) and leaves the caller
137
- // believing removal succeeded.
138
- // ---------------------------------------------------------------------------
139
- function deleteKey() {
140
- const keyFilePath = resolveKeyFilePath();
141
- try {
142
- (0, node_fs_1.unlinkSync)(keyFilePath);
143
- console.error(`[anthropic-key] deleteKey: removed ${keyFilePath}`);
144
- }
145
- catch (err) {
146
- const code = err instanceof Error && "code" in err
147
- ? err.code
148
- : undefined;
149
- if (code === "ENOENT") {
150
- console.error(`[anthropic-key] deleteKey: nothing to remove (ENOENT): ${keyFilePath}`);
151
- return;
152
- }
153
- const msg = err instanceof Error ? err.message : String(err);
154
- console.error(`[anthropic-key] deleteKey: failed to remove ${keyFilePath}: ${msg}`);
155
- throw err;
156
- }
157
- }
158
- async function validateKey(key) {
159
- const effectiveKey = key ?? readKey();
160
- if (!effectiveKey) {
161
- return {
162
- status: "missing",
163
- message: "No API key available (env var unset, file missing or empty).",
164
- };
165
- }
166
- const start = Date.now();
167
- try {
168
- const res = await fetch("https://api.anthropic.com/v1/messages", {
169
- method: "POST",
170
- headers: {
171
- "Content-Type": "application/json",
172
- "x-api-key": effectiveKey,
173
- "anthropic-version": "2023-06-01",
174
- },
175
- body: JSON.stringify({
176
- model: index_js_1.HAIKU_MODEL,
177
- max_tokens: 1,
178
- messages: [{ role: "user", content: "hi" }],
179
- }),
180
- signal: AbortSignal.timeout(10000),
181
- });
182
- const latency = Date.now() - start;
183
- if (res.ok || res.status === 429) {
184
- // Consume the response body to release the connection back to the pool.
185
- await res.text();
186
- console.error(`[anthropic-key] validate: valid (${res.status}, ${latency}ms)`);
187
- return {
188
- status: "valid",
189
- message: "API key is working. Credits available.",
190
- };
191
- }
192
- const body = await res.text();
193
- if (/credit balance|billing|purchase credits/i.test(body)) {
194
- console.error(`[anthropic-key] validate: billing (${res.status}, ${latency}ms)`);
195
- return {
196
- status: "billing",
197
- message: "API key is valid but credit balance is too low. The user must add credits at console.anthropic.com under Plans & Billing, or enable auto-top-up.",
198
- };
199
- }
200
- if (res.status === 401 ||
201
- res.status === 403 ||
202
- /authentication_error|permission_error/i.test(body)) {
203
- console.error(`[anthropic-key] validate: auth_error (${res.status}, ${latency}ms)`);
204
- return {
205
- status: "auth_error",
206
- message: "API key was rejected. It may be invalid, revoked, or expired. The user should create a new key at console.anthropic.com/settings/keys.",
207
- };
208
- }
209
- console.error(`[anthropic-key] validate: error (${res.status}, ${latency}ms)`);
210
- return {
211
- status: "error",
212
- message: `Could not verify API key. Anthropic returned ${res.status}. This may be a temporary outage — try again later.`,
213
- };
214
- }
215
- catch (err) {
216
- const latency = Date.now() - start;
217
- const msg = err instanceof Error ? err.message : String(err);
218
- console.error(`[anthropic-key] validate: error (network failure, ${latency}ms): ${msg}`);
219
- return {
220
- status: "error",
221
- message: `Could not reach the Anthropic API: ${msg}. Check network connectivity.`,
222
- };
223
- }
224
- }
225
- // ---------------------------------------------------------------------------
226
- // keyFilePath — expose the resolved path for callers that need it
227
- // (e.g., existsSync checks, user-facing messages about the key location)
228
- // ---------------------------------------------------------------------------
229
- function keyFilePath() {
230
- return resolveKeyFilePath();
231
- }
232
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAoEH,0BAiDC;AAMD,4BAiBC;AAMD,wBAEC;AAaD,8BAsBC;AAiBD,kCAsFC;AAOD,kCAEC;AArSD,yDAAyD;AACzD,qCAMiB;AACjB,yCAAmD;AACnD,qCAAkC;AAElC,8EAA8E;AAC9E,iCAAiC;AACjC,EAAE;AACF,yEAAyE;AACzE,gDAAgD;AAChD,qEAAqE;AACrE,yEAAyE;AACzE,kEAAkE;AAClE,8EAA8E;AAE9E,IAAI,iBAAiB,GAAkB,IAAI,CAAC;AAE5C,SAAS,kBAAkB;IACzB,IAAI,iBAAiB;QAAE,OAAO,iBAAiB,CAAC;IAEhD,IAAI,aAAa,GAAG,OAAO,CAAC,CAAC,kBAAkB;IAC/C,MAAM,YAAY,GAChB,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;IAE9D,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,SAAS,GAAG,IAAA,gBAAI,EAAC,YAAY,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;QAC7D,IAAI,CAAC,IAAA,oBAAU,EAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CACb,2BAA2B,SAAS,oCAAoC,CACzE,CAAC;QACJ,CAAC;QACD,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;YAC3D,IAA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E,SAAgB,WAAW;IACzB,OAAO,kBAAkB,EAAE,CAAC;AAC9B,CAAC"}
@@ -1,37 +0,0 @@
1
- /**
2
- * Multi-query expansion via Haiku (Task 308).
3
- *
4
- * Generates 3-5 paraphrases of the user query so the hybrid pipeline runs
5
- * each paraphrase against vector + BM25 in parallel and unions the
6
- * candidate sets before fusion. Recovers recall on terse queries where the
7
- * embedding's nearest-neighbour is unstable.
8
- *
9
- * The expansion runs through `@rubytech/oauth-llm` against Claude Haiku —
10
- * the same OAuth-bearer path the admin classifiers use; no new SDK
11
- * dependency and no Anthropic-API-key path. Cache is in-process, keyed by
12
- * (accountId, normalisedQuery, retrievalClass), with a 1-hour TTL.
13
- *
14
- * Graceful degrade: if the LLM call fails, returns just the original
15
- * query. The caller's hybrid pipeline still runs — just on one query
16
- * instead of N — so missing paraphrases are a recall regression, not a
17
- * fault.
18
- */
19
- export declare function clearExpansionCache(): void;
20
- export interface ExpandQueryParams {
21
- query: string;
22
- retrievalClass?: string;
23
- accountId?: string;
24
- /**
25
- * Override the cache or skip it entirely (useful in tests). When
26
- * `false`, the cache is read but never written; when `true` (default),
27
- * both reads and writes are active.
28
- */
29
- useCache?: boolean;
30
- }
31
- /**
32
- * Return `[query, ...paraphrases]` (original always first). On LLM
33
- * failure returns `[query]` only and writes a single stderr line so the
34
- * operator can see expansion is degrading without breaking search.
35
- */
36
- export declare function expandQuery(params: ExpandQueryParams): Promise<string[]>;
37
- //# sourceMappingURL=query-expansion.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"query-expansion.d.ts","sourceRoot":"","sources":["../src/query-expansion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAeH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,MAAM,EAAE,CAAC,CAyEnB"}
@@ -1,101 +0,0 @@
1
- "use strict";
2
- /**
3
- * Multi-query expansion via Haiku (Task 308).
4
- *
5
- * Generates 3-5 paraphrases of the user query so the hybrid pipeline runs
6
- * each paraphrase against vector + BM25 in parallel and unions the
7
- * candidate sets before fusion. Recovers recall on terse queries where the
8
- * embedding's nearest-neighbour is unstable.
9
- *
10
- * The expansion runs through `@rubytech/oauth-llm` against Claude Haiku —
11
- * the same OAuth-bearer path the admin classifiers use; no new SDK
12
- * dependency and no Anthropic-API-key path. Cache is in-process, keyed by
13
- * (accountId, normalisedQuery, retrievalClass), with a 1-hour TTL.
14
- *
15
- * Graceful degrade: if the LLM call fails, returns just the original
16
- * query. The caller's hybrid pipeline still runs — just on one query
17
- * instead of N — so missing paraphrases are a recall regression, not a
18
- * fault.
19
- */
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.clearExpansionCache = clearExpansionCache;
22
- exports.expandQuery = expandQuery;
23
- const index_js_1 = require("../../oauth-llm/dist/index.js");
24
- const CACHE_TTL_MS = 60 * 60 * 1000;
25
- const HAIKU_MODEL = "claude-haiku-4-5";
26
- const MAX_PARAPHRASES = 5;
27
- const cache = new Map();
28
- function clearExpansionCache() {
29
- cache.clear();
30
- }
31
- /**
32
- * Return `[query, ...paraphrases]` (original always first). On LLM
33
- * failure returns `[query]` only and writes a single stderr line so the
34
- * operator can see expansion is degrading without breaking search.
35
- */
36
- async function expandQuery(params) {
37
- const { query, retrievalClass = "general", accountId = "", useCache = true } = params;
38
- const normalised = query.trim().toLowerCase();
39
- const cacheKey = `${accountId}::${retrievalClass}::${normalised}`;
40
- if (useCache) {
41
- const hit = cache.get(cacheKey);
42
- if (hit && hit.expiresAt > Date.now()) {
43
- return [query, ...hit.expansions];
44
- }
45
- }
46
- const systemPrompt = [
47
- "You generate paraphrases of a user query for hybrid graph search.",
48
- "Return 3-5 alternative phrasings that preserve the user's intent but vary the surface form (synonyms, word order, entity-vs-attribute framing).",
49
- "Do not change the entity names. Do not invent constraints the user did not state.",
50
- "Output ONLY a JSON object via the provided tool; never free text.",
51
- ].join("\n");
52
- const classHint = retrievalClass === "general"
53
- ? ""
54
- : `The retrieval class is '${retrievalClass}' — tailor paraphrases accordingly.`;
55
- const userMessage = [
56
- `Original query: ${query}`,
57
- classHint,
58
- ].filter((s) => s.length > 0).join("\n");
59
- const result = await (0, index_js_1.callOauthLlm)({
60
- model: HAIKU_MODEL,
61
- system: systemPrompt,
62
- userMessage,
63
- maxTokens: 512,
64
- timeoutMs: 15_000,
65
- tools: [
66
- {
67
- name: "emit_paraphrases",
68
- description: "Emit 3-5 paraphrases of the user query.",
69
- input_schema: {
70
- type: "object",
71
- properties: {
72
- paraphrases: {
73
- type: "array",
74
- items: { type: "string" },
75
- minItems: 3,
76
- maxItems: MAX_PARAPHRASES,
77
- },
78
- },
79
- required: ["paraphrases"],
80
- },
81
- },
82
- ],
83
- toolChoiceName: "emit_paraphrases",
84
- });
85
- if (result.kind !== "ok-tool") {
86
- process.stderr.write(`[graph-search:expansion-failed] cause=${result.kind === "fallback" ? result.cause : "unexpected"} query=${query.slice(0, 60).replace(/\s+/g, " ")}\n`);
87
- return [query];
88
- }
89
- const raw = result.input.paraphrases;
90
- if (!Array.isArray(raw))
91
- return [query];
92
- const expansions = raw
93
- .filter((p) => typeof p === "string" && p.trim().length > 0)
94
- .map((p) => p.trim())
95
- .slice(0, MAX_PARAPHRASES);
96
- if (useCache) {
97
- cache.set(cacheKey, { expansions, expiresAt: Date.now() + CACHE_TTL_MS });
98
- }
99
- return [query, ...expansions];
100
- }
101
- //# sourceMappingURL=query-expansion.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"query-expansion.js","sourceRoot":"","sources":["../src/query-expansion.ts"],"names":[],"mappings":";AAAA;;;;;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AAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;SACxE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC;IAE7B,IAAI,QAAQ,EAAE,CAAC;QACb,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,OAAO,CAAC,KAAK,EAAE,GAAG,UAAU,CAAC,CAAC;AAChC,CAAC"}
@@ -1,116 +0,0 @@
1
- /**
2
- * OAuth-bearer LLM calls for admin-side classifiers.
3
- *
4
- * Every admin-side classifier (memory-classify, memory-rank, commitment,
5
- * inbound-gateway, query classifier, summarisation, email
6
- * screening) uses Claude Code OAuth credentials — never the Anthropic
7
- * API key. The API-key path is reserved for the public agent.
8
- *
9
- * Mechanism: read the access token from ~/.claude/.credentials.json,
10
- * refresh it via the standard refresh-token grant if expired, then call
11
- * api.anthropic.com with `Authorization: Bearer <token>` and the
12
- * `anthropic-beta: oauth-2025-04-20` header. Billed against the operator's
13
- * Claude Code subscription, not the API-key key. Refresh uses a
14
- * module-level mutex so concurrent classifier calls during expiry don't
15
- * race and invalidate each other's tokens (Anthropic rotates both tokens
16
- * on refresh).
17
- *
18
- * Implementation note: this lib uses raw fetch() so the maxy-code tree
19
- * carries no Anthropic SDK dependency at all. The Messages API surface
20
- * we use (model + system + one user message + max_tokens) is small and
21
- * stable.
22
- *
23
- * Failure modes are surfaced as a structured `Result` so callers can
24
- * pattern-match without parsing error strings. The skill / agent layer
25
- * is responsible for translating `fallback` results into operator-visible
26
- * blocker messages (loud failure doctrine).
27
- */
28
- declare const OAUTH_BETA_HEADER = "oauth-2025-04-20";
29
- /** Anthropic tool definition — structural-output enforcement via function calling. */
30
- export interface OauthLlmTool {
31
- name: string;
32
- description: string;
33
- input_schema: Record<string, unknown>;
34
- }
35
- export interface CallOauthLlmParams {
36
- /** Anthropic model id (e.g. claude-haiku-4-5). */
37
- model: string;
38
- /** System prompt — the classifier instructions. */
39
- system: string;
40
- /** User message — the input to classify / rank / etc. */
41
- userMessage: string;
42
- /** Max output tokens. Default 4096. */
43
- maxTokens?: number;
44
- /**
45
- * Hard timeout in ms for the model call. Default 60_000.
46
- *
47
- * 60s fits short admin classifiers (commitment, query,
48
- * inbound-gateway, screening, summary — all <2K input, <500 output).
49
- * Long-output callers MUST override per-call: `memory-classify` runs at
50
- * 8K maxTokens against documents up to 20K chars and has been observed
51
- * at 56s p99 on Haiku 4.5, so it passes `timeoutMs: 180_000`.
52
- * Do not raise this default — short classifiers rely on the 60s safety
53
- * net to surface transient stalls instead of disguising them as latency.
54
- */
55
- timeoutMs?: number;
56
- /**
57
- * Optional tools for structured output. When provided with a forced
58
- * `toolChoiceName`, the model returns a `tool_use` block whose `input` is
59
- * a structured object matching the tool's `input_schema` — strictly typed
60
- * JSON without the parsing brittleness of free-form text output.
61
- */
62
- tools?: OauthLlmTool[];
63
- /** Force the model to call this tool. Required when `tools` is provided. */
64
- toolChoiceName?: string;
65
- }
66
- /** Result when the call did not declare any tool — only text or fallback.
67
- * `stopReason` and `outputTokens` are exposed so callers can
68
- * distinguish a `max_tokens`-truncated response (which can produce a
69
- * one-sided fence) from a clean `end_turn`. */
70
- export type CallOauthLlmTextResult = {
71
- kind: "ok";
72
- text: string;
73
- stopReason?: string;
74
- outputTokens?: number;
75
- } | CallOauthLlmFallback;
76
- /** Result when the call forced a tool — only the tool input or fallback. */
77
- export type CallOauthLlmToolResult = {
78
- kind: "ok-tool";
79
- toolName: string;
80
- input: Record<string, unknown>;
81
- stopReason?: string;
82
- outputTokens?: number;
83
- } | CallOauthLlmFallback;
84
- /** Discriminated union of every possible result. Returned by the no-overload form. */
85
- export type CallOauthLlmResult = CallOauthLlmTextResult | CallOauthLlmToolResult;
86
- export interface CallOauthLlmFallback {
87
- kind: "fallback";
88
- /** Human-readable single-line reason (for operator-visible blocker). */
89
- reason: string;
90
- /** Stable classifier — callers can pattern-match for retry/abort policy. */
91
- cause: "missing-creds" | "dead-token" | "refresh-failed" | "auth-error" | "rate-limit" | "server-error" | "network-error" | "timeout" | "empty-response" | "malformed-response" | "input-too-large" | "unexpected";
92
- }
93
- /**
94
- * Call an Anthropic model via OAuth bearer auth.
95
- *
96
- * Returns:
97
- * { kind: "ok", text } — model's text response
98
- * { kind: "ok-tool", toolName, input } — when `tools` + `toolChoiceName` provided
99
- * { kind: "fallback", reason, cause } — caller decides whether to abort
100
- *
101
- * The caller is responsible for translating fallback results into
102
- * operator-visible blocker messages — this wrapper never silently
103
- * substitutes a degraded response.
104
- *
105
- * Overloads narrow the return type by call shape: text-only callers (no
106
- * `tools`) statically rule out `ok-tool`; tool callers statically rule out
107
- * `ok`. Mixed callers get the full union.
108
- */
109
- export declare function callOauthLlm(params: Omit<CallOauthLlmParams, "tools" | "toolChoiceName">): Promise<CallOauthLlmTextResult>;
110
- export declare function callOauthLlm(params: CallOauthLlmParams & {
111
- tools: OauthLlmTool[];
112
- toolChoiceName: string;
113
- }): Promise<CallOauthLlmToolResult>;
114
- export declare function callOauthLlm(params: CallOauthLlmParams): Promise<CallOauthLlmResult>;
115
- export { OAUTH_BETA_HEADER };
116
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AA0BH,QAAA,MAAM,iBAAiB,qBAAqB,CAAC;AAe7C,sFAAsF;AACtF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO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