crypto-quant-signal-mcp 1.33.0 → 1.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (377) hide show
  1. package/.cursor-plugin/plugin.json +1 -1
  2. package/README.md +20 -15
  3. package/dist/index.d.ts +56 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +200 -25
  6. package/dist/index.js.map +1 -1
  7. package/dist/lib/adapters/binance.d.ts +2 -0
  8. package/dist/lib/adapters/binance.d.ts.map +1 -1
  9. package/dist/lib/adapters/binance.js +47 -0
  10. package/dist/lib/adapters/binance.js.map +1 -1
  11. package/dist/lib/anchor-batch.d.ts +194 -0
  12. package/dist/lib/anchor-batch.d.ts.map +1 -0
  13. package/dist/lib/anchor-batch.js +314 -0
  14. package/dist/lib/anchor-batch.js.map +1 -0
  15. package/dist/lib/asset-class-detection.d.ts +4 -6
  16. package/dist/lib/asset-class-detection.d.ts.map +1 -1
  17. package/dist/lib/asset-class-detection.js +160 -9
  18. package/dist/lib/asset-class-detection.js.map +1 -1
  19. package/dist/lib/call-ledger.d.ts +137 -0
  20. package/dist/lib/call-ledger.d.ts.map +1 -0
  21. package/dist/lib/call-ledger.js +191 -0
  22. package/dist/lib/call-ledger.js.map +1 -0
  23. package/dist/lib/channel-registry.d.ts.map +1 -1
  24. package/dist/lib/channel-registry.js +11 -1
  25. package/dist/lib/channel-registry.js.map +1 -1
  26. package/dist/lib/docs-outline.d.ts.map +1 -1
  27. package/dist/lib/docs-outline.js +2 -1
  28. package/dist/lib/docs-outline.js.map +1 -1
  29. package/dist/lib/email.d.ts.map +1 -1
  30. package/dist/lib/email.js +7 -0
  31. package/dist/lib/email.js.map +1 -1
  32. package/dist/lib/feature-registry.d.ts +37 -0
  33. package/dist/lib/feature-registry.d.ts.map +1 -1
  34. package/dist/lib/feature-registry.js +39 -3
  35. package/dist/lib/feature-registry.js.map +1 -1
  36. package/dist/lib/idempotency.d.ts.map +1 -1
  37. package/dist/lib/idempotency.js +1 -0
  38. package/dist/lib/idempotency.js.map +1 -1
  39. package/dist/lib/indicators.d.ts.map +1 -1
  40. package/dist/lib/indicators.js +17 -10
  41. package/dist/lib/indicators.js.map +1 -1
  42. package/dist/lib/integrations-data/claim-evidence.d.ts +8 -2
  43. package/dist/lib/integrations-data/claim-evidence.d.ts.map +1 -1
  44. package/dist/lib/integrations-data/claim-evidence.js +36 -1
  45. package/dist/lib/integrations-data/claim-evidence.js.map +1 -1
  46. package/dist/lib/integrations-data/mcp-clients.d.ts.map +1 -1
  47. package/dist/lib/integrations-data/mcp-clients.js +0 -39
  48. package/dist/lib/integrations-data/mcp-clients.js.map +1 -1
  49. package/dist/lib/integrations-data/retired-slugs.d.ts +26 -0
  50. package/dist/lib/integrations-data/retired-slugs.d.ts.map +1 -0
  51. package/dist/lib/integrations-data/retired-slugs.js +29 -0
  52. package/dist/lib/integrations-data/retired-slugs.js.map +1 -0
  53. package/dist/lib/key-reveal.d.ts +20 -0
  54. package/dist/lib/key-reveal.d.ts.map +1 -0
  55. package/dist/lib/key-reveal.js +119 -0
  56. package/dist/lib/key-reveal.js.map +1 -0
  57. package/dist/lib/market-regime-core.d.ts +4 -1
  58. package/dist/lib/market-regime-core.d.ts.map +1 -1
  59. package/dist/lib/market-regime-core.js +42 -24
  60. package/dist/lib/market-regime-core.js.map +1 -1
  61. package/dist/lib/market-sessions-constants.d.ts +147 -1
  62. package/dist/lib/market-sessions-constants.d.ts.map +1 -1
  63. package/dist/lib/market-sessions-constants.js +90 -0
  64. package/dist/lib/market-sessions-constants.js.map +1 -1
  65. package/dist/lib/merkle-root-registry-creation-code.d.ts +15 -0
  66. package/dist/lib/merkle-root-registry-creation-code.d.ts.map +1 -0
  67. package/dist/lib/merkle-root-registry-creation-code.js +5 -0
  68. package/dist/lib/merkle-root-registry-creation-code.js.map +1 -0
  69. package/dist/lib/nav-manifest.d.ts +8 -2
  70. package/dist/lib/nav-manifest.d.ts.map +1 -1
  71. package/dist/lib/nav-manifest.js +10 -3
  72. package/dist/lib/nav-manifest.js.map +1 -1
  73. package/dist/lib/okx-a2mcp.d.ts +12 -0
  74. package/dist/lib/okx-a2mcp.d.ts.map +1 -1
  75. package/dist/lib/okx-a2mcp.js +75 -45
  76. package/dist/lib/okx-a2mcp.js.map +1 -1
  77. package/dist/lib/onchain-registries.d.ts +116 -0
  78. package/dist/lib/onchain-registries.d.ts.map +1 -0
  79. package/dist/lib/onchain-registries.js +69 -0
  80. package/dist/lib/onchain-registries.js.map +1 -0
  81. package/dist/lib/performance-db.d.ts +0 -4
  82. package/dist/lib/performance-db.d.ts.map +1 -1
  83. package/dist/lib/performance-db.js +0 -22
  84. package/dist/lib/performance-db.js.map +1 -1
  85. package/dist/lib/pre-trade-calc.d.ts +42 -0
  86. package/dist/lib/pre-trade-calc.d.ts.map +1 -1
  87. package/dist/lib/pre-trade-calc.js +100 -0
  88. package/dist/lib/pre-trade-calc.js.map +1 -1
  89. package/dist/lib/pre-trade-check-log.d.ts +56 -5
  90. package/dist/lib/pre-trade-check-log.d.ts.map +1 -1
  91. package/dist/lib/pre-trade-check-log.js +197 -15
  92. package/dist/lib/pre-trade-check-log.js.map +1 -1
  93. package/dist/lib/pre-trade-decision.d.ts +6 -2
  94. package/dist/lib/pre-trade-decision.d.ts.map +1 -1
  95. package/dist/lib/pre-trade-decision.js +9 -4
  96. package/dist/lib/pre-trade-decision.js.map +1 -1
  97. package/dist/lib/pre-trade-odds-calibration.d.ts +111 -0
  98. package/dist/lib/pre-trade-odds-calibration.d.ts.map +1 -0
  99. package/dist/lib/pre-trade-odds-calibration.js +842 -0
  100. package/dist/lib/pre-trade-odds-calibration.js.map +1 -0
  101. package/dist/lib/pre-trade-rule-profiles.d.ts +31 -0
  102. package/dist/lib/pre-trade-rule-profiles.d.ts.map +1 -0
  103. package/dist/lib/pre-trade-rule-profiles.js +132 -0
  104. package/dist/lib/pre-trade-rule-profiles.js.map +1 -0
  105. package/dist/lib/pre-trade-rules-api.d.ts +25 -0
  106. package/dist/lib/pre-trade-rules-api.d.ts.map +1 -0
  107. package/dist/lib/pre-trade-rules-api.js +172 -0
  108. package/dist/lib/pre-trade-rules-api.js.map +1 -0
  109. package/dist/lib/pre-trade-rules.d.ts +21 -7
  110. package/dist/lib/pre-trade-rules.d.ts.map +1 -1
  111. package/dist/lib/pre-trade-rules.js +20 -6
  112. package/dist/lib/pre-trade-rules.js.map +1 -1
  113. package/dist/lib/rail-mount.d.ts +38 -5
  114. package/dist/lib/rail-mount.d.ts.map +1 -1
  115. package/dist/lib/rail-mount.js +56 -5
  116. package/dist/lib/rail-mount.js.map +1 -1
  117. package/dist/lib/receipts.d.ts +1 -1
  118. package/dist/lib/refuse-encoded-bodies.d.ts +6 -5
  119. package/dist/lib/refuse-encoded-bodies.d.ts.map +1 -1
  120. package/dist/lib/refuse-encoded-bodies.js +6 -4
  121. package/dist/lib/refuse-encoded-bodies.js.map +1 -1
  122. package/dist/lib/sr-zones/params.d.ts +51 -0
  123. package/dist/lib/sr-zones/params.d.ts.map +1 -0
  124. package/dist/lib/sr-zones/params.js +54 -0
  125. package/dist/lib/sr-zones/params.js.map +1 -0
  126. package/dist/lib/sr-zones/rounding.d.ts +38 -0
  127. package/dist/lib/sr-zones/rounding.d.ts.map +1 -0
  128. package/dist/lib/sr-zones/rounding.js +112 -0
  129. package/dist/lib/sr-zones/rounding.js.map +1 -0
  130. package/dist/lib/sr-zones/served.d.ts +47 -0
  131. package/dist/lib/sr-zones/served.d.ts.map +1 -0
  132. package/dist/lib/sr-zones/served.js +48 -0
  133. package/dist/lib/sr-zones/served.js.map +1 -0
  134. package/dist/lib/sr-zones/summary.d.ts +23 -0
  135. package/dist/lib/sr-zones/summary.d.ts.map +1 -0
  136. package/dist/lib/sr-zones/summary.js +55 -0
  137. package/dist/lib/sr-zones/summary.js.map +1 -0
  138. package/dist/lib/sr-zones/zones.d.ts +109 -0
  139. package/dist/lib/sr-zones/zones.d.ts.map +1 -0
  140. package/dist/lib/sr-zones/zones.js +348 -0
  141. package/dist/lib/sr-zones/zones.js.map +1 -0
  142. package/dist/lib/stripe.d.ts +28 -0
  143. package/dist/lib/stripe.d.ts.map +1 -1
  144. package/dist/lib/stripe.js +36 -5
  145. package/dist/lib/stripe.js.map +1 -1
  146. package/dist/lib/tg-signin-tokens.d.ts +82 -0
  147. package/dist/lib/tg-signin-tokens.d.ts.map +1 -0
  148. package/dist/lib/tg-signin-tokens.js +278 -0
  149. package/dist/lib/tg-signin-tokens.js.map +1 -0
  150. package/dist/lib/tool-call-pipeline.d.ts.map +1 -1
  151. package/dist/lib/tool-call-pipeline.js +32 -1
  152. package/dist/lib/tool-call-pipeline.js.map +1 -1
  153. package/dist/lib/tool-param-schema.d.ts +7 -3
  154. package/dist/lib/tool-param-schema.d.ts.map +1 -1
  155. package/dist/lib/tool-param-schema.js +13 -1
  156. package/dist/lib/tool-param-schema.js.map +1 -1
  157. package/dist/lib/verdict-rule-assignment.d.ts +7 -2
  158. package/dist/lib/verdict-rule-assignment.d.ts.map +1 -1
  159. package/dist/lib/verdict-rule-assignment.js +9 -4
  160. package/dist/lib/verdict-rule-assignment.js.map +1 -1
  161. package/dist/lib/welcome-page.d.ts +18 -0
  162. package/dist/lib/welcome-page.d.ts.map +1 -1
  163. package/dist/lib/welcome-page.js +47 -9
  164. package/dist/lib/welcome-page.js.map +1 -1
  165. package/dist/lib/x402-bazaar.d.ts.map +1 -1
  166. package/dist/lib/x402-bazaar.js +57 -2
  167. package/dist/lib/x402-bazaar.js.map +1 -1
  168. package/dist/lib/x402-http-routes.d.ts +1 -1
  169. package/dist/lib/x402-http-routes.d.ts.map +1 -1
  170. package/dist/lib/x402-http-routes.js +1 -1
  171. package/dist/lib/x402-http-routes.js.map +1 -1
  172. package/dist/scripts/ads1/spec.d.ts +1 -1
  173. package/dist/scripts/ads1/spec.d.ts.map +1 -1
  174. package/dist/scripts/ads1/spec.js +1 -1
  175. package/dist/scripts/ads1/spec.js.map +1 -1
  176. package/dist/scripts/book-liveness-probe.d.ts +72 -0
  177. package/dist/scripts/book-liveness-probe.d.ts.map +1 -0
  178. package/dist/scripts/book-liveness-probe.js +314 -0
  179. package/dist/scripts/book-liveness-probe.js.map +1 -0
  180. package/dist/scripts/deploy-call-ledger-registry.d.ts +83 -0
  181. package/dist/scripts/deploy-call-ledger-registry.d.ts.map +1 -0
  182. package/dist/scripts/deploy-call-ledger-registry.js +155 -0
  183. package/dist/scripts/deploy-call-ledger-registry.js.map +1 -0
  184. package/dist/scripts/pre-trade-health.d.ts +46 -4
  185. package/dist/scripts/pre-trade-health.d.ts.map +1 -1
  186. package/dist/scripts/pre-trade-health.js +66 -7
  187. package/dist/scripts/pre-trade-health.js.map +1 -1
  188. package/dist/scripts/pre-trade-outcome-labeler.d.ts +96 -0
  189. package/dist/scripts/pre-trade-outcome-labeler.d.ts.map +1 -0
  190. package/dist/scripts/pre-trade-outcome-labeler.js +378 -0
  191. package/dist/scripts/pre-trade-outcome-labeler.js.map +1 -0
  192. package/dist/scripts/publish-call-ledger-batch.d.ts +56 -0
  193. package/dist/scripts/publish-call-ledger-batch.d.ts.map +1 -0
  194. package/dist/scripts/publish-call-ledger-batch.js +241 -0
  195. package/dist/scripts/publish-call-ledger-batch.js.map +1 -0
  196. package/dist/scripts/publish-merkle-batch.d.ts +49 -10
  197. package/dist/scripts/publish-merkle-batch.d.ts.map +1 -1
  198. package/dist/scripts/publish-merkle-batch.js +224 -100
  199. package/dist/scripts/publish-merkle-batch.js.map +1 -1
  200. package/dist/scripts/regime-census/census-extract-sql.d.ts +47 -0
  201. package/dist/scripts/regime-census/census-extract-sql.d.ts.map +1 -0
  202. package/dist/scripts/regime-census/census-extract-sql.js +231 -0
  203. package/dist/scripts/regime-census/census-extract-sql.js.map +1 -0
  204. package/dist/scripts/regime-diag/archive.d.ts +73 -0
  205. package/dist/scripts/regime-diag/archive.d.ts.map +1 -0
  206. package/dist/scripts/regime-diag/archive.js +200 -0
  207. package/dist/scripts/regime-diag/archive.js.map +1 -0
  208. package/dist/scripts/regime-diag/bars.d.ts +125 -0
  209. package/dist/scripts/regime-diag/bars.d.ts.map +1 -0
  210. package/dist/scripts/regime-diag/bars.js +239 -0
  211. package/dist/scripts/regime-diag/bars.js.map +1 -0
  212. package/dist/scripts/regime-diag/decide.d.ts +143 -0
  213. package/dist/scripts/regime-diag/decide.d.ts.map +1 -0
  214. package/dist/scripts/regime-diag/decide.js +263 -0
  215. package/dist/scripts/regime-diag/decide.js.map +1 -0
  216. package/dist/scripts/regime-diag/diag-spec.d.ts +120 -0
  217. package/dist/scripts/regime-diag/diag-spec.d.ts.map +1 -0
  218. package/dist/scripts/regime-diag/diag-spec.js +155 -0
  219. package/dist/scripts/regime-diag/diag-spec.js.map +1 -0
  220. package/dist/scripts/regime-diag/engine.d.ts +123 -0
  221. package/dist/scripts/regime-diag/engine.d.ts.map +1 -0
  222. package/dist/scripts/regime-diag/engine.js +292 -0
  223. package/dist/scripts/regime-diag/engine.js.map +1 -0
  224. package/dist/scripts/regime-diag/frame.d.ts +93 -0
  225. package/dist/scripts/regime-diag/frame.d.ts.map +1 -0
  226. package/dist/scripts/regime-diag/frame.js +366 -0
  227. package/dist/scripts/regime-diag/frame.js.map +1 -0
  228. package/dist/scripts/regime-diag/guard.d.ts +65 -0
  229. package/dist/scripts/regime-diag/guard.d.ts.map +1 -0
  230. package/dist/scripts/regime-diag/guard.js +180 -0
  231. package/dist/scripts/regime-diag/guard.js.map +1 -0
  232. package/dist/scripts/regime-diag/keys.d.ts +42 -0
  233. package/dist/scripts/regime-diag/keys.d.ts.map +1 -0
  234. package/dist/scripts/regime-diag/keys.js +151 -0
  235. package/dist/scripts/regime-diag/keys.js.map +1 -0
  236. package/dist/scripts/regime-diag/labeler.d.ts +33 -0
  237. package/dist/scripts/regime-diag/labeler.d.ts.map +1 -0
  238. package/dist/scripts/regime-diag/labeler.js +138 -0
  239. package/dist/scripts/regime-diag/labeler.js.map +1 -0
  240. package/dist/scripts/regime-diag/mutate.d.ts +2 -0
  241. package/dist/scripts/regime-diag/mutate.d.ts.map +1 -0
  242. package/dist/scripts/regime-diag/mutate.js +10 -0
  243. package/dist/scripts/regime-diag/mutate.js.map +1 -0
  244. package/dist/scripts/regime-diag/parity.d.ts +19 -0
  245. package/dist/scripts/regime-diag/parity.d.ts.map +1 -0
  246. package/dist/scripts/regime-diag/parity.js +58 -0
  247. package/dist/scripts/regime-diag/parity.js.map +1 -0
  248. package/dist/scripts/regime-diag/prims.d.ts +41 -0
  249. package/dist/scripts/regime-diag/prims.d.ts.map +1 -0
  250. package/dist/scripts/regime-diag/prims.js +40 -0
  251. package/dist/scripts/regime-diag/prims.js.map +1 -0
  252. package/dist/scripts/regime-diag/replay.d.ts +56 -0
  253. package/dist/scripts/regime-diag/replay.d.ts.map +1 -0
  254. package/dist/scripts/regime-diag/replay.js +101 -0
  255. package/dist/scripts/regime-diag/replay.js.map +1 -0
  256. package/dist/scripts/regime-diag/rng.d.ts +8 -0
  257. package/dist/scripts/regime-diag/rng.d.ts.map +1 -0
  258. package/dist/scripts/regime-diag/rng.js +40 -0
  259. package/dist/scripts/regime-diag/rng.js.map +1 -0
  260. package/dist/scripts/regime-diag/run.d.ts +76 -0
  261. package/dist/scripts/regime-diag/run.d.ts.map +1 -0
  262. package/dist/scripts/regime-diag/run.js +694 -0
  263. package/dist/scripts/regime-diag/run.js.map +1 -0
  264. package/dist/scripts/regime-diag/stats.d.ts +62 -0
  265. package/dist/scripts/regime-diag/stats.d.ts.map +1 -0
  266. package/dist/scripts/regime-diag/stats.js +474 -0
  267. package/dist/scripts/regime-diag/stats.js.map +1 -0
  268. package/dist/scripts/regime-diag/synth.d.ts +20 -0
  269. package/dist/scripts/regime-diag/synth.d.ts.map +1 -0
  270. package/dist/scripts/regime-diag/synth.js +57 -0
  271. package/dist/scripts/regime-diag/synth.js.map +1 -0
  272. package/dist/scripts/sr-backtest/engine.d.ts +130 -0
  273. package/dist/scripts/sr-backtest/engine.d.ts.map +1 -0
  274. package/dist/scripts/sr-backtest/engine.js +405 -0
  275. package/dist/scripts/sr-backtest/engine.js.map +1 -0
  276. package/dist/scripts/sr-backtest/fetch-store.d.ts +33 -0
  277. package/dist/scripts/sr-backtest/fetch-store.d.ts.map +1 -0
  278. package/dist/scripts/sr-backtest/fetch-store.js +319 -0
  279. package/dist/scripts/sr-backtest/fetch-store.js.map +1 -0
  280. package/dist/scripts/sr-backtest/fixture.d.ts +38 -0
  281. package/dist/scripts/sr-backtest/fixture.d.ts.map +1 -0
  282. package/dist/scripts/sr-backtest/fixture.js +81 -0
  283. package/dist/scripts/sr-backtest/fixture.js.map +1 -0
  284. package/dist/scripts/sr-backtest/guard.d.ts +29 -0
  285. package/dist/scripts/sr-backtest/guard.d.ts.map +1 -0
  286. package/dist/scripts/sr-backtest/guard.js +105 -0
  287. package/dist/scripts/sr-backtest/guard.js.map +1 -0
  288. package/dist/scripts/sr-backtest/run.d.ts +34 -0
  289. package/dist/scripts/sr-backtest/run.d.ts.map +1 -0
  290. package/dist/scripts/sr-backtest/run.js +177 -0
  291. package/dist/scripts/sr-backtest/run.js.map +1 -0
  292. package/dist/scripts/sr-backtest/spec.d.ts +75 -0
  293. package/dist/scripts/sr-backtest/spec.d.ts.map +1 -0
  294. package/dist/scripts/sr-backtest/spec.js +86 -0
  295. package/dist/scripts/sr-backtest/spec.js.map +1 -0
  296. package/dist/scripts/sr-backtest/store.d.ts +67 -0
  297. package/dist/scripts/sr-backtest/store.d.ts.map +1 -0
  298. package/dist/scripts/sr-backtest/store.js +100 -0
  299. package/dist/scripts/sr-backtest/store.js.map +1 -0
  300. package/dist/scripts/sr-backtest/synth.d.ts +31 -0
  301. package/dist/scripts/sr-backtest/synth.d.ts.map +1 -0
  302. package/dist/scripts/sr-backtest/synth.js +66 -0
  303. package/dist/scripts/sr-backtest/synth.js.map +1 -0
  304. package/dist/scripts/sr-backtest/zones.d.ts +89 -0
  305. package/dist/scripts/sr-backtest/zones.d.ts.map +1 -0
  306. package/dist/scripts/sr-backtest/zones.js +135 -0
  307. package/dist/scripts/sr-backtest/zones.js.map +1 -0
  308. package/dist/scripts/sr-htf/config.d.ts +54 -0
  309. package/dist/scripts/sr-htf/config.d.ts.map +1 -0
  310. package/dist/scripts/sr-htf/config.js +64 -0
  311. package/dist/scripts/sr-htf/config.js.map +1 -0
  312. package/dist/scripts/sr-htf/htf-run.d.ts +61 -0
  313. package/dist/scripts/sr-htf/htf-run.d.ts.map +1 -0
  314. package/dist/scripts/sr-htf/htf-run.js +227 -0
  315. package/dist/scripts/sr-htf/htf-run.js.map +1 -0
  316. package/dist/scripts/sr-htf/htf-store.d.ts +23 -0
  317. package/dist/scripts/sr-htf/htf-store.d.ts.map +1 -0
  318. package/dist/scripts/sr-htf/htf-store.js +58 -0
  319. package/dist/scripts/sr-htf/htf-store.js.map +1 -0
  320. package/dist/scripts/sr-htf/registry.d.ts +60 -0
  321. package/dist/scripts/sr-htf/registry.d.ts.map +1 -0
  322. package/dist/scripts/sr-htf/registry.js +140 -0
  323. package/dist/scripts/sr-htf/registry.js.map +1 -0
  324. package/dist/scripts/sr-htf/sources.d.ts +38 -0
  325. package/dist/scripts/sr-htf/sources.d.ts.map +1 -0
  326. package/dist/scripts/sr-htf/sources.js +240 -0
  327. package/dist/scripts/sr-htf/sources.js.map +1 -0
  328. package/dist/scripts/sr-htf/synthv.d.ts +10 -0
  329. package/dist/scripts/sr-htf/synthv.d.ts.map +1 -0
  330. package/dist/scripts/sr-htf/synthv.js +32 -0
  331. package/dist/scripts/sr-htf/synthv.js.map +1 -0
  332. package/dist/scripts/sr-probe/fetch-candles.d.ts +2 -0
  333. package/dist/scripts/sr-probe/fetch-candles.d.ts.map +1 -0
  334. package/dist/scripts/sr-probe/fetch-candles.js +172 -0
  335. package/dist/scripts/sr-probe/fetch-candles.js.map +1 -0
  336. package/dist/scripts/sr-probe/level-v0.d.ts +89 -0
  337. package/dist/scripts/sr-probe/level-v0.d.ts.map +1 -0
  338. package/dist/scripts/sr-probe/level-v0.js +187 -0
  339. package/dist/scripts/sr-probe/level-v0.js.map +1 -0
  340. package/dist/scripts/sr-probe/plan.d.ts +80 -0
  341. package/dist/scripts/sr-probe/plan.d.ts.map +1 -0
  342. package/dist/scripts/sr-probe/plan.js +206 -0
  343. package/dist/scripts/sr-probe/plan.js.map +1 -0
  344. package/dist/scripts/sr-probe/sr-extract-sql.d.ts +39 -0
  345. package/dist/scripts/sr-probe/sr-extract-sql.d.ts.map +1 -0
  346. package/dist/scripts/sr-probe/sr-extract-sql.js +200 -0
  347. package/dist/scripts/sr-probe/sr-extract-sql.js.map +1 -0
  348. package/dist/scripts/sr-probe/sr-features.d.ts +14 -0
  349. package/dist/scripts/sr-probe/sr-features.d.ts.map +1 -0
  350. package/dist/scripts/sr-probe/sr-features.js +178 -0
  351. package/dist/scripts/sr-probe/sr-features.js.map +1 -0
  352. package/dist/scripts/sr-probe/store.d.ts +31 -0
  353. package/dist/scripts/sr-probe/store.d.ts.map +1 -0
  354. package/dist/scripts/sr-probe/store.js +41 -0
  355. package/dist/scripts/sr-probe/store.js.map +1 -0
  356. package/dist/tool-descriptions.d.ts +5 -1
  357. package/dist/tool-descriptions.d.ts.map +1 -1
  358. package/dist/tool-descriptions.js +12 -3
  359. package/dist/tool-descriptions.js.map +1 -1
  360. package/dist/tools/get-sr-zones.d.ts +174 -0
  361. package/dist/tools/get-sr-zones.d.ts.map +1 -0
  362. package/dist/tools/get-sr-zones.js +384 -0
  363. package/dist/tools/get-sr-zones.js.map +1 -0
  364. package/dist/tools/get-trade-call.js +2 -2
  365. package/dist/tools/get-trade-call.js.map +1 -1
  366. package/dist/tools/pre-trade-check.d.ts +30 -3
  367. package/dist/tools/pre-trade-check.d.ts.map +1 -1
  368. package/dist/tools/pre-trade-check.js +72 -13
  369. package/dist/tools/pre-trade-check.js.map +1 -1
  370. package/dist/tools/scan-market-regimes.d.ts +1 -1
  371. package/dist/tools/scan-trade-calls.d.ts +1 -1
  372. package/dist/types.d.ts +1 -0
  373. package/dist/types.d.ts.map +1 -1
  374. package/package.json +2 -3
  375. package/plugin.json +1 -1
  376. package/server.json +2 -2
  377. package/smithery.yaml +0 -14
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crypto-quant-signal-mcp",
3
- "version": "1.33.0",
3
+ "version": "1.35.0",
4
4
  "description": "Composite BUY/SELL/HOLD verdicts for crypto perpetual futures — cross-venue signal interpretation, funding-rate arbitrage scanning, market-regime detection, and an on-chain-anchored track record. Built for AI agents.",
5
5
  "author": {
6
6
  "name": "AlgoVault Labs",
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
  </p>
13
13
 
14
14
  <p align="center">
15
- <span data-tr-field="pfe_wr">90.6%</span> PFE win rate across <span data-tr-field="total_calls">1,266,265</span>+ verified calls. Merkle-verified on Base L2. Don't trust — verify. <!-- SNAPSHOT-LINE -->
15
+ <span data-tr-field="pfe_wr">90.5%</span> PFE win rate across <span data-tr-field="total_calls">1,403,822</span>+ verified calls. Merkle-verified on Base L2. Don't trust — verify. <!-- SNAPSHOT-LINE -->
16
16
  </p>
17
17
 
18
18
  <p align="center">
@@ -115,7 +115,7 @@ The `_algovault` block is the envelope every tool response carries: the server v
115
115
  scripts/snapshot-landing-data.mjs at npm-publish + Hetzner-deploy. Do NOT hand-edit the
116
116
  numbers; edit "What's new" by hand. Wired by OPS-NPM-README-SINGLE-SOT-W1 (2026-05-31). -->
117
117
  <p align="center">
118
- <strong><span data-tr-field="pfe_wr">90.6%</span> PFE Win Rate</strong> · <strong><span data-tr-field="total_calls">1,266,265</span> trade calls</strong> · <strong><span data-tr-field="merkle_batches">206</span> on-chain batches</strong> <!-- SNAPSHOT-LINE -->
118
+ <strong><span data-tr-field="pfe_wr">90.5%</span> PFE Win Rate</strong> · <strong><span data-tr-field="total_calls">1,403,822</span> trade calls</strong> · <strong><span data-tr-field="merkle_batches">220</span> on-chain batches</strong> <!-- SNAPSHOT-LINE -->
119
119
  </p>
120
120
 
121
121
  <p align="center">
@@ -165,6 +165,8 @@ AlgoVault is drop-in for every MCP-spec client, every major agent framework, and
165
165
 
166
166
  Each demo is runnable as `python examples/<framework>/demo.py BTC 4h` — gets a real BUY/SELL/HOLD verdict from `api.algovault.com/mcp`, prints it. ≤5 minutes to first call.
167
167
 
168
+ **Pre-trade gate.** Make `pre_trade_check` a step your agent cannot skip. In [Claude Code](https://algovault.com/integrations/claude-code) and [Codex](https://algovault.com/integrations/codex), the AlgoVault pre-trade gate blocks an order until the check has run for that coin and side, and stops it on WAIT. The [LangChain](https://algovault.com/integrations/langchain) and [Freqtrade](https://github.com/AlgoVaultLabs/algovault-skills/tree/main/examples/freqtrade) recipes run the check before an order and block it when the check cannot run.
169
+
168
170
  **Exchange Agent Trade Kits.** AlgoVault returns the analytics; your agent's risk policy decides what to execute. All demos run testnet/demo only. For Binance, the Agent OS path is the recommended default for new integrations — OAuth at connect time, no API keys on the machine; the key-based kit remains right for custom order types.
169
171
 
170
172
  <!-- BUILD:README_INTEGRATIONS_TABLE -->
@@ -189,12 +191,13 @@ Each demo is runnable as `python examples/<framework>/demo.py BTC 4h` — gets a
189
191
 
190
192
  ## Tools & resources
191
193
 
192
- The MCP tools live at `https://api.algovault.com/mcp`. Every asset works across the full supported timeframe range, on major crypto perpetual venues.
194
+ The MCP tools live at `https://api.algovault.com/mcp`. Every asset works across the full supported timeframe range, on major crypto perpetual venues. `get_support_resistance_zones` (Beta) serves Binance perpetuals only, on the 15m, 30m, 1h, 2h, 4h, 8h, 12h and 1d timeframes.
193
195
 
194
196
  - **`get_trade_call`** <sub>(alias `get_trade_signal`)</sub> — composite BUY/SELL/HOLD verdict with confidence + regime, any asset, any timeframe.
195
197
  - **`scan_trade_calls`** — scans the top-N perps by open interest on a venue; returns every actionable call in one shot.
196
198
  - **`scan_market_regimes`** — screens a whole venue by market regime in one call: every coin whose regime matches your filter, with confidence and how long the regime has held. One call per returned row (at least one per request); coins that don't match are free.
197
199
  - **`pre_trade_check`** — checks an order against your own rules before you place it: each rule passes or fails with its numbers, then GO, CAUTION or WAIT, with isolated liquidation per venue against your stop. Read-only: it places no orders.
200
+ - **`get_support_resistance_zones`** (Beta) — returns support and resistance zones for one coin on Binance perpetuals, for one to three timeframes. Read-only. Use with get_trade_call or get_market_regime for the same coin.
198
201
  - **`scan_funding_arb`** — cross-venue funding-rate spreads across 7 venues (Hyperliquid, Binance, Bybit, Gate, KuCoin, Aster, OKX), ranked. The only MCP server doing multi-exchange derivatives arbitrage.
199
202
  - **`get_market_regime`** — classifies TRENDING_UP / TRENDING_DOWN / RANGING / VOLATILE for strategy selection.
200
203
  - **`search_knowledge`** + **`chat_knowledge`** — free BM25 search and grounded Q&A over the full knowledge bundle.
@@ -202,6 +205,8 @@ The MCP tools live at `https://api.algovault.com/mcp`. Every asset works across
202
205
 
203
206
  Performance is exposed as a read-only MCP resource: `performance://signal-performance` (aggregated PFE win rate, never raw outcomes). Full parameter reference at [algovault.com/docs](https://algovault.com/docs.html).
204
207
 
208
+ Every answered `pre_trade_check` carries a receipt you can verify through the read-only resource `verify://check/{id}` or `GET /api/verify-check?id=`, against its root anchored on Base.
209
+
205
210
  ### Skills (20 ready-to-use Anthropic Agent Skills)
206
211
 
207
212
  Single-prompt wrappers over 1–3 tool calls — regime gating, multi-timeframe consensus, funding-arb monitoring, and more. Install with `claude plugin install AlgoVaultLabs/algovault-skills`; browse at [algovault.com/skills](https://algovault.com/skills).
@@ -265,26 +270,26 @@ Pro 6-month is currently $129 — limited-time pricing; subscribe now and renewa
265
270
 
266
271
  ---
267
272
 
268
- ## What's new in v1.33.0
273
+ ## What's new in v1.35.0
269
274
 
270
- - **🛡️ Check an order against your own rules before you place it.** `pre_trade_check` takes the order you intend to place and your limits (maximum leverage, loss at your stop, accuracy needed to break even, funding) and returns each rule's pass or fail with its numbers, then GO, CAUTION or WAIT. It also shows where isolated liquidation sits on each venue that publishes its margin tiers, and whether it hits before your stop.
271
- - **🔐 Sign in from inside Claude.** Add AlgoVault as a custom connector and choose Sign in when needed. When Claude asks, click Connect and sign in with your email. On a paid plan, sign in with your subscription email and your plan applies.
275
+ - **🧱 `get_support_resistance_zones` (Beta).** Returns support and resistance zones for one coin on Binance perpetuals, for one to three timeframes. Read-only. Per timeframe: up to 3 support and 3 resistance zones, ranked outward from price, each with its low and high, distance from price, bars touched in the last 90, tests in the last 30, last touch, and whether it flipped between support and resistance after two closes through it. Also returns volume against its 20-bar average and flags such as no zone above (price above every zone in its history). Use with get_trade_call or get_market_regime for the same coin. $0.02 per call over x402.
272
276
 
273
- **Upgrading from v1.32.x** — one tool was added, `pre_trade_check`; no tool or parameter was renamed or removed. A call with an argument the tool doesn't take is now refused, unbilled, and the refusal names the valid parameters; the published schemas never allowed extra arguments. Added AlgoVault in Claude before? Remove it and add it again, choosing Sign in when needed.
277
+ **Upgrading from v1.34.x** — additive. One tool was added, `get_support_resistance_zones` (Beta), with the route `POST /x402/get_support_resistance_zones`; no tool or tool parameter was renamed or removed. On 30m and 1h, `get_trade_call` now follows the same rule as 3m, so a call there can take the opposite side of the raw reading; `_receipts.rule_variant` reads `"fade"` when it does.
274
278
 
275
- ### v1.32.x highlights (recap)
279
+ ### v1.34.x highlights (recap)
276
280
 
277
- - **🧭 Screen a whole venue by market regime in one call.** `scan_market_regimes` returns every coin whose regime matches your filter — TRENDING_UP, TRENDING_DOWN, RANGING or VOLATILE — with confidence, trend strength, ADX, volatility ratio and how long the regime has held. Filter by regime, confidence, asset class, liquidity, regime age or your own watchlist, then sort by confidence or by the newest regime change. You pay one call per returned row (at least one per request); coins that don't match are free. A venue or timeframe it can't serve right now is refused with the alternatives, and isn't billed. The screener is served from the hosted endpoint; a local install lists it and refuses the call with a pointer there.
281
+ - **📌 Save your rules once.** Save your `pre_trade_check` rules with `PUT /api/pre-trade-rules` and your API key, and every check that key makes applies them. Rules you send with a call still win. A rule from your saved profile shows `source: "saved"`, and `saved_rules` says whether a profile applied.
282
+ - **🚧 Make the check a step your agent cannot skip.** In Claude Code and Codex, the AlgoVault pre-trade gate blocks an order tool call until `pre_trade_check` has recently checked that coin and side, and blocks it when the check returns WAIT. In LangChain and Freqtrade, a recipe runs the check before the order.
283
+ - **🧾 A receipt with every answered check.** An answered `pre_trade_check` carries a `ledger` receipt. Once its root is anchored on Base, `verify://check/{id}` or `GET /api/verify-check?id=` proves the verdict your agent got was recorded unchanged.
278
284
 
279
- **Upgrading from v1.31.x** — additive. One tool was added, `scan_market_regimes`; no tool or parameter was renamed or removed. `GET /api/plans/public` gains two blocks under `free`: `keyless` (the allowance without a key) and `telegram` (the Telegram bot's own allowance, counted in alerts). One free-tier allowance changed: 20 calls a month without a key; a free key gives 200 (up to 100/day).
285
+ **Upgrading from v1.33.x** — additive. No tool or tool parameter was added, renamed or removed. `pre_trade_check` responses gain `saved_rules` and `ledger`, and a rule can now show `source: "saved"`. New: the resource `verify://check/{id}` and the routes `/api/pre-trade-rules` and `GET /api/verify-check`. Market regime direction follows a corrected rule, so some regimes read differently and regime ages in `scan_market_regimes` restarted.
280
286
 
281
- ### v1.31.x highlights (recap)
287
+ ### v1.33.x highlights (recap)
282
288
 
283
- - **🧩 Install from the package, not from a pasted config block.** `plugin.json`, `mcp.json` and `.cursor-plugin/plugin.json` now ship inside the npm tarball, so an Agent-Plugins-compatible host — Cursor included — reads the server definition straight out of the installed package. Until this release those files lived in the repository only, and no npm consumer could obtain them.
284
-
285
- - **v1.31.1** — Trade-call verdicts are now chosen by one declared rule per timeframe and trend direction, instead of a global mode setting. The calls you receive are unchanged by the switch.
289
+ - **🛡️ Check an order against your own rules before you place it.** `pre_trade_check` takes the order you intend to place and your limits (maximum leverage, loss at your stop, accuracy needed to break even, funding) and returns each rule's pass or fail with its numbers, then GO, CAUTION or WAIT. It also shows where isolated liquidation sits on each venue that publishes its margin tiers, and whether it hits before your stop.
290
+ - **🔐 Sign in from inside Claude.** Add AlgoVault as a custom connector and choose Sign in when needed. When Claude asks, click Connect and sign in with your email. On a paid plan, sign in with your subscription email and your plan applies.
286
291
 
287
- **Upgrading from v1.30.x** — one value in the response envelope changed: `_algovault.compatible_with` is now `[]` and names no companion package. If your client rendered those package names, stop rendering them; there is no companion package published today. Nothing else in the envelope changed, and no tool or parameter was added, renamed or removed.
292
+ **Upgrading from v1.32.x** — one tool was added, `pre_trade_check`; no tool or parameter was renamed or removed. A call with an argument the tool doesn't take is now refused, unbilled, and the refusal names the valid parameters; the published schemas never allowed extra arguments. Added AlgoVault in Claude before? Remove it and add it again, choosing Sign in when needed.
288
293
 
289
294
  > **Refresh your MCP client to pick up this release.** MCP clients cache `tools/list` at session start — Claude.ai/Desktop: toggle the connector off+on; Cursor/Cline: restart the MCP server connection.
290
295
 
package/dist/index.d.ts CHANGED
@@ -69,5 +69,61 @@ export declare function applyCredentialRefusal(req: import('express').Request, r
69
69
  * object yields at most one `unrecognized_keys` issue per parse: one line per refused call.
70
70
  */
71
71
  export declare function strictToolInput<S extends z.ZodRawShape>(tool: string, shape: S): z.ZodObject<S, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<S>, any> extends infer T ? { [k in keyof T]: T[k]; } : never, z.baseObjectInputType<S> extends infer T_1 ? { [k_1 in keyof T_1]: T_1[k_1]; } : never>;
72
+ /**
73
+ * Per surface: the `_algovault` tool and source, and per status the ONLY keys a body may carry beside
74
+ * `_algovault` and `status`. The signal row is the shape DESIGN-W9 ratified (Q-W9-6): no outcome or PFE field.
75
+ * The check row is the call-ledger contract's list.
76
+ */
77
+ export declare const VERIFY_SURFACES: {
78
+ readonly signal: {
79
+ readonly tool: "verify-signal";
80
+ readonly source: "verify://signal/{id}";
81
+ readonly keys: {
82
+ readonly verified: readonly ["leaf", "root", "batch", "tx"];
83
+ readonly pending: readonly ["leaf", "requested_id"];
84
+ readonly notfound: readonly ["requested_id"];
85
+ };
86
+ };
87
+ readonly check: {
88
+ readonly tool: "verify-check";
89
+ readonly source: "verify://check/{id}";
90
+ readonly keys: {
91
+ readonly verified: readonly ["id", "leaf", "proof", "root", "batch", "tx", "registry", "chain", "anchored_at"];
92
+ readonly pending: readonly ["id", "leaf"];
93
+ readonly notfound: readonly ["requested_id"];
94
+ };
95
+ };
96
+ };
97
+ export type VerifySurface = keyof typeof VERIFY_SURFACES;
98
+ /** The `_algovault` block every verify body opens with. */
99
+ export declare function verifyMeta(surface: VerifySurface): {
100
+ tool: string;
101
+ version: string;
102
+ source: string;
103
+ ts: string;
104
+ };
105
+ /**
106
+ * The shared public-only body builder. It keeps `_algovault`, `status` and the keys this surface allows for that
107
+ * status, in the order the body set them, and drops everything else. It is an allow-list, never a deny-list: a
108
+ * field added to a lookup row cannot reach a public body without being named above.
109
+ */
110
+ export declare function publicVerifyBody(surface: VerifySurface, body: Record<string, unknown>): Record<string, unknown>;
111
+ /** Copy 2 (contract § Copy, verbatim; Mr.1's OK at dispatch): the `verify://check/{id}` resource description. */
112
+ export declare const VERIFY_CHECK_DESCRIPTION = "Verify a pre_trade_check receipt against its on-chain Merkle proof. Returns {status, leaf, proof, root, batch, tx}: proof only, never the order or its outcome.";
113
+ /** Copy 3 (contract § Copy, verbatim): the HTTP 400 body for an id that is not `pcl_` + 32 lowercase hex. */
114
+ export declare const VERIFY_CHECK_BAD_ID = "invalid id (expected pcl_ + 32 hex)";
115
+ /**
116
+ * THE one function behind `verify://check/{id}` and `GET /api/verify-check?id=`. Its statuses map to HTTP as:
117
+ * verified 200, pending 200 (logged, not yet in a verified batch), notfound 404, malformed id 400 (Copy 3).
118
+ * It never throws. A lookup that cannot complete answers 500 with the verify-signal route's own message, and so
119
+ * does a stored proof that does not reach its batch's root: "verified" is never served for a proof the caller
120
+ * would then fail to reproduce.
121
+ */
122
+ export declare function verifyCheckLookup(rawId: string): Promise<{
123
+ http: 200 | 400 | 404 | 500;
124
+ body: Record<string, unknown>;
125
+ }>;
126
+ /** `GET /api/verify-check?id=` (public, no auth): the HTTP face of verifyCheckLookup. */
127
+ export declare function verifyCheckHttpHandler(req: import('express').Request, res: import('express').Response): Promise<void>;
72
128
  export declare function createSandboxServer(): McpServer;
73
129
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,SAAS,EAAuC,MAAM,yCAAyC,CAAC;AAGzG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,YAAY,CAAC;AA0O1D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,MAAM,EAAE,MAAM,GACb,MAAM,CAOR;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,OAAO,SAAS,EAAE,OAAO,EAC9B,GAAG,EAAE,OAAO,SAAS,EAAE,QAAQ,EAC/B,UAAU,EAAE,MAAM,SAAS,GAC1B,OAAO,CAAC,IAAI,CAAC,CAYf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,SAAS,EAAE,OAAO,EAC9B,GAAG,EAAE,OAAO,SAAS,EAAE,QAAQ,EAC/B,OAAO,EAAE,WAAW,GACnB,OAAO,CAaT;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,qPAU9E;AA65JD,wBAAgB,mBAAmB,cAElC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,SAAS,EAAuC,MAAM,yCAAyC,CAAC;AAGzG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,YAAY,CAAC;AAqP1D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,MAAM,EAAE,MAAM,GACb,MAAM,CAOR;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,OAAO,SAAS,EAAE,OAAO,EAC9B,GAAG,EAAE,OAAO,SAAS,EAAE,QAAQ,EAC/B,UAAU,EAAE,MAAM,SAAS,GAC1B,OAAO,CAAC,IAAI,CAAC,CAYf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,SAAS,EAAE,OAAO,EAC9B,GAAG,EAAE,OAAO,SAAS,EAAE,QAAQ,EAC/B,OAAO,EAAE,WAAW,GACnB,OAAO,CAaT;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,qPAU9E;AAUD;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;CAelB,CAAC;AACX,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,eAAe,CAAC;AAEzD,2DAA2D;AAC3D,wBAAgB,UAAU,CAAC,OAAO,EAAE,aAAa,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAGhH;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQ/G;AAED,iHAAiH;AACjH,eAAO,MAAM,wBAAwB,oKAC8H,CAAC;AACpK,6GAA6G;AAC7G,eAAO,MAAM,mBAAmB,wCAAwC,CAAC;AAoCzE;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC,CAmC9H;AAED,yFAAyF;AACzF,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,OAAO,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,SAAS,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAG3H;AAo9JD,wBAAgB,mBAAmB,cAElC"}
package/dist/index.js CHANGED
@@ -37,10 +37,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
38
  };
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
+ exports.VERIFY_CHECK_BAD_ID = exports.VERIFY_CHECK_DESCRIPTION = exports.VERIFY_SURFACES = void 0;
40
41
  exports.resolveSessionCorrelationId = resolveSessionCorrelationId;
41
42
  exports.handleMcpStateless = handleMcpStateless;
42
43
  exports.applyCredentialRefusal = applyCredentialRefusal;
43
44
  exports.strictToolInput = strictToolInput;
45
+ exports.verifyMeta = verifyMeta;
46
+ exports.publicVerifyBody = publicVerifyBody;
47
+ exports.verifyCheckLookup = verifyCheckLookup;
48
+ exports.verifyCheckHttpHandler = verifyCheckHttpHandler;
44
49
  exports.createSandboxServer = createSandboxServer;
45
50
  /**
46
51
  * crypto-quant-signal-mcp — Dual transport MCP server.
@@ -64,6 +69,7 @@ const mode_js_1 = require("./lib/oauth/mode.js");
64
69
  const metadata_js_1 = require("./lib/oauth/metadata.js");
65
70
  const challenge_js_1 = require("./lib/oauth/challenge.js");
66
71
  const routes_js_1 = require("./lib/oauth/routes.js");
72
+ const retired_slugs_js_1 = require("./lib/integrations-data/retired-slugs.js");
67
73
  const scan_trade_calls_js_1 = require("./tools/scan-trade-calls.js");
68
74
  const scan_market_regimes_js_1 = require("./tools/scan-market-regimes.js");
69
75
  const pre_trade_check_js_1 = require("./tools/pre-trade-check.js");
@@ -77,6 +83,7 @@ const footer_content_js_1 = require("./lib/footer-content.js");
77
83
  const admin_auth_js_1 = require("./lib/admin-auth.js");
78
84
  const performance_db_js_1 = require("./lib/performance-db.js");
79
85
  const webhook_api_js_1 = require("./lib/webhook-api.js");
86
+ const pre_trade_rules_api_js_1 = require("./lib/pre-trade-rules-api.js");
80
87
  const venue_public_formatter_js_1 = require("./lib/venue-public-formatter.js");
81
88
  const webhook_delivery_js_1 = require("./lib/webhook-delivery.js");
82
89
  const scan_digest_scheduler_js_1 = require("./lib/scan-digest-scheduler.js");
@@ -84,6 +91,8 @@ const pkg_version_js_1 = require("./lib/pkg-version.js");
84
91
  const erc8004_reputation_js_1 = require("./lib/erc8004-reputation.js");
85
92
  const public_cta_js_1 = require("./lib/public-cta.js");
86
93
  const merkle_js_1 = require("./lib/merkle.js");
94
+ const call_ledger_js_1 = require("./lib/call-ledger.js");
95
+ const onchain_registries_js_1 = require("./lib/onchain-registries.js");
87
96
  const asset_tiers_js_1 = require("./lib/asset-tiers.js");
88
97
  const capabilities_js_1 = require("./lib/capabilities.js");
89
98
  // DOCS-PARAM-SCHEMA-PROJECTION-W1: the accepted-venue set and the regime/assetClass enums are
@@ -147,6 +156,10 @@ const plans_public_api_js_1 = require("./lib/plans-public-api.js");
147
156
  // GROWTH-AGENT-SIGNIN-STEPUP-W1-V2 R2.2: the step-up mode resolver, for the one boot line.
148
157
  const plans_js_1 = require("./lib/plans.js");
149
158
  const welcome_page_js_1 = require("./lib/welcome-page.js");
159
+ // OPS-AUDIT-REMEDIATION-HIGH-W2-R2 CH2 (SECR-03): the one rule for showing a key from a Checkout Session.
160
+ const key_reveal_js_1 = require("./lib/key-reveal.js");
161
+ // TG-SIGNIN-W1-R2 CH2 R2.4: POST /api/bot/signin-token/redeem — the bot redeems the one-time token /welcome minted.
162
+ const tg_signin_tokens_js_1 = require("./lib/tg-signin-tokens.js");
150
163
  const tool_descriptions_js_1 = require("./tool-descriptions.js");
151
164
  const get_track_record_js_1 = require("./tools/get-track-record.js");
152
165
  const feature_registry_js_1 = require("./lib/feature-registry.js");
@@ -309,6 +322,128 @@ function strictToolInput(tool, shape) {
309
322
  },
310
323
  }).strict();
311
324
  }
325
+ // ── The public verify lookups (DECISION-CALL-V2-W5 CH3) ──────────────────────────────────────────────
326
+ // `verify://signal/{id}` (DESIGN-W9), `verify://check/{id}` and `GET /api/verify-check?id=` build every body
327
+ // through ONE public-only allow-list. A key reaches a verify body only by being named in VERIFY_SURFACES, and the
328
+ // shared envelope cannot drift between the two ledgers: the `_algovault` block, the verified | pending | notfound
329
+ // vocabulary, and the notfound `requested_id`. The contract is the vault's Prompt/call-ledger-contract.md
330
+ // § Lookup. Commit, never reveal: a check's lookup serves its verdict leaf and that leaf's proof. It never serves
331
+ // the order, the decision, the odds, the salt or the caller.
332
+ /**
333
+ * Per surface: the `_algovault` tool and source, and per status the ONLY keys a body may carry beside
334
+ * `_algovault` and `status`. The signal row is the shape DESIGN-W9 ratified (Q-W9-6): no outcome or PFE field.
335
+ * The check row is the call-ledger contract's list.
336
+ */
337
+ exports.VERIFY_SURFACES = {
338
+ signal: {
339
+ tool: 'verify-signal',
340
+ source: 'verify://signal/{id}',
341
+ keys: { verified: ['leaf', 'root', 'batch', 'tx'], pending: ['leaf', 'requested_id'], notfound: ['requested_id'] },
342
+ },
343
+ check: {
344
+ tool: 'verify-check',
345
+ source: 'verify://check/{id}',
346
+ keys: {
347
+ verified: ['id', 'leaf', 'proof', 'root', 'batch', 'tx', 'registry', 'chain', 'anchored_at'],
348
+ pending: ['id', 'leaf'],
349
+ notfound: ['requested_id'],
350
+ },
351
+ },
352
+ };
353
+ /** The `_algovault` block every verify body opens with. */
354
+ function verifyMeta(surface) {
355
+ const s = exports.VERIFY_SURFACES[surface];
356
+ return { tool: s.tool, version: pkg_version_js_1.PKG_VERSION, source: s.source, ts: new Date().toISOString() };
357
+ }
358
+ /**
359
+ * The shared public-only body builder. It keeps `_algovault`, `status` and the keys this surface allows for that
360
+ * status, in the order the body set them, and drops everything else. It is an allow-list, never a deny-list: a
361
+ * field added to a lookup row cannot reach a public body without being named above.
362
+ */
363
+ function publicVerifyBody(surface, body) {
364
+ const keys = exports.VERIFY_SURFACES[surface].keys;
365
+ const allowed = keys[String(body.status)] ?? [];
366
+ const out = {};
367
+ for (const [k, v] of Object.entries(body)) {
368
+ if (k === '_algovault' || k === 'status' || allowed.includes(k))
369
+ out[k] = v;
370
+ }
371
+ return out;
372
+ }
373
+ /** Copy 2 (contract § Copy, verbatim; Mr.1's OK at dispatch): the `verify://check/{id}` resource description. */
374
+ exports.VERIFY_CHECK_DESCRIPTION = 'Verify a pre_trade_check receipt against its on-chain Merkle proof. Returns {status, leaf, proof, root, batch, tx}: proof only, never the order or its outcome.';
375
+ /** Copy 3 (contract § Copy, verbatim): the HTTP 400 body for an id that is not `pcl_` + 32 lowercase hex. */
376
+ exports.VERIFY_CHECK_BAD_ID = 'invalid id (expected pcl_ + 32 hex)';
377
+ /**
378
+ * The receipt behind a ledger id: its VERDICT leaf, and once its batch is sealed, the leaf's proof and that batch.
379
+ * It reads `call_ledger` (never the salt column, never an odds row) and `call_ledger_batches`, both adopted
380
+ * read-only. Before the first logged check there is no `call_ledger`; before the first anchor there is no
381
+ * `call_ledger_batches`. The ledger lives only in Postgres: its tables are Postgres DDL, with the `~` CHECKs of
382
+ * 055 and 056, so no other backend holds a receipt.
383
+ */
384
+ async function readCheckReceipt(id) {
385
+ if (!(0, performance_db_js_1.isPgBackend)())
386
+ return null;
387
+ const t = await (0, performance_db_js_1.dbQuery)(`SELECT to_regclass('call_ledger') IS NOT NULL AS l, to_regclass('call_ledger_batches') IS NOT NULL AS b`);
388
+ if (t[0]?.l !== true)
389
+ return null;
390
+ const rows = await (0, performance_db_js_1.dbQuery)(t[0]?.b === true
391
+ ? `SELECT l.leaf, l.proof, l.batch_id, b.root, b.state, b.tx_hash, b.anchored_at
392
+ FROM call_ledger l LEFT JOIN call_ledger_batches b ON b.batch_id = l.batch_id
393
+ WHERE l.ledger_id = $1 AND l.kind = 'verdict'`
394
+ : `SELECT l.leaf FROM call_ledger l WHERE l.ledger_id = $1 AND l.kind = 'verdict'`, [id]);
395
+ return rows[0] ?? null;
396
+ }
397
+ /**
398
+ * THE one function behind `verify://check/{id}` and `GET /api/verify-check?id=`. Its statuses map to HTTP as:
399
+ * verified 200, pending 200 (logged, not yet in a verified batch), notfound 404, malformed id 400 (Copy 3).
400
+ * It never throws. A lookup that cannot complete answers 500 with the verify-signal route's own message, and so
401
+ * does a stored proof that does not reach its batch's root: "verified" is never served for a proof the caller
402
+ * would then fail to reproduce.
403
+ */
404
+ async function verifyCheckLookup(rawId) {
405
+ if (!call_ledger_js_1.CALL_LEDGER_ID_RE.test(rawId))
406
+ return { http: 400, body: { error: exports.VERIFY_CHECK_BAD_ID } };
407
+ try {
408
+ const row = await readCheckReceipt(rawId);
409
+ const body = { _algovault: verifyMeta('check') };
410
+ if (!row) {
411
+ body.status = 'notfound';
412
+ body.requested_id = rawId;
413
+ return { http: 404, body: publicVerifyBody('check', body) };
414
+ }
415
+ if (row.state !== 'verified') {
416
+ body.status = 'pending';
417
+ body.id = rawId;
418
+ body.leaf = row.leaf;
419
+ return { http: 200, body: publicVerifyBody('check', body) };
420
+ }
421
+ const proof = typeof row.proof === 'string' ? JSON.parse(row.proof) : row.proof;
422
+ if (!Array.isArray(proof) || !(0, merkle_js_1.verifyProof)(row.leaf, proof, row.root)) {
423
+ throw new Error(`the stored proof of ${rawId} does not reach batch ${String(row.batch_id)}'s root`);
424
+ }
425
+ body.status = 'verified';
426
+ body.id = rawId;
427
+ body.leaf = row.leaf;
428
+ body.proof = proof;
429
+ body.root = row.root;
430
+ body.batch = Number(row.batch_id);
431
+ body.tx = row.tx_hash;
432
+ body.registry = onchain_registries_js_1.CALL_LEDGER_REGISTRY.address;
433
+ body.chain = 'base';
434
+ body.anchored_at = new Date(row.anchored_at).toISOString();
435
+ return { http: 200, body: publicVerifyBody('check', body) };
436
+ }
437
+ catch (e) {
438
+ console.error(`[verify-check] lookup failed: ${(e instanceof Error ? e.message : String(e)).slice(0, 200)}`);
439
+ return { http: 500, body: { error: 'Verification failed' } };
440
+ }
441
+ }
442
+ /** `GET /api/verify-check?id=` (public, no auth): the HTTP face of verifyCheckLookup. */
443
+ async function verifyCheckHttpHandler(req, res) {
444
+ const r = await verifyCheckLookup(typeof req.query.id === 'string' ? req.query.id : '');
445
+ res.status(r.http).json(r.body);
446
+ }
312
447
  function createServer() {
313
448
  const server = new mcp_js_1.McpServer({
314
449
  name: 'crypto-quant-signal-mcp',
@@ -429,6 +564,14 @@ function createServer() {
429
564
  register('get_track_record', tool_descriptions_js_1.GET_TRACK_RECORD_DESCRIPTION, {
430
565
  include: zod_1.z.array(zod_1.z.enum(get_track_record_js_1.TRACK_RECORD_SECTIONS)).optional().describe(tool_descriptions_js_1.PARAM_DESC_TRACK_RECORD_INCLUDE),
431
566
  }, { title: 'Track Record', ...tool_annotations_js_1.PUBLIC_READONLY_TOOL_ANNOTATIONS }, mcpHandler('get_track_record'));
567
+ // ── Tool: get_support_resistance_zones (SR-ZONES-W1; renamed from get_sr_zones in SR-ZONES-W2 R8, no alias) — support/resistance zones, facts only, Binance perpetuals ──
568
+ // Thin handler: quota, the candle cache (history per bar, newest page re-read after 60 s) and the response live in src/tools/get-sr-zones.ts
569
+ // (runGetSrZones, dispatched by the tool-call pipeline); the formula is src/lib/sr-zones/.
570
+ register('get_support_resistance_zones', tool_descriptions_js_1.GET_SR_ZONES_DESCRIPTION, {
571
+ coin: zod_1.z.string().min(1).max(20).describe(tool_descriptions_js_1.PARAM_DESC_SR_ZONES_COIN),
572
+ timeframes: zod_1.z.array(zod_1.z.enum(tool_param_schema_js_1.SR_ZONES_TIMEFRAMES)).min(1).max(3).describe(tool_descriptions_js_1.PARAM_DESC_SR_ZONES_TIMEFRAMES),
573
+ venue: zod_1.z.enum(tool_param_schema_js_1.SR_ZONES_VENUES).optional().describe(tool_descriptions_js_1.PARAM_DESC_SR_ZONES_VENUE),
574
+ }, { title: 'Support and Resistance Zones', ...tool_annotations_js_1.PUBLIC_READONLY_TOOL_ANNOTATIONS }, mcpHandler('get_support_resistance_zones'));
432
575
  // FEATURE-REGISTRY-SOT-W1 CH2: registry-driven registration — register exactly the
433
576
  // names FEATURE_REGISTRY declares (canonical + aliases), pulling each tool's verbatim
434
577
  // handler/schema/annotations/description from toolDefs. Bidirectional parity guard:
@@ -451,7 +594,11 @@ function createServer() {
451
594
  if (!d)
452
595
  throw new Error(`[feature-registry] "${name}" is in FEATURE_REGISTRY but has no handler def in createServer()`);
453
596
  const m = (0, tool_metadata_projection_js_1.projectToolMetadata)(name, d.description, d.schema, profile);
454
- server.registerTool(name, { description: m.description, inputSchema: strictArgs ? strictToolInput(name, m.shape) : m.shape, annotations: d.annotations }, d.handler);
597
+ // SR-ZONES-W2 R3: the Beta mark, from the registry flag, on the description and the title — after the per-client
598
+ // projection, whose plain-text overrides key on the unmarked text. A no-op for every tool without the flag.
599
+ const beta = (0, feature_registry_js_1.isBetaTool)(name);
600
+ const annotations = beta && typeof d.annotations.title === 'string' ? { ...d.annotations, title: (0, feature_registry_js_1.betaMarked)(d.annotations.title, true) } : d.annotations;
601
+ server.registerTool(name, { description: (0, feature_registry_js_1.betaMarked)(m.description, beta), inputSchema: strictArgs ? strictToolInput(name, m.shape) : m.shape, annotations }, d.handler);
455
602
  }
456
603
  for (const defName of Object.keys(toolDefs)) {
457
604
  if (!(0, feature_registry_js_1.allToolNames)().includes(defName))
@@ -529,13 +676,10 @@ function createServer() {
529
676
  row = await (0, performance_db_js_1.getSignalWithBatch)(intId);
530
677
  }
531
678
  }
679
+ // DECISION-CALL-V2-W5 CH3: verify://check/{id} shares this `_algovault` block and the public-only allow-list
680
+ // (VERIFY_SURFACES, publicVerifyBody) — one envelope, so the two shapes cannot drift.
532
681
  const body = {
533
- _algovault: {
534
- tool: 'verify-signal',
535
- version: pkg_version_js_1.PKG_VERSION,
536
- source: 'verify://signal/{id}',
537
- ts: new Date().toISOString(),
538
- },
682
+ _algovault: verifyMeta('signal'),
539
683
  };
540
684
  if (!row) {
541
685
  body.status = 'notfound';
@@ -565,7 +709,20 @@ function createServer() {
565
709
  return {
566
710
  contents: [{
567
711
  uri: uri.href,
568
- text: JSON.stringify(body, null, 2),
712
+ text: JSON.stringify(publicVerifyBody('signal', body), null, 2),
713
+ mimeType: 'application/json',
714
+ }],
715
+ };
716
+ });
717
+ // ── DECISION-CALL-V2-W5 CH3: verify://check/{id} — a pre_trade_check receipt, against its on-chain proof ──
718
+ // The body is verifyCheckLookup's, the same one GET /api/verify-check serves. An MCP resource carries no HTTP
719
+ // status, so the body alone says verified | pending | notfound, or { error } for a malformed id.
720
+ server.resource('verify-check', new mcp_js_1.ResourceTemplate('verify://check/{id}', { list: undefined }), { description: exports.VERIFY_CHECK_DESCRIPTION, mimeType: 'application/json' }, async (uri, variables) => {
721
+ const r = await verifyCheckLookup(String(variables.id ?? ''));
722
+ return {
723
+ contents: [{
724
+ uri: uri.href,
725
+ text: JSON.stringify(r.body, null, 2),
569
726
  mimeType: 'application/json',
570
727
  }],
571
728
  };
@@ -960,7 +1117,7 @@ async function startHttp() {
960
1117
  // the reading that `deepseek` "is a model, none of which have a page": DeepSeek
961
1118
  // now ships its own agent runtime with a first-party MCP client, and that is a
962
1119
  // SEPARATE product from the byo-model row, which keeps no page of its own.
963
- const INTEGRATION_MCP_CLIENTS = ['claude-desktop', 'claude-code', 'cursor', 'cline', 'smithery',
1120
+ const INTEGRATION_MCP_CLIENTS = ['claude-desktop', 'claude-code', 'cursor', 'cline',
964
1121
  'codex', 'kimi', 'glm-zcode', 'deepseek-harness'];
965
1122
  const ALL_INTEGRATION_SLUGS = [...INTEGRATION_EXCHANGES, ...INTEGRATION_FRAMEWORKS, ...INTEGRATION_MCP_CLIENTS];
966
1123
  const INTEGRATION_HTML = new Map();
@@ -976,15 +1133,8 @@ async function startHttp() {
976
1133
  }
977
1134
  }
978
1135
  }
979
- app.get('/integrations/:slug', (req, res) => {
980
- const slug = (req.params.slug || '').toLowerCase().replace(/\.html$/, '');
981
- const html = INTEGRATION_HTML.get(slug);
982
- if (!html) {
983
- return res.status(404).type('text/plain').send('Integration not found');
984
- }
985
- res.setHeader('Cache-Control', 'public, max-age=60, must-revalidate');
986
- res.type('text/html').send(html);
987
- });
1136
+ // A retired slug answers 301 before the 404 branch; see retired-slugs.ts.
1137
+ app.get('/integrations/:slug', (0, retired_slugs_js_1.integrationPageHandler)(INTEGRATION_HTML));
988
1138
  app.get('/docs/integrations/:slug', (req, res) => {
989
1139
  const slug = (req.params.slug || '').toLowerCase().replace(/\.html$/, '');
990
1140
  return res.redirect(301, `/integrations/${slug}`);
@@ -1621,10 +1771,23 @@ async function startHttp() {
1621
1771
  });
1622
1772
  // ── Welcome (shows API key after successful checkout OR paywall CTA on organic visit) ──
1623
1773
  // ACTIVATION-PAYWALL-W1: organic visits (no session_id) get the paywall CTA
1624
- // arm. Post-checkout visits (session_id present) get the API-key reveal.
1774
+ // arm. Post-checkout visits (session_id present) get the API-key reveal —
1775
+ // once, for a fresh paid session only (SECR-03, src/lib/key-reveal.ts).
1625
1776
  // UTM query params are surfaced to the template so the paywall button
1626
1777
  // preserves the attribution chain through to Stripe.
1627
- app.get('/welcome', async (req, res) => {
1778
+ //
1779
+ // OPS-AUDIT-REMEDIATION-HIGH-W2-R2 CH2 (SECR-03): per-IP limiter on the session_id arm only, in
1780
+ // recoverKeyLimiter's shape. Each such view is a Stripe call and may reveal a key; the organic arm
1781
+ // stays unlimited.
1782
+ const welcomeKeyLimiter = rateLimit({
1783
+ windowMs: 60 * 60 * 1000,
1784
+ max: 5,
1785
+ standardHeaders: true,
1786
+ legacyHeaders: false,
1787
+ skip: (req) => !req.query.session_id,
1788
+ message: 'Too many requests. Try again in an hour.',
1789
+ });
1790
+ app.get('/welcome', welcomeKeyLimiter, async (req, res) => {
1628
1791
  const sessionId = req.query.session_id;
1629
1792
  const utmSource = typeof req.query.utm_source === 'string' ? req.query.utm_source : null;
1630
1793
  const utmCampaign = typeof req.query.utm_campaign === 'string' ? req.query.utm_campaign : null;
@@ -1640,9 +1803,12 @@ async function startHttp() {
1640
1803
  if (!sessionId) {
1641
1804
  return res.send((0, welcome_page_js_1.getWelcomePageHtml)(null, null, null, { utmSource, utmCampaign, newSignupEnabled, oauthProviders, unifiedSignin, src }));
1642
1805
  }
1806
+ // This arm can render a key: never cache it, and never hand its URL (it carries the session id) to
1807
+ // another origin as a Referer. Set before the reveal, so every response of the arm carries both.
1808
+ res.setHeader('Cache-Control', 'no-store');
1809
+ res.setHeader('Referrer-Policy', 'no-referrer');
1643
1810
  try {
1644
- const { apiKey, tier, email } = await (0, stripe_js_1.getCustomerApiKey)(sessionId);
1645
- res.send((0, welcome_page_js_1.getWelcomePageHtml)(apiKey, tier, email, { utmSource, utmCampaign, newSignupEnabled, oauthProviders, unifiedSignin, src }));
1811
+ res.send((0, welcome_page_js_1.getWelcomeRevealHtml)(await (0, key_reveal_js_1.revealKeyOnce)(sessionId), { utmSource, utmCampaign, newSignupEnabled, oauthProviders, unifiedSignin, src }));
1646
1812
  }
1647
1813
  catch (err) {
1648
1814
  console.error('Welcome page error:', err instanceof Error ? err.message : err);
@@ -2709,6 +2875,9 @@ async function startHttp() {
2709
2875
  res.status(500).json({ error: 'Verification failed' });
2710
2876
  }
2711
2877
  });
2878
+ // DECISION-CALL-V2-W5 CH3 — a pre_trade_check receipt (public, no auth): verifyCheckLookup's body, the one
2879
+ // verify://check/{id} serves. 200 verified | pending · 404 notfound · 400 a malformed id (Copy 3).
2880
+ app.get('/api/verify-check', verifyCheckHttpHandler);
2712
2881
  app.get('/api/merkle-batches', async (_req, res) => {
2713
2882
  try {
2714
2883
  // OPS-CAPPED-COLLECTION-GUARD-W1: the page size is now explicit at the call
@@ -2910,6 +3079,7 @@ async function startHttp() {
2910
3079
  // (it is true in production). POST /api/webhooks/:id/test delivers immediately,
2911
3080
  // whatever the flag says.
2912
3081
  (0, webhook_api_js_1.registerWebhookRoutes)(app);
3082
+ (0, pre_trade_rules_api_js_1.registerPreTradeRulesRoutes)(app); // DECISION-CALL-V2-W2: PUT/GET/DELETE /api/pre-trade-rules — saved pre_trade_check rules, API key, unbilled
2913
3083
  // REFERRAL-LIGHT-W1 (C3): per-IP limiter on the public opt-in (mirrors recoverKeyLimiter).
2914
3084
  const signupEmailLimiter = rateLimit({
2915
3085
  windowMs: 60 * 60 * 1000,
@@ -3236,6 +3406,8 @@ async function startHttp() {
3236
3406
  `<h1 style="color:#56d364">You're in via ${id}${stubNote}</h1>` +
3237
3407
  `<p>${keyCaption}</p>` +
3238
3408
  `<pre style="background:#161b22;border:1px solid #30363d;border-radius:8px;padding:12px;user-select:all">${key}</pre>` +
3409
+ // TG-SIGNIN-W1-R2 CH2 (R2.1, from TG-SIGNIN-W1 CH2 R2.6) — §Copy W3, paid keys only: a free key needs no sign-in.
3410
+ (paid ? `<p>${welcome_page_js_1.TG_SIGNIN_W3}</p>` : '') +
3239
3411
  `<p>Referral link: <a style="color:#58a6ff" href="${referralLink}">${referralLink}</a></p>` +
3240
3412
  `<p style="color:#8b949e;font-size:13px">${footLine}</p></body>`);
3241
3413
  }
@@ -3422,6 +3594,10 @@ async function startHttp() {
3422
3594
  // `lib/entitlement-api.ts` because `index.ts` boots the server at import, which makes any
3423
3595
  // handler closure defined here untestable (CLAUDE.md: make entrypoints test-importable).
3424
3596
  (0, entitlement_api_js_1.registerEntitlementRoutes)(app);
3597
+ // TG-SIGNIN-W1-R2 CH2 R2.4: POST /api/bot/signin-token/redeem — the bot redeems the one-time token the
3598
+ // /welcome reveal minted for a Telegram checkout. Same internal-key auth; body in `lib/tg-signin-tokens.ts`
3599
+ // for the same import-boot reason.
3600
+ (0, tg_signin_tokens_js_1.registerSigninTokenRoutes)(app);
3425
3601
  // OPS-DEPLOY-PROVENANCE-AND-VERDICT-CLASS-W1 CH3b: GET /api/ops/build — which COMMIT this
3426
3602
  // container was built from. Registered here beside the other internal-key routes; the handler
3427
3603
  // lives in lib/ because index.ts boots the server at import.
@@ -5095,9 +5271,8 @@ ${(0, footer_content_js_1.renderBrandFooter)('desktop')}
5095
5271
  </body>
5096
5272
  </html>`;
5097
5273
  }
5098
- // ── Smithery sandbox export ──
5099
- // Allows Smithery to scan tools/resources without starting the server.
5100
- // See https://smithery.ai/docs/deploy#sandbox-server
5274
+ // ── In-process server export ──
5275
+ // Builds the MCP server without starting it, for in-process readers (scripts/lib/mcp-tools-list.mjs).
5101
5276
  function createSandboxServer() {
5102
5277
  return createServer();
5103
5278
  }