clodds 1.1.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 (1719) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +468 -0
  3. package/dist/acp/agreement.d.ts +110 -0
  4. package/dist/acp/agreement.js +514 -0
  5. package/dist/acp/agreement.js.map +1 -0
  6. package/dist/acp/discovery.d.ts +84 -0
  7. package/dist/acp/discovery.js +332 -0
  8. package/dist/acp/discovery.js.map +1 -0
  9. package/dist/acp/escrow.d.ts +139 -0
  10. package/dist/acp/escrow.js +880 -0
  11. package/dist/acp/escrow.js.map +1 -0
  12. package/dist/acp/identity.d.ts +135 -0
  13. package/dist/acp/identity.js +716 -0
  14. package/dist/acp/identity.js.map +1 -0
  15. package/dist/acp/index.d.ts +205 -0
  16. package/dist/acp/index.js +583 -0
  17. package/dist/acp/index.js.map +1 -0
  18. package/dist/acp/persistence.d.ts +59 -0
  19. package/dist/acp/persistence.js +590 -0
  20. package/dist/acp/persistence.js.map +1 -0
  21. package/dist/acp/predictions.d.ts +89 -0
  22. package/dist/acp/predictions.js +417 -0
  23. package/dist/acp/predictions.js.map +1 -0
  24. package/dist/acp/registry.d.ts +143 -0
  25. package/dist/acp/registry.js +584 -0
  26. package/dist/acp/registry.js.map +1 -0
  27. package/dist/agents/handlers/acp.d.ts +12 -0
  28. package/dist/agents/handlers/acp.js +987 -0
  29. package/dist/agents/handlers/acp.js.map +1 -0
  30. package/dist/agents/handlers/agentbets.d.ts +8 -0
  31. package/dist/agents/handlers/agentbets.js +63 -0
  32. package/dist/agents/handlers/agentbets.js.map +1 -0
  33. package/dist/agents/handlers/arbitrage.d.ts +16 -0
  34. package/dist/agents/handlers/arbitrage.js +187 -0
  35. package/dist/agents/handlers/arbitrage.js.map +1 -0
  36. package/dist/agents/handlers/betfair.d.ts +11 -0
  37. package/dist/agents/handlers/betfair.js +214 -0
  38. package/dist/agents/handlers/betfair.js.map +1 -0
  39. package/dist/agents/handlers/binance.d.ts +9 -0
  40. package/dist/agents/handlers/binance.js +227 -0
  41. package/dist/agents/handlers/binance.js.map +1 -0
  42. package/dist/agents/handlers/bittensor.d.ts +10 -0
  43. package/dist/agents/handlers/bittensor.js +90 -0
  44. package/dist/agents/handlers/bittensor.js.map +1 -0
  45. package/dist/agents/handlers/bybit.d.ts +9 -0
  46. package/dist/agents/handlers/bybit.js +226 -0
  47. package/dist/agents/handlers/bybit.js.map +1 -0
  48. package/dist/agents/handlers/credentials.d.ts +8 -0
  49. package/dist/agents/handlers/credentials.js +103 -0
  50. package/dist/agents/handlers/credentials.js.map +1 -0
  51. package/dist/agents/handlers/hyperliquid.d.ts +9 -0
  52. package/dist/agents/handlers/hyperliquid.js +326 -0
  53. package/dist/agents/handlers/hyperliquid.js.map +1 -0
  54. package/dist/agents/handlers/index.d.ts +82 -0
  55. package/dist/agents/handlers/index.js +143 -0
  56. package/dist/agents/handlers/index.js.map +1 -0
  57. package/dist/agents/handlers/kalshi.d.ts +10 -0
  58. package/dist/agents/handlers/kalshi.js +1377 -0
  59. package/dist/agents/handlers/kalshi.js.map +1 -0
  60. package/dist/agents/handlers/manifold.d.ts +9 -0
  61. package/dist/agents/handlers/manifold.js +1001 -0
  62. package/dist/agents/handlers/manifold.js.map +1 -0
  63. package/dist/agents/handlers/markets.d.ts +8 -0
  64. package/dist/agents/handlers/markets.js +321 -0
  65. package/dist/agents/handlers/markets.js.map +1 -0
  66. package/dist/agents/handlers/opinion.d.ts +11 -0
  67. package/dist/agents/handlers/opinion.js +374 -0
  68. package/dist/agents/handlers/opinion.js.map +1 -0
  69. package/dist/agents/handlers/paper-trading.d.ts +8 -0
  70. package/dist/agents/handlers/paper-trading.js +124 -0
  71. package/dist/agents/handlers/paper-trading.js.map +1 -0
  72. package/dist/agents/handlers/polymarket.d.ts +17 -0
  73. package/dist/agents/handlers/polymarket.js +455 -0
  74. package/dist/agents/handlers/polymarket.js.map +1 -0
  75. package/dist/agents/handlers/predictfun.d.ts +9 -0
  76. package/dist/agents/handlers/predictfun.js +488 -0
  77. package/dist/agents/handlers/predictfun.js.map +1 -0
  78. package/dist/agents/handlers/smarkets.d.ts +11 -0
  79. package/dist/agents/handlers/smarkets.js +205 -0
  80. package/dist/agents/handlers/smarkets.js.map +1 -0
  81. package/dist/agents/handlers/solana.d.ts +14 -0
  82. package/dist/agents/handlers/solana.js +1530 -0
  83. package/dist/agents/handlers/solana.js.map +1 -0
  84. package/dist/agents/handlers/types.d.ts +58 -0
  85. package/dist/agents/handlers/types.js +34 -0
  86. package/dist/agents/handlers/types.js.map +1 -0
  87. package/dist/agents/handlers/virtuals.d.ts +11 -0
  88. package/dist/agents/handlers/virtuals.js +135 -0
  89. package/dist/agents/handlers/virtuals.js.map +1 -0
  90. package/dist/agents/handlers/wallets.d.ts +9 -0
  91. package/dist/agents/handlers/wallets.js +222 -0
  92. package/dist/agents/handlers/wallets.js.map +1 -0
  93. package/dist/agents/index.d.ts +79 -0
  94. package/dist/agents/index.js +16690 -0
  95. package/dist/agents/index.js.map +1 -0
  96. package/dist/agents/subagents.d.ts +219 -0
  97. package/dist/agents/subagents.js +736 -0
  98. package/dist/agents/subagents.js.map +1 -0
  99. package/dist/alerts/index.d.ts +110 -0
  100. package/dist/alerts/index.js +421 -0
  101. package/dist/alerts/index.js.map +1 -0
  102. package/dist/alerts/realtime.d.ts +114 -0
  103. package/dist/alerts/realtime.js +262 -0
  104. package/dist/alerts/realtime.js.map +1 -0
  105. package/dist/api/apikeys.d.ts +74 -0
  106. package/dist/api/apikeys.js +319 -0
  107. package/dist/api/apikeys.js.map +1 -0
  108. package/dist/api/compute/code.d.ts +28 -0
  109. package/dist/api/compute/code.js +257 -0
  110. package/dist/api/compute/code.js.map +1 -0
  111. package/dist/api/compute/data.d.ts +72 -0
  112. package/dist/api/compute/data.js +264 -0
  113. package/dist/api/compute/data.js.map +1 -0
  114. package/dist/api/compute/gateway.d.ts +185 -0
  115. package/dist/api/compute/gateway.js +958 -0
  116. package/dist/api/compute/gateway.js.map +1 -0
  117. package/dist/api/compute/index.d.ts +21 -0
  118. package/dist/api/compute/index.js +46 -0
  119. package/dist/api/compute/index.js.map +1 -0
  120. package/dist/api/compute/llm.d.ts +64 -0
  121. package/dist/api/compute/llm.js +602 -0
  122. package/dist/api/compute/llm.js.map +1 -0
  123. package/dist/api/compute/persistence.d.ts +77 -0
  124. package/dist/api/compute/persistence.js +251 -0
  125. package/dist/api/compute/persistence.js.map +1 -0
  126. package/dist/api/compute/storage.d.ts +48 -0
  127. package/dist/api/compute/storage.js +283 -0
  128. package/dist/api/compute/storage.js.map +1 -0
  129. package/dist/api/compute/trade.d.ts +69 -0
  130. package/dist/api/compute/trade.js +460 -0
  131. package/dist/api/compute/trade.js.map +1 -0
  132. package/dist/api/compute/types.d.ts +271 -0
  133. package/dist/api/compute/types.js +87 -0
  134. package/dist/api/compute/types.js.map +1 -0
  135. package/dist/api/compute/web.d.ts +29 -0
  136. package/dist/api/compute/web.js +255 -0
  137. package/dist/api/compute/web.js.map +1 -0
  138. package/dist/api/custody.d.ts +48 -0
  139. package/dist/api/custody.js +272 -0
  140. package/dist/api/custody.js.map +1 -0
  141. package/dist/api/fees.d.ts +91 -0
  142. package/dist/api/fees.js +155 -0
  143. package/dist/api/fees.js.map +1 -0
  144. package/dist/api/gateway.d.ts +40 -0
  145. package/dist/api/gateway.js +569 -0
  146. package/dist/api/gateway.js.map +1 -0
  147. package/dist/api/index.d.ts +29 -0
  148. package/dist/api/index.js +55 -0
  149. package/dist/api/index.js.map +1 -0
  150. package/dist/api/jobs.d.ts +59 -0
  151. package/dist/api/jobs.js +362 -0
  152. package/dist/api/jobs.js.map +1 -0
  153. package/dist/api/middleware.d.ts +60 -0
  154. package/dist/api/middleware.js +315 -0
  155. package/dist/api/middleware.js.map +1 -0
  156. package/dist/api/prompt.d.ts +44 -0
  157. package/dist/api/prompt.js +345 -0
  158. package/dist/api/prompt.js.map +1 -0
  159. package/dist/api/sdk.d.ts +258 -0
  160. package/dist/api/sdk.js +341 -0
  161. package/dist/api/sdk.js.map +1 -0
  162. package/dist/api/server.d.ts +17 -0
  163. package/dist/api/server.js +852 -0
  164. package/dist/api/server.js.map +1 -0
  165. package/dist/api/types.d.ts +307 -0
  166. package/dist/api/types.js +64 -0
  167. package/dist/api/types.js.map +1 -0
  168. package/dist/arbitrage/index.d.ts +124 -0
  169. package/dist/arbitrage/index.js +482 -0
  170. package/dist/arbitrage/index.js.map +1 -0
  171. package/dist/auth/copilot.d.ts +87 -0
  172. package/dist/auth/copilot.js +328 -0
  173. package/dist/auth/copilot.js.map +1 -0
  174. package/dist/auth/google.d.ts +121 -0
  175. package/dist/auth/google.js +479 -0
  176. package/dist/auth/google.js.map +1 -0
  177. package/dist/auth/index.d.ts +8 -0
  178. package/dist/auth/index.js +25 -0
  179. package/dist/auth/index.js.map +1 -0
  180. package/dist/auth/oauth.d.ts +94 -0
  181. package/dist/auth/oauth.js +502 -0
  182. package/dist/auth/oauth.js.map +1 -0
  183. package/dist/auth/qwen.d.ts +110 -0
  184. package/dist/auth/qwen.js +351 -0
  185. package/dist/auth/qwen.js.map +1 -0
  186. package/dist/auto-reply/index.d.ts +143 -0
  187. package/dist/auto-reply/index.js +391 -0
  188. package/dist/auto-reply/index.js.map +1 -0
  189. package/dist/automation/cron.d.ts +66 -0
  190. package/dist/automation/cron.js +226 -0
  191. package/dist/automation/cron.js.map +1 -0
  192. package/dist/automation/heartbeats.d.ts +63 -0
  193. package/dist/automation/heartbeats.js +144 -0
  194. package/dist/automation/heartbeats.js.map +1 -0
  195. package/dist/automation/index.d.ts +9 -0
  196. package/dist/automation/index.js +15 -0
  197. package/dist/automation/index.js.map +1 -0
  198. package/dist/automation/webhooks.d.ts +60 -0
  199. package/dist/automation/webhooks.js +225 -0
  200. package/dist/automation/webhooks.js.map +1 -0
  201. package/dist/bankr/client.d.ts +86 -0
  202. package/dist/bankr/client.js +177 -0
  203. package/dist/bankr/client.js.map +1 -0
  204. package/dist/bankr/index.d.ts +6 -0
  205. package/dist/bankr/index.js +23 -0
  206. package/dist/bankr/index.js.map +1 -0
  207. package/dist/base/index.d.ts +6 -0
  208. package/dist/base/index.js +23 -0
  209. package/dist/base/index.js.map +1 -0
  210. package/dist/base/provider.d.ts +27 -0
  211. package/dist/base/provider.js +128 -0
  212. package/dist/base/provider.js.map +1 -0
  213. package/dist/bin/worker.d.ts +31 -0
  214. package/dist/bin/worker.js +127 -0
  215. package/dist/bin/worker.js.map +1 -0
  216. package/dist/bittensor/chutes.d.ts +14 -0
  217. package/dist/bittensor/chutes.js +141 -0
  218. package/dist/bittensor/chutes.js.map +1 -0
  219. package/dist/bittensor/index.d.ts +7 -0
  220. package/dist/bittensor/index.js +13 -0
  221. package/dist/bittensor/index.js.map +1 -0
  222. package/dist/bittensor/persistence.d.ts +8 -0
  223. package/dist/bittensor/persistence.js +188 -0
  224. package/dist/bittensor/persistence.js.map +1 -0
  225. package/dist/bittensor/plugin.d.ts +30 -0
  226. package/dist/bittensor/plugin.js +134 -0
  227. package/dist/bittensor/plugin.js.map +1 -0
  228. package/dist/bittensor/python-runner.d.ts +7 -0
  229. package/dist/bittensor/python-runner.js +83 -0
  230. package/dist/bittensor/python-runner.js.map +1 -0
  231. package/dist/bittensor/server.d.ts +7 -0
  232. package/dist/bittensor/server.js +110 -0
  233. package/dist/bittensor/server.js.map +1 -0
  234. package/dist/bittensor/service.d.ts +7 -0
  235. package/dist/bittensor/service.js +291 -0
  236. package/dist/bittensor/service.js.map +1 -0
  237. package/dist/bittensor/tool.d.ts +45 -0
  238. package/dist/bittensor/tool.js +147 -0
  239. package/dist/bittensor/tool.js.map +1 -0
  240. package/dist/bittensor/types.d.ts +188 -0
  241. package/dist/bittensor/types.js +6 -0
  242. package/dist/bittensor/types.js.map +1 -0
  243. package/dist/bittensor/wallet.d.ts +18 -0
  244. package/dist/bittensor/wallet.js +192 -0
  245. package/dist/bittensor/wallet.js.map +1 -0
  246. package/dist/bridge/wormhole.d.ts +239 -0
  247. package/dist/bridge/wormhole.js +404 -0
  248. package/dist/bridge/wormhole.js.map +1 -0
  249. package/dist/browser/index.d.ts +67 -0
  250. package/dist/browser/index.js +458 -0
  251. package/dist/browser/index.js.map +1 -0
  252. package/dist/cache/index.d.ts +105 -0
  253. package/dist/cache/index.js +306 -0
  254. package/dist/cache/index.js.map +1 -0
  255. package/dist/canvas/index.d.ts +66 -0
  256. package/dist/canvas/index.js +391 -0
  257. package/dist/canvas/index.js.map +1 -0
  258. package/dist/channels/base-adapter.d.ts +126 -0
  259. package/dist/channels/base-adapter.js +416 -0
  260. package/dist/channels/base-adapter.js.map +1 -0
  261. package/dist/channels/bluebubbles/index.d.ts +23 -0
  262. package/dist/channels/bluebubbles/index.js +182 -0
  263. package/dist/channels/bluebubbles/index.js.map +1 -0
  264. package/dist/channels/discord/index.d.ts +25 -0
  265. package/dist/channels/discord/index.js +419 -0
  266. package/dist/channels/discord/index.js.map +1 -0
  267. package/dist/channels/googlechat/index.d.ts +35 -0
  268. package/dist/channels/googlechat/index.js +223 -0
  269. package/dist/channels/googlechat/index.js.map +1 -0
  270. package/dist/channels/imessage/index.d.ts +28 -0
  271. package/dist/channels/imessage/index.js +340 -0
  272. package/dist/channels/imessage/index.js.map +1 -0
  273. package/dist/channels/index.d.ts +58 -0
  274. package/dist/channels/index.js +382 -0
  275. package/dist/channels/index.js.map +1 -0
  276. package/dist/channels/line/index.d.ts +307 -0
  277. package/dist/channels/line/index.js +760 -0
  278. package/dist/channels/line/index.js.map +1 -0
  279. package/dist/channels/matrix/index.d.ts +35 -0
  280. package/dist/channels/matrix/index.js +328 -0
  281. package/dist/channels/matrix/index.js.map +1 -0
  282. package/dist/channels/mattermost/index.d.ts +25 -0
  283. package/dist/channels/mattermost/index.js +239 -0
  284. package/dist/channels/mattermost/index.js.map +1 -0
  285. package/dist/channels/nextcloud-talk/index.d.ts +25 -0
  286. package/dist/channels/nextcloud-talk/index.js +175 -0
  287. package/dist/channels/nextcloud-talk/index.js.map +1 -0
  288. package/dist/channels/nostr/index.d.ts +21 -0
  289. package/dist/channels/nostr/index.js +278 -0
  290. package/dist/channels/nostr/index.js.map +1 -0
  291. package/dist/channels/signal/index.d.ts +33 -0
  292. package/dist/channels/signal/index.js +333 -0
  293. package/dist/channels/signal/index.js.map +1 -0
  294. package/dist/channels/slack/index.d.ts +26 -0
  295. package/dist/channels/slack/index.js +266 -0
  296. package/dist/channels/slack/index.js.map +1 -0
  297. package/dist/channels/teams/index.d.ts +42 -0
  298. package/dist/channels/teams/index.js +312 -0
  299. package/dist/channels/teams/index.js.map +1 -0
  300. package/dist/channels/telegram/index.d.ts +9 -0
  301. package/dist/channels/telegram/index.js +761 -0
  302. package/dist/channels/telegram/index.js.map +1 -0
  303. package/dist/channels/tlon/index.d.ts +25 -0
  304. package/dist/channels/tlon/index.js +236 -0
  305. package/dist/channels/tlon/index.js.map +1 -0
  306. package/dist/channels/twitch/index.d.ts +25 -0
  307. package/dist/channels/twitch/index.js +182 -0
  308. package/dist/channels/twitch/index.js.map +1 -0
  309. package/dist/channels/voice/index.d.ts +31 -0
  310. package/dist/channels/voice/index.js +208 -0
  311. package/dist/channels/voice/index.js.map +1 -0
  312. package/dist/channels/webchat/index.d.ts +29 -0
  313. package/dist/channels/webchat/index.js +366 -0
  314. package/dist/channels/webchat/index.js.map +1 -0
  315. package/dist/channels/whatsapp/index.d.ts +72 -0
  316. package/dist/channels/whatsapp/index.js +767 -0
  317. package/dist/channels/whatsapp/index.js.map +1 -0
  318. package/dist/channels/zalo/index.d.ts +45 -0
  319. package/dist/channels/zalo/index.js +285 -0
  320. package/dist/channels/zalo/index.js.map +1 -0
  321. package/dist/cli/commands/doctor.d.ts +23 -0
  322. package/dist/cli/commands/doctor.js +649 -0
  323. package/dist/cli/commands/doctor.js.map +1 -0
  324. package/dist/cli/commands/gateway.d.ts +6 -0
  325. package/dist/cli/commands/gateway.js +32 -0
  326. package/dist/cli/commands/gateway.js.map +1 -0
  327. package/dist/cli/commands/index.d.ts +31 -0
  328. package/dist/cli/commands/index.js +3743 -0
  329. package/dist/cli/commands/index.js.map +1 -0
  330. package/dist/cli/commands/onboard.d.ts +4 -0
  331. package/dist/cli/commands/onboard.js +334 -0
  332. package/dist/cli/commands/onboard.js.map +1 -0
  333. package/dist/cli/commands/repl.d.ts +11 -0
  334. package/dist/cli/commands/repl.js +185 -0
  335. package/dist/cli/commands/repl.js.map +1 -0
  336. package/dist/cli/commands/skills.d.ts +29 -0
  337. package/dist/cli/commands/skills.js +297 -0
  338. package/dist/cli/commands/skills.js.map +1 -0
  339. package/dist/cli/index.d.ts +12 -0
  340. package/dist/cli/index.js +449 -0
  341. package/dist/cli/index.js.map +1 -0
  342. package/dist/cli/secure.d.ts +14 -0
  343. package/dist/cli/secure.js +626 -0
  344. package/dist/cli/secure.js.map +1 -0
  345. package/dist/commands/index.d.ts +61 -0
  346. package/dist/commands/index.js +290 -0
  347. package/dist/commands/index.js.map +1 -0
  348. package/dist/commands/registry.d.ts +69 -0
  349. package/dist/commands/registry.js +3142 -0
  350. package/dist/commands/registry.js.map +1 -0
  351. package/dist/config/index.d.ts +465 -0
  352. package/dist/config/index.js +1451 -0
  353. package/dist/config/index.js.map +1 -0
  354. package/dist/credentials/index.d.ts +51 -0
  355. package/dist/credentials/index.js +270 -0
  356. package/dist/credentials/index.js.map +1 -0
  357. package/dist/cron/index.d.ts +151 -0
  358. package/dist/cron/index.js +1283 -0
  359. package/dist/cron/index.js.map +1 -0
  360. package/dist/cron/types.d.ts +102 -0
  361. package/dist/cron/types.js +6 -0
  362. package/dist/cron/types.js.map +1 -0
  363. package/dist/daemon/index.d.ts +23 -0
  364. package/dist/daemon/index.js +159 -0
  365. package/dist/daemon/index.js.map +1 -0
  366. package/dist/db/index.d.ts +825 -0
  367. package/dist/db/index.js +3382 -0
  368. package/dist/db/index.js.map +1 -0
  369. package/dist/db/migrations.d.ts +70 -0
  370. package/dist/db/migrations.js +1373 -0
  371. package/dist/db/migrations.js.map +1 -0
  372. package/dist/docker/index.d.ts +188 -0
  373. package/dist/docker/index.js +571 -0
  374. package/dist/docker/index.js.map +1 -0
  375. package/dist/doctor/index.d.ts +47 -0
  376. package/dist/doctor/index.js +379 -0
  377. package/dist/doctor/index.js.map +1 -0
  378. package/dist/embeddings/index.d.ts +65 -0
  379. package/dist/embeddings/index.js +399 -0
  380. package/dist/embeddings/index.js.map +1 -0
  381. package/dist/evm/contracts.d.ts +112 -0
  382. package/dist/evm/contracts.js +332 -0
  383. package/dist/evm/contracts.js.map +1 -0
  384. package/dist/evm/index.d.ts +21 -0
  385. package/dist/evm/index.js +45 -0
  386. package/dist/evm/index.js.map +1 -0
  387. package/dist/evm/multichain.d.ts +87 -0
  388. package/dist/evm/multichain.js +308 -0
  389. package/dist/evm/multichain.js.map +1 -0
  390. package/dist/evm/odos.d.ts +62 -0
  391. package/dist/evm/odos.js +261 -0
  392. package/dist/evm/odos.js.map +1 -0
  393. package/dist/evm/oneinch.d.ts +55 -0
  394. package/dist/evm/oneinch.js +324 -0
  395. package/dist/evm/oneinch.js.map +1 -0
  396. package/dist/evm/transfers.d.ts +83 -0
  397. package/dist/evm/transfers.js +393 -0
  398. package/dist/evm/transfers.js.map +1 -0
  399. package/dist/evm/uniswap.d.ts +56 -0
  400. package/dist/evm/uniswap.js +307 -0
  401. package/dist/evm/uniswap.js.map +1 -0
  402. package/dist/evm/virtuals.d.ts +220 -0
  403. package/dist/evm/virtuals.js +735 -0
  404. package/dist/evm/virtuals.js.map +1 -0
  405. package/dist/evm/wallet.d.ts +96 -0
  406. package/dist/evm/wallet.js +258 -0
  407. package/dist/evm/wallet.js.map +1 -0
  408. package/dist/exchanges/binance-futures/index.d.ts +83 -0
  409. package/dist/exchanges/binance-futures/index.js +394 -0
  410. package/dist/exchanges/binance-futures/index.js.map +1 -0
  411. package/dist/exchanges/bybit/index.d.ts +78 -0
  412. package/dist/exchanges/bybit/index.js +379 -0
  413. package/dist/exchanges/bybit/index.js.map +1 -0
  414. package/dist/exchanges/hyperliquid/index.d.ts +594 -0
  415. package/dist/exchanges/hyperliquid/index.js +1101 -0
  416. package/dist/exchanges/hyperliquid/index.js.map +1 -0
  417. package/dist/exchanges/mexc/index.d.ts +80 -0
  418. package/dist/exchanges/mexc/index.js +389 -0
  419. package/dist/exchanges/mexc/index.js.map +1 -0
  420. package/dist/exchanges/opinion/index.d.ts +128 -0
  421. package/dist/exchanges/opinion/index.js +443 -0
  422. package/dist/exchanges/opinion/index.js.map +1 -0
  423. package/dist/exchanges/predictfun/index.d.ts +107 -0
  424. package/dist/exchanges/predictfun/index.js +398 -0
  425. package/dist/exchanges/predictfun/index.js.map +1 -0
  426. package/dist/execution/auto-redeem.d.ts +55 -0
  427. package/dist/execution/auto-redeem.js +324 -0
  428. package/dist/execution/auto-redeem.js.map +1 -0
  429. package/dist/execution/bracket-orders.d.ts +84 -0
  430. package/dist/execution/bracket-orders.js +387 -0
  431. package/dist/execution/bracket-orders.js.map +1 -0
  432. package/dist/execution/circuit-breaker.d.ts +87 -0
  433. package/dist/execution/circuit-breaker.js +274 -0
  434. package/dist/execution/circuit-breaker.js.map +1 -0
  435. package/dist/execution/dca-persistence.d.ts +47 -0
  436. package/dist/execution/dca-persistence.js +159 -0
  437. package/dist/execution/dca-persistence.js.map +1 -0
  438. package/dist/execution/dca.d.ts +60 -0
  439. package/dist/execution/dca.js +273 -0
  440. package/dist/execution/dca.js.map +1 -0
  441. package/dist/execution/futures.d.ts +162 -0
  442. package/dist/execution/futures.js +1336 -0
  443. package/dist/execution/futures.js.map +1 -0
  444. package/dist/execution/index.d.ts +346 -0
  445. package/dist/execution/index.js +2532 -0
  446. package/dist/execution/index.js.map +1 -0
  447. package/dist/execution/mev-protection.d.ts +150 -0
  448. package/dist/execution/mev-protection.js +377 -0
  449. package/dist/execution/mev-protection.js.map +1 -0
  450. package/dist/execution/order-persistence.d.ts +81 -0
  451. package/dist/execution/order-persistence.js +350 -0
  452. package/dist/execution/order-persistence.js.map +1 -0
  453. package/dist/execution/position-manager.d.ts +142 -0
  454. package/dist/execution/position-manager.js +404 -0
  455. package/dist/execution/position-manager.js.map +1 -0
  456. package/dist/execution/smart-router.d.ts +90 -0
  457. package/dist/execution/smart-router.js +323 -0
  458. package/dist/execution/smart-router.js.map +1 -0
  459. package/dist/execution/trigger-orders.d.ts +81 -0
  460. package/dist/execution/trigger-orders.js +266 -0
  461. package/dist/execution/trigger-orders.js.map +1 -0
  462. package/dist/execution/twap.d.ts +87 -0
  463. package/dist/execution/twap.js +405 -0
  464. package/dist/execution/twap.js.map +1 -0
  465. package/dist/extensions/copilot-proxy/index.d.ts +49 -0
  466. package/dist/extensions/copilot-proxy/index.js +204 -0
  467. package/dist/extensions/copilot-proxy/index.js.map +1 -0
  468. package/dist/extensions/diagnostics-otel/index.d.ts +54 -0
  469. package/dist/extensions/diagnostics-otel/index.js +290 -0
  470. package/dist/extensions/diagnostics-otel/index.js.map +1 -0
  471. package/dist/extensions/google-auth/index.d.ts +71 -0
  472. package/dist/extensions/google-auth/index.js +350 -0
  473. package/dist/extensions/google-auth/index.js.map +1 -0
  474. package/dist/extensions/index.d.ts +11 -0
  475. package/dist/extensions/index.js +29 -0
  476. package/dist/extensions/index.js.map +1 -0
  477. package/dist/extensions/llm-task/index.d.ts +80 -0
  478. package/dist/extensions/llm-task/index.js +248 -0
  479. package/dist/extensions/llm-task/index.js.map +1 -0
  480. package/dist/extensions/lobster/index.d.ts +69 -0
  481. package/dist/extensions/lobster/index.js +178 -0
  482. package/dist/extensions/lobster/index.js.map +1 -0
  483. package/dist/extensions/memory-lancedb/index.d.ts +62 -0
  484. package/dist/extensions/memory-lancedb/index.js +343 -0
  485. package/dist/extensions/memory-lancedb/index.js.map +1 -0
  486. package/dist/extensions/open-prose/index.d.ts +82 -0
  487. package/dist/extensions/open-prose/index.js +565 -0
  488. package/dist/extensions/open-prose/index.js.map +1 -0
  489. package/dist/extensions/qwen-portal/index.d.ts +48 -0
  490. package/dist/extensions/qwen-portal/index.js +161 -0
  491. package/dist/extensions/qwen-portal/index.js.map +1 -0
  492. package/dist/extensions/task-runner/index.d.ts +121 -0
  493. package/dist/extensions/task-runner/index.js +640 -0
  494. package/dist/extensions/task-runner/index.js.map +1 -0
  495. package/dist/farcaster/client.d.ts +101 -0
  496. package/dist/farcaster/client.js +282 -0
  497. package/dist/farcaster/client.js.map +1 -0
  498. package/dist/farcaster/index.d.ts +4 -0
  499. package/dist/farcaster/index.js +21 -0
  500. package/dist/farcaster/index.js.map +1 -0
  501. package/dist/feeds/acled/index.d.ts +86 -0
  502. package/dist/feeds/acled/index.js +215 -0
  503. package/dist/feeds/acled/index.js.map +1 -0
  504. package/dist/feeds/agentbets/index.d.ts +17 -0
  505. package/dist/feeds/agentbets/index.js +137 -0
  506. package/dist/feeds/agentbets/index.js.map +1 -0
  507. package/dist/feeds/betfair/index.d.ts +132 -0
  508. package/dist/feeds/betfair/index.js +640 -0
  509. package/dist/feeds/betfair/index.js.map +1 -0
  510. package/dist/feeds/crypto/index.d.ts +101 -0
  511. package/dist/feeds/crypto/index.js +506 -0
  512. package/dist/feeds/crypto/index.js.map +1 -0
  513. package/dist/feeds/crypto/whale-tracker.d.ts +138 -0
  514. package/dist/feeds/crypto/whale-tracker.js +685 -0
  515. package/dist/feeds/crypto/whale-tracker.js.map +1 -0
  516. package/dist/feeds/descriptors.d.ts +14 -0
  517. package/dist/feeds/descriptors.js +582 -0
  518. package/dist/feeds/descriptors.js.map +1 -0
  519. package/dist/feeds/drift/index.d.ts +23 -0
  520. package/dist/feeds/drift/index.js +182 -0
  521. package/dist/feeds/drift/index.js.map +1 -0
  522. package/dist/feeds/drift/trading.d.ts +75 -0
  523. package/dist/feeds/drift/trading.js +457 -0
  524. package/dist/feeds/drift/trading.js.map +1 -0
  525. package/dist/feeds/external/index.d.ts +48 -0
  526. package/dist/feeds/external/index.js +575 -0
  527. package/dist/feeds/external/index.js.map +1 -0
  528. package/dist/feeds/fred/index.d.ts +134 -0
  529. package/dist/feeds/fred/index.js +263 -0
  530. package/dist/feeds/fred/index.js.map +1 -0
  531. package/dist/feeds/freshness.d.ts +79 -0
  532. package/dist/feeds/freshness.js +259 -0
  533. package/dist/feeds/freshness.js.map +1 -0
  534. package/dist/feeds/hedgehog/index.d.ts +24 -0
  535. package/dist/feeds/hedgehog/index.js +589 -0
  536. package/dist/feeds/hedgehog/index.js.map +1 -0
  537. package/dist/feeds/hedgehog/types.d.ts +215 -0
  538. package/dist/feeds/hedgehog/types.js +7 -0
  539. package/dist/feeds/hedgehog/types.js.map +1 -0
  540. package/dist/feeds/index.d.ts +38 -0
  541. package/dist/feeds/index.js +469 -0
  542. package/dist/feeds/index.js.map +1 -0
  543. package/dist/feeds/kalshi/index.d.ts +116 -0
  544. package/dist/feeds/kalshi/index.js +970 -0
  545. package/dist/feeds/kalshi/index.js.map +1 -0
  546. package/dist/feeds/manifold/index.d.ts +15 -0
  547. package/dist/feeds/manifold/index.js +269 -0
  548. package/dist/feeds/manifold/index.js.map +1 -0
  549. package/dist/feeds/metaculus/index.d.ts +22 -0
  550. package/dist/feeds/metaculus/index.js +149 -0
  551. package/dist/feeds/metaculus/index.js.map +1 -0
  552. package/dist/feeds/news/index.d.ts +20 -0
  553. package/dist/feeds/news/index.js +308 -0
  554. package/dist/feeds/news/index.js.map +1 -0
  555. package/dist/feeds/opinion/index.d.ts +31 -0
  556. package/dist/feeds/opinion/index.js +389 -0
  557. package/dist/feeds/opinion/index.js.map +1 -0
  558. package/dist/feeds/polymarket/index.d.ts +21 -0
  559. package/dist/feeds/polymarket/index.js +501 -0
  560. package/dist/feeds/polymarket/index.js.map +1 -0
  561. package/dist/feeds/polymarket/rtds.d.ts +40 -0
  562. package/dist/feeds/polymarket/rtds.js +159 -0
  563. package/dist/feeds/polymarket/rtds.js.map +1 -0
  564. package/dist/feeds/polymarket/user-ws.d.ts +64 -0
  565. package/dist/feeds/polymarket/user-ws.js +230 -0
  566. package/dist/feeds/polymarket/user-ws.js.map +1 -0
  567. package/dist/feeds/polymarket/whale-tracker.d.ts +152 -0
  568. package/dist/feeds/polymarket/whale-tracker.js +709 -0
  569. package/dist/feeds/polymarket/whale-tracker.js.map +1 -0
  570. package/dist/feeds/predictfun/index.d.ts +24 -0
  571. package/dist/feeds/predictfun/index.js +234 -0
  572. package/dist/feeds/predictfun/index.js.map +1 -0
  573. package/dist/feeds/predictit/index.d.ts +14 -0
  574. package/dist/feeds/predictit/index.js +88 -0
  575. package/dist/feeds/predictit/index.js.map +1 -0
  576. package/dist/feeds/registry.d.ts +148 -0
  577. package/dist/feeds/registry.js +197 -0
  578. package/dist/feeds/registry.js.map +1 -0
  579. package/dist/feeds/smarkets/index.d.ts +76 -0
  580. package/dist/feeds/smarkets/index.js +415 -0
  581. package/dist/feeds/smarkets/index.js.map +1 -0
  582. package/dist/feeds/virtuals/index.d.ts +92 -0
  583. package/dist/feeds/virtuals/index.js +341 -0
  584. package/dist/feeds/virtuals/index.js.map +1 -0
  585. package/dist/feeds/weather-nws/index.d.ts +73 -0
  586. package/dist/feeds/weather-nws/index.js +162 -0
  587. package/dist/feeds/weather-nws/index.js.map +1 -0
  588. package/dist/feeds/weather-openmeteo/index.d.ts +80 -0
  589. package/dist/feeds/weather-openmeteo/index.js +197 -0
  590. package/dist/feeds/weather-openmeteo/index.js.map +1 -0
  591. package/dist/gateway/alerts-routes.d.ts +15 -0
  592. package/dist/gateway/alerts-routes.js +188 -0
  593. package/dist/gateway/alerts-routes.js.map +1 -0
  594. package/dist/gateway/alt-data-routes.d.ts +15 -0
  595. package/dist/gateway/alt-data-routes.js +67 -0
  596. package/dist/gateway/alt-data-routes.js.map +1 -0
  597. package/dist/gateway/api-routes.d.ts +39 -0
  598. package/dist/gateway/api-routes.js +1028 -0
  599. package/dist/gateway/api-routes.js.map +1 -0
  600. package/dist/gateway/audit-routes.d.ts +8 -0
  601. package/dist/gateway/audit-routes.js +61 -0
  602. package/dist/gateway/audit-routes.js.map +1 -0
  603. package/dist/gateway/bracket-routes.d.ts +12 -0
  604. package/dist/gateway/bracket-routes.js +122 -0
  605. package/dist/gateway/bracket-routes.js.map +1 -0
  606. package/dist/gateway/control-ui.d.ts +45 -0
  607. package/dist/gateway/control-ui.js +301 -0
  608. package/dist/gateway/control-ui.js.map +1 -0
  609. package/dist/gateway/copy-trading-routes.d.ts +12 -0
  610. package/dist/gateway/copy-trading-routes.js +159 -0
  611. package/dist/gateway/copy-trading-routes.js.map +1 -0
  612. package/dist/gateway/cron-routes.d.ts +14 -0
  613. package/dist/gateway/cron-routes.js +132 -0
  614. package/dist/gateway/cron-routes.js.map +1 -0
  615. package/dist/gateway/dca-routes.d.ts +8 -0
  616. package/dist/gateway/dca-routes.js +179 -0
  617. package/dist/gateway/dca-routes.js.map +1 -0
  618. package/dist/gateway/embeddings-routes.d.ts +12 -0
  619. package/dist/gateway/embeddings-routes.js +102 -0
  620. package/dist/gateway/embeddings-routes.js.map +1 -0
  621. package/dist/gateway/feeds-routes.d.ts +34 -0
  622. package/dist/gateway/feeds-routes.js +167 -0
  623. package/dist/gateway/feeds-routes.js.map +1 -0
  624. package/dist/gateway/index.d.ts +100 -0
  625. package/dist/gateway/index.js +2321 -0
  626. package/dist/gateway/index.js.map +1 -0
  627. package/dist/gateway/monitoring-routes.d.ts +12 -0
  628. package/dist/gateway/monitoring-routes.js +73 -0
  629. package/dist/gateway/monitoring-routes.js.map +1 -0
  630. package/dist/gateway/opportunity-routes.d.ts +12 -0
  631. package/dist/gateway/opportunity-routes.js +238 -0
  632. package/dist/gateway/opportunity-routes.js.map +1 -0
  633. package/dist/gateway/payments-routes.d.ts +14 -0
  634. package/dist/gateway/payments-routes.js +82 -0
  635. package/dist/gateway/payments-routes.js.map +1 -0
  636. package/dist/gateway/percolator-routes.d.ts +16 -0
  637. package/dist/gateway/percolator-routes.js +139 -0
  638. package/dist/gateway/percolator-routes.js.map +1 -0
  639. package/dist/gateway/queue-routes.d.ts +12 -0
  640. package/dist/gateway/queue-routes.js +47 -0
  641. package/dist/gateway/queue-routes.js.map +1 -0
  642. package/dist/gateway/risk-routes.d.ts +12 -0
  643. package/dist/gateway/risk-routes.js +119 -0
  644. package/dist/gateway/risk-routes.js.map +1 -0
  645. package/dist/gateway/routing-routes.d.ts +12 -0
  646. package/dist/gateway/routing-routes.js +86 -0
  647. package/dist/gateway/routing-routes.js.map +1 -0
  648. package/dist/gateway/server.d.ts +215 -0
  649. package/dist/gateway/server.js +2287 -0
  650. package/dist/gateway/server.js.map +1 -0
  651. package/dist/gateway/shield-routes.d.ts +8 -0
  652. package/dist/gateway/shield-routes.js +88 -0
  653. package/dist/gateway/shield-routes.js.map +1 -0
  654. package/dist/gateway/signal-bus.d.ts +51 -0
  655. package/dist/gateway/signal-bus.js +64 -0
  656. package/dist/gateway/signal-bus.js.map +1 -0
  657. package/dist/gateway/trigger-routes.d.ts +12 -0
  658. package/dist/gateway/trigger-routes.js +127 -0
  659. package/dist/gateway/trigger-routes.js.map +1 -0
  660. package/dist/gateway/twap-routes.d.ts +12 -0
  661. package/dist/gateway/twap-routes.js +142 -0
  662. package/dist/gateway/twap-routes.js.map +1 -0
  663. package/dist/gateway/webhooks-routes.d.ts +31 -0
  664. package/dist/gateway/webhooks-routes.js +107 -0
  665. package/dist/gateway/webhooks-routes.js.map +1 -0
  666. package/dist/gateway/whale-routes.d.ts +12 -0
  667. package/dist/gateway/whale-routes.js +204 -0
  668. package/dist/gateway/whale-routes.js.map +1 -0
  669. package/dist/history/index.d.ts +81 -0
  670. package/dist/history/index.js +362 -0
  671. package/dist/history/index.js.map +1 -0
  672. package/dist/hooks/index.d.ts +279 -0
  673. package/dist/hooks/index.js +739 -0
  674. package/dist/hooks/index.js.map +1 -0
  675. package/dist/i18n/index.d.ts +65 -0
  676. package/dist/i18n/index.js +183 -0
  677. package/dist/i18n/index.js.map +1 -0
  678. package/dist/identity/erc8004.d.ts +104 -0
  679. package/dist/identity/erc8004.js +493 -0
  680. package/dist/identity/erc8004.js.map +1 -0
  681. package/dist/identity/index.d.ts +1 -0
  682. package/dist/identity/index.js +18 -0
  683. package/dist/identity/index.js.map +1 -0
  684. package/dist/index.d.ts +7 -0
  685. package/dist/index.js +240 -0
  686. package/dist/index.js.map +1 -0
  687. package/dist/infra/index.d.ts +133 -0
  688. package/dist/infra/index.js +481 -0
  689. package/dist/infra/index.js.map +1 -0
  690. package/dist/infra/retry.d.ts +132 -0
  691. package/dist/infra/retry.js +450 -0
  692. package/dist/infra/retry.js.map +1 -0
  693. package/dist/ledger/anchor.d.ts +45 -0
  694. package/dist/ledger/anchor.js +271 -0
  695. package/dist/ledger/anchor.js.map +1 -0
  696. package/dist/ledger/hash.d.ts +26 -0
  697. package/dist/ledger/hash.js +69 -0
  698. package/dist/ledger/hash.js.map +1 -0
  699. package/dist/ledger/hooks.d.ts +107 -0
  700. package/dist/ledger/hooks.js +314 -0
  701. package/dist/ledger/hooks.js.map +1 -0
  702. package/dist/ledger/index.d.ts +67 -0
  703. package/dist/ledger/index.js +221 -0
  704. package/dist/ledger/index.js.map +1 -0
  705. package/dist/ledger/storage.d.ts +57 -0
  706. package/dist/ledger/storage.js +368 -0
  707. package/dist/ledger/storage.js.map +1 -0
  708. package/dist/ledger/types.d.ts +138 -0
  709. package/dist/ledger/types.js +16 -0
  710. package/dist/ledger/types.js.map +1 -0
  711. package/dist/link-understanding/index.d.ts +61 -0
  712. package/dist/link-understanding/index.js +320 -0
  713. package/dist/link-understanding/index.js.map +1 -0
  714. package/dist/logging/index.d.ts +50 -0
  715. package/dist/logging/index.js +255 -0
  716. package/dist/logging/index.js.map +1 -0
  717. package/dist/macos/index.d.ts +143 -0
  718. package/dist/macos/index.js +587 -0
  719. package/dist/macos/index.js.map +1 -0
  720. package/dist/markdown/index.d.ts +43 -0
  721. package/dist/markdown/index.js +305 -0
  722. package/dist/markdown/index.js.map +1 -0
  723. package/dist/market-index/index.d.ts +51 -0
  724. package/dist/market-index/index.js +553 -0
  725. package/dist/market-index/index.js.map +1 -0
  726. package/dist/mcp/index.d.ts +263 -0
  727. package/dist/mcp/index.js +940 -0
  728. package/dist/mcp/index.js.map +1 -0
  729. package/dist/mcp/installer.d.ts +11 -0
  730. package/dist/mcp/installer.js +128 -0
  731. package/dist/mcp/installer.js.map +1 -0
  732. package/dist/mcp/server.d.ts +7 -0
  733. package/dist/mcp/server.js +172 -0
  734. package/dist/mcp/server.js.map +1 -0
  735. package/dist/media/index.d.ts +119 -0
  736. package/dist/media/index.js +740 -0
  737. package/dist/media/index.js.map +1 -0
  738. package/dist/memory/context.d.ts +189 -0
  739. package/dist/memory/context.js +541 -0
  740. package/dist/memory/context.js.map +1 -0
  741. package/dist/memory/index.d.ts +74 -0
  742. package/dist/memory/index.js +352 -0
  743. package/dist/memory/index.js.map +1 -0
  744. package/dist/memory/summarizer.d.ts +10 -0
  745. package/dist/memory/summarizer.js +51 -0
  746. package/dist/memory/summarizer.js.map +1 -0
  747. package/dist/memory/tokenizer.d.ts +4 -0
  748. package/dist/memory/tokenizer.js +61 -0
  749. package/dist/memory/tokenizer.js.map +1 -0
  750. package/dist/messages/unified.d.ts +7 -0
  751. package/dist/messages/unified.js +77 -0
  752. package/dist/messages/unified.js.map +1 -0
  753. package/dist/ml-pipeline/collector.d.ts +23 -0
  754. package/dist/ml-pipeline/collector.js +176 -0
  755. package/dist/ml-pipeline/collector.js.map +1 -0
  756. package/dist/ml-pipeline/index.d.ts +21 -0
  757. package/dist/ml-pipeline/index.js +72 -0
  758. package/dist/ml-pipeline/index.js.map +1 -0
  759. package/dist/ml-pipeline/trainer.d.ts +32 -0
  760. package/dist/ml-pipeline/trainer.js +228 -0
  761. package/dist/ml-pipeline/trainer.js.map +1 -0
  762. package/dist/ml-pipeline/types.d.ts +51 -0
  763. package/dist/ml-pipeline/types.js +23 -0
  764. package/dist/ml-pipeline/types.js.map +1 -0
  765. package/dist/models/adaptive.d.ts +11 -0
  766. package/dist/models/adaptive.js +64 -0
  767. package/dist/models/adaptive.js.map +1 -0
  768. package/dist/models/failover.d.ts +51 -0
  769. package/dist/models/failover.js +151 -0
  770. package/dist/models/failover.js.map +1 -0
  771. package/dist/models/index.d.ts +7 -0
  772. package/dist/models/index.js +13 -0
  773. package/dist/models/index.js.map +1 -0
  774. package/dist/monitoring/alerts.d.ts +185 -0
  775. package/dist/monitoring/alerts.js +565 -0
  776. package/dist/monitoring/alerts.js.map +1 -0
  777. package/dist/monitoring/health.d.ts +151 -0
  778. package/dist/monitoring/health.js +423 -0
  779. package/dist/monitoring/health.js.map +1 -0
  780. package/dist/monitoring/index.d.ts +25 -0
  781. package/dist/monitoring/index.js +258 -0
  782. package/dist/monitoring/index.js.map +1 -0
  783. package/dist/monitoring/metrics.d.ts +147 -0
  784. package/dist/monitoring/metrics.js +519 -0
  785. package/dist/monitoring/metrics.js.map +1 -0
  786. package/dist/nodes/index.d.ts +81 -0
  787. package/dist/nodes/index.js +475 -0
  788. package/dist/nodes/index.js.map +1 -0
  789. package/dist/opportunity/analytics.d.ts +221 -0
  790. package/dist/opportunity/analytics.js +678 -0
  791. package/dist/opportunity/analytics.js.map +1 -0
  792. package/dist/opportunity/combinatorial.d.ts +147 -0
  793. package/dist/opportunity/combinatorial.js +765 -0
  794. package/dist/opportunity/combinatorial.js.map +1 -0
  795. package/dist/opportunity/correlation.d.ts +107 -0
  796. package/dist/opportunity/correlation.js +410 -0
  797. package/dist/opportunity/correlation.js.map +1 -0
  798. package/dist/opportunity/executor.d.ts +108 -0
  799. package/dist/opportunity/executor.js +356 -0
  800. package/dist/opportunity/executor.js.map +1 -0
  801. package/dist/opportunity/index.d.ts +285 -0
  802. package/dist/opportunity/index.js +839 -0
  803. package/dist/opportunity/index.js.map +1 -0
  804. package/dist/opportunity/links.d.ts +87 -0
  805. package/dist/opportunity/links.js +344 -0
  806. package/dist/opportunity/links.js.map +1 -0
  807. package/dist/opportunity/matching.d.ts +101 -0
  808. package/dist/opportunity/matching.js +551 -0
  809. package/dist/opportunity/matching.js.map +1 -0
  810. package/dist/opportunity/outcomes.d.ts +74 -0
  811. package/dist/opportunity/outcomes.js +321 -0
  812. package/dist/opportunity/outcomes.js.map +1 -0
  813. package/dist/opportunity/risk.d.ts +128 -0
  814. package/dist/opportunity/risk.js +381 -0
  815. package/dist/opportunity/risk.js.map +1 -0
  816. package/dist/opportunity/scoring.d.ts +151 -0
  817. package/dist/opportunity/scoring.js +421 -0
  818. package/dist/opportunity/scoring.js.map +1 -0
  819. package/dist/pairing/index.d.ts +108 -0
  820. package/dist/pairing/index.js +431 -0
  821. package/dist/pairing/index.js.map +1 -0
  822. package/dist/payments/index.d.ts +12 -0
  823. package/dist/payments/index.js +34 -0
  824. package/dist/payments/index.js.map +1 -0
  825. package/dist/payments/x402/evm.d.ts +53 -0
  826. package/dist/payments/x402/evm.js +282 -0
  827. package/dist/payments/x402/evm.js.map +1 -0
  828. package/dist/payments/x402/index.d.ts +158 -0
  829. package/dist/payments/x402/index.js +531 -0
  830. package/dist/payments/x402/index.js.map +1 -0
  831. package/dist/payments/x402/solana.d.ts +51 -0
  832. package/dist/payments/x402/solana.js +397 -0
  833. package/dist/payments/x402/solana.js.map +1 -0
  834. package/dist/percolator/accounts.d.ts +21 -0
  835. package/dist/percolator/accounts.js +76 -0
  836. package/dist/percolator/accounts.js.map +1 -0
  837. package/dist/percolator/encode.d.ts +14 -0
  838. package/dist/percolator/encode.js +90 -0
  839. package/dist/percolator/encode.js.map +1 -0
  840. package/dist/percolator/execution.d.ts +29 -0
  841. package/dist/percolator/execution.js +239 -0
  842. package/dist/percolator/execution.js.map +1 -0
  843. package/dist/percolator/feed.d.ts +15 -0
  844. package/dist/percolator/feed.js +160 -0
  845. package/dist/percolator/feed.js.map +1 -0
  846. package/dist/percolator/index.d.ts +20 -0
  847. package/dist/percolator/index.js +24 -0
  848. package/dist/percolator/index.js.map +1 -0
  849. package/dist/percolator/instructions.d.ts +29 -0
  850. package/dist/percolator/instructions.js +52 -0
  851. package/dist/percolator/instructions.js.map +1 -0
  852. package/dist/percolator/keeper.d.ts +11 -0
  853. package/dist/percolator/keeper.js +83 -0
  854. package/dist/percolator/keeper.js.map +1 -0
  855. package/dist/percolator/pda.d.ts +15 -0
  856. package/dist/percolator/pda.js +26 -0
  857. package/dist/percolator/pda.js.map +1 -0
  858. package/dist/percolator/slab.d.ts +122 -0
  859. package/dist/percolator/slab.js +325 -0
  860. package/dist/percolator/slab.js.map +1 -0
  861. package/dist/percolator/tx.d.ts +27 -0
  862. package/dist/percolator/tx.js +77 -0
  863. package/dist/percolator/tx.js.map +1 -0
  864. package/dist/percolator/types.d.ts +51 -0
  865. package/dist/percolator/types.js +9 -0
  866. package/dist/percolator/types.js.map +1 -0
  867. package/dist/permissions/index.d.ts +262 -0
  868. package/dist/permissions/index.js +929 -0
  869. package/dist/permissions/index.js.map +1 -0
  870. package/dist/plugins/index.d.ts +158 -0
  871. package/dist/plugins/index.js +444 -0
  872. package/dist/plugins/index.js.map +1 -0
  873. package/dist/portfolio/index.d.ts +170 -0
  874. package/dist/portfolio/index.js +970 -0
  875. package/dist/portfolio/index.js.map +1 -0
  876. package/dist/presence/index.d.ts +34 -0
  877. package/dist/presence/index.js +124 -0
  878. package/dist/presence/index.js.map +1 -0
  879. package/dist/process/index.d.ts +82 -0
  880. package/dist/process/index.js +402 -0
  881. package/dist/process/index.js.map +1 -0
  882. package/dist/providers/discovery.d.ts +209 -0
  883. package/dist/providers/discovery.js +751 -0
  884. package/dist/providers/discovery.js.map +1 -0
  885. package/dist/providers/health.d.ts +27 -0
  886. package/dist/providers/health.js +80 -0
  887. package/dist/providers/health.js.map +1 -0
  888. package/dist/providers/index.d.ts +154 -0
  889. package/dist/providers/index.js +897 -0
  890. package/dist/providers/index.js.map +1 -0
  891. package/dist/queue/index.d.ts +36 -0
  892. package/dist/queue/index.js +146 -0
  893. package/dist/queue/index.js.map +1 -0
  894. package/dist/queue/jobs/index.d.ts +11 -0
  895. package/dist/queue/jobs/index.js +32 -0
  896. package/dist/queue/jobs/index.js.map +1 -0
  897. package/dist/queue/jobs/producer.d.ts +43 -0
  898. package/dist/queue/jobs/producer.js +233 -0
  899. package/dist/queue/jobs/producer.js.map +1 -0
  900. package/dist/queue/jobs/types.d.ts +128 -0
  901. package/dist/queue/jobs/types.js +14 -0
  902. package/dist/queue/jobs/types.js.map +1 -0
  903. package/dist/queue/jobs/worker.d.ts +22 -0
  904. package/dist/queue/jobs/worker.js +220 -0
  905. package/dist/queue/jobs/worker.js.map +1 -0
  906. package/dist/remote/index.d.ts +136 -0
  907. package/dist/remote/index.js +456 -0
  908. package/dist/remote/index.js.map +1 -0
  909. package/dist/risk/circuit-breaker.d.ts +99 -0
  910. package/dist/risk/circuit-breaker.js +300 -0
  911. package/dist/risk/circuit-breaker.js.map +1 -0
  912. package/dist/risk/dashboard.d.ts +69 -0
  913. package/dist/risk/dashboard.js +127 -0
  914. package/dist/risk/dashboard.js.map +1 -0
  915. package/dist/risk/engine.d.ts +128 -0
  916. package/dist/risk/engine.js +311 -0
  917. package/dist/risk/engine.js.map +1 -0
  918. package/dist/risk/index.d.ts +10 -0
  919. package/dist/risk/index.js +38 -0
  920. package/dist/risk/index.js.map +1 -0
  921. package/dist/risk/stress.d.ts +70 -0
  922. package/dist/risk/stress.js +215 -0
  923. package/dist/risk/stress.js.map +1 -0
  924. package/dist/risk/var.d.ts +72 -0
  925. package/dist/risk/var.js +173 -0
  926. package/dist/risk/var.js.map +1 -0
  927. package/dist/risk/volatility.d.ts +61 -0
  928. package/dist/risk/volatility.js +132 -0
  929. package/dist/risk/volatility.js.map +1 -0
  930. package/dist/routing/index.d.ts +116 -0
  931. package/dist/routing/index.js +371 -0
  932. package/dist/routing/index.js.map +1 -0
  933. package/dist/search/index.d.ts +30 -0
  934. package/dist/search/index.js +129 -0
  935. package/dist/search/index.js.map +1 -0
  936. package/dist/security/address-checker.d.ts +6 -0
  937. package/dist/security/address-checker.js +213 -0
  938. package/dist/security/address-checker.js.map +1 -0
  939. package/dist/security/code-scanner.d.ts +3 -0
  940. package/dist/security/code-scanner.js +190 -0
  941. package/dist/security/code-scanner.js.map +1 -0
  942. package/dist/security/index.d.ts +176 -0
  943. package/dist/security/index.js +498 -0
  944. package/dist/security/index.js.map +1 -0
  945. package/dist/security/sanitizer.d.ts +2 -0
  946. package/dist/security/sanitizer.js +135 -0
  947. package/dist/security/sanitizer.js.map +1 -0
  948. package/dist/security/scam-db.d.ts +5 -0
  949. package/dist/security/scam-db.js +116 -0
  950. package/dist/security/scam-db.js.map +1 -0
  951. package/dist/security/shield.d.ts +12 -0
  952. package/dist/security/shield.js +80 -0
  953. package/dist/security/shield.js.map +1 -0
  954. package/dist/security/tx-validator.d.ts +5 -0
  955. package/dist/security/tx-validator.js +115 -0
  956. package/dist/security/tx-validator.js.map +1 -0
  957. package/dist/security/types.d.ts +84 -0
  958. package/dist/security/types.js +6 -0
  959. package/dist/security/types.js.map +1 -0
  960. package/dist/services/alt-data/feeds/fear-greed.d.ts +14 -0
  961. package/dist/services/alt-data/feeds/fear-greed.js +81 -0
  962. package/dist/services/alt-data/feeds/fear-greed.js.map +1 -0
  963. package/dist/services/alt-data/feeds/funding-rates.d.ts +13 -0
  964. package/dist/services/alt-data/feeds/funding-rates.js +90 -0
  965. package/dist/services/alt-data/feeds/funding-rates.js.map +1 -0
  966. package/dist/services/alt-data/feeds/reddit.d.ts +13 -0
  967. package/dist/services/alt-data/feeds/reddit.js +112 -0
  968. package/dist/services/alt-data/feeds/reddit.js.map +1 -0
  969. package/dist/services/alt-data/index.d.ts +31 -0
  970. package/dist/services/alt-data/index.js +278 -0
  971. package/dist/services/alt-data/index.js.map +1 -0
  972. package/dist/services/alt-data/market-matcher.d.ts +29 -0
  973. package/dist/services/alt-data/market-matcher.js +157 -0
  974. package/dist/services/alt-data/market-matcher.js.map +1 -0
  975. package/dist/services/alt-data/sentiment.d.ts +11 -0
  976. package/dist/services/alt-data/sentiment.js +277 -0
  977. package/dist/services/alt-data/sentiment.js.map +1 -0
  978. package/dist/services/alt-data/types.d.ts +86 -0
  979. package/dist/services/alt-data/types.js +9 -0
  980. package/dist/services/alt-data/types.js.map +1 -0
  981. package/dist/services/feature-engineering/accessor.d.ts +19 -0
  982. package/dist/services/feature-engineering/accessor.js +31 -0
  983. package/dist/services/feature-engineering/accessor.js.map +1 -0
  984. package/dist/services/feature-engineering/index.d.ts +15 -0
  985. package/dist/services/feature-engineering/index.js +345 -0
  986. package/dist/services/feature-engineering/index.js.map +1 -0
  987. package/dist/services/feature-engineering/indicators.d.ts +90 -0
  988. package/dist/services/feature-engineering/indicators.js +254 -0
  989. package/dist/services/feature-engineering/indicators.js.map +1 -0
  990. package/dist/services/feature-engineering/rolling-window.d.ts +89 -0
  991. package/dist/services/feature-engineering/rolling-window.js +173 -0
  992. package/dist/services/feature-engineering/rolling-window.js.map +1 -0
  993. package/dist/services/feature-engineering/thresholds.d.ts +137 -0
  994. package/dist/services/feature-engineering/thresholds.js +280 -0
  995. package/dist/services/feature-engineering/thresholds.js.map +1 -0
  996. package/dist/services/feature-engineering/types.d.ts +138 -0
  997. package/dist/services/feature-engineering/types.js +6 -0
  998. package/dist/services/feature-engineering/types.js.map +1 -0
  999. package/dist/services/tick-recorder/index.d.ts +12 -0
  1000. package/dist/services/tick-recorder/index.js +200 -0
  1001. package/dist/services/tick-recorder/index.js.map +1 -0
  1002. package/dist/services/tick-recorder/queries.d.ts +46 -0
  1003. package/dist/services/tick-recorder/queries.js +291 -0
  1004. package/dist/services/tick-recorder/queries.js.map +1 -0
  1005. package/dist/services/tick-recorder/schema.d.ts +27 -0
  1006. package/dist/services/tick-recorder/schema.js +185 -0
  1007. package/dist/services/tick-recorder/schema.js.map +1 -0
  1008. package/dist/services/tick-recorder/timescale.d.ts +27 -0
  1009. package/dist/services/tick-recorder/timescale.js +105 -0
  1010. package/dist/services/tick-recorder/timescale.js.map +1 -0
  1011. package/dist/services/tick-recorder/types.d.ts +113 -0
  1012. package/dist/services/tick-recorder/types.js +7 -0
  1013. package/dist/services/tick-recorder/types.js.map +1 -0
  1014. package/dist/services/tick-streamer/index.d.ts +12 -0
  1015. package/dist/services/tick-streamer/index.js +317 -0
  1016. package/dist/services/tick-streamer/index.js.map +1 -0
  1017. package/dist/services/tick-streamer/types.d.ts +134 -0
  1018. package/dist/services/tick-streamer/types.js +6 -0
  1019. package/dist/services/tick-streamer/types.js.map +1 -0
  1020. package/dist/session/index.d.ts +147 -0
  1021. package/dist/session/index.js +429 -0
  1022. package/dist/session/index.js.map +1 -0
  1023. package/dist/sessions/index.d.ts +69 -0
  1024. package/dist/sessions/index.js +447 -0
  1025. package/dist/sessions/index.js.map +1 -0
  1026. package/dist/signal-router/index.d.ts +2 -0
  1027. package/dist/signal-router/index.js +6 -0
  1028. package/dist/signal-router/index.js.map +1 -0
  1029. package/dist/signal-router/router.d.ts +25 -0
  1030. package/dist/signal-router/router.js +391 -0
  1031. package/dist/signal-router/router.js.map +1 -0
  1032. package/dist/signal-router/types.d.ts +64 -0
  1033. package/dist/signal-router/types.js +9 -0
  1034. package/dist/signal-router/types.js.map +1 -0
  1035. package/dist/skills/bundled/acp/index.d.ts +25 -0
  1036. package/dist/skills/bundled/acp/index.js +472 -0
  1037. package/dist/skills/bundled/acp/index.js.map +1 -0
  1038. package/dist/skills/bundled/agentbets/index.d.ts +15 -0
  1039. package/dist/skills/bundled/agentbets/index.js +168 -0
  1040. package/dist/skills/bundled/agentbets/index.js.map +1 -0
  1041. package/dist/skills/bundled/ai-strategy/index.d.ts +21 -0
  1042. package/dist/skills/bundled/ai-strategy/index.js +647 -0
  1043. package/dist/skills/bundled/ai-strategy/index.js.map +1 -0
  1044. package/dist/skills/bundled/alerts/index.d.ts +20 -0
  1045. package/dist/skills/bundled/alerts/index.js +249 -0
  1046. package/dist/skills/bundled/alerts/index.js.map +1 -0
  1047. package/dist/skills/bundled/analytics/index.d.ts +17 -0
  1048. package/dist/skills/bundled/analytics/index.js +112 -0
  1049. package/dist/skills/bundled/analytics/index.js.map +1 -0
  1050. package/dist/skills/bundled/arbitrage/index.d.ts +24 -0
  1051. package/dist/skills/bundled/arbitrage/index.js +253 -0
  1052. package/dist/skills/bundled/arbitrage/index.js.map +1 -0
  1053. package/dist/skills/bundled/auto-reply/index.d.ts +18 -0
  1054. package/dist/skills/bundled/auto-reply/index.js +215 -0
  1055. package/dist/skills/bundled/auto-reply/index.js.map +1 -0
  1056. package/dist/skills/bundled/automation/index.d.ts +19 -0
  1057. package/dist/skills/bundled/automation/index.js +160 -0
  1058. package/dist/skills/bundled/automation/index.js.map +1 -0
  1059. package/dist/skills/bundled/backtest/index.d.ts +18 -0
  1060. package/dist/skills/bundled/backtest/index.js +250 -0
  1061. package/dist/skills/bundled/backtest/index.js.map +1 -0
  1062. package/dist/skills/bundled/bags/index.d.ts +49 -0
  1063. package/dist/skills/bundled/bags/index.js +1069 -0
  1064. package/dist/skills/bundled/bags/index.js.map +1 -0
  1065. package/dist/skills/bundled/bankr/index.d.ts +161 -0
  1066. package/dist/skills/bundled/bankr/index.js +271 -0
  1067. package/dist/skills/bundled/bankr/index.js.map +1 -0
  1068. package/dist/skills/bundled/betfair/index.d.ts +24 -0
  1069. package/dist/skills/bundled/betfair/index.js +511 -0
  1070. package/dist/skills/bundled/betfair/index.js.map +1 -0
  1071. package/dist/skills/bundled/binance-futures/index.d.ts +15 -0
  1072. package/dist/skills/bundled/binance-futures/index.js +485 -0
  1073. package/dist/skills/bundled/binance-futures/index.js.map +1 -0
  1074. package/dist/skills/bundled/botchan/index.d.ts +130 -0
  1075. package/dist/skills/bundled/botchan/index.js +427 -0
  1076. package/dist/skills/bundled/botchan/index.js.map +1 -0
  1077. package/dist/skills/bundled/bridge/index.d.ts +17 -0
  1078. package/dist/skills/bundled/bridge/index.js +297 -0
  1079. package/dist/skills/bundled/bridge/index.js.map +1 -0
  1080. package/dist/skills/bundled/bybit-futures/index.d.ts +15 -0
  1081. package/dist/skills/bundled/bybit-futures/index.js +380 -0
  1082. package/dist/skills/bundled/bybit-futures/index.js.map +1 -0
  1083. package/dist/skills/bundled/clanker/index.d.ts +236 -0
  1084. package/dist/skills/bundled/clanker/index.js +759 -0
  1085. package/dist/skills/bundled/clanker/index.js.map +1 -0
  1086. package/dist/skills/bundled/copy-trading/index.d.ts +20 -0
  1087. package/dist/skills/bundled/copy-trading/index.js +213 -0
  1088. package/dist/skills/bundled/copy-trading/index.js.map +1 -0
  1089. package/dist/skills/bundled/copy-trading-solana/index.d.ts +21 -0
  1090. package/dist/skills/bundled/copy-trading-solana/index.js +421 -0
  1091. package/dist/skills/bundled/copy-trading-solana/index.js.map +1 -0
  1092. package/dist/skills/bundled/credentials/index.d.ts +17 -0
  1093. package/dist/skills/bundled/credentials/index.js +137 -0
  1094. package/dist/skills/bundled/credentials/index.js.map +1 -0
  1095. package/dist/skills/bundled/crypto-hft/index.d.ts +26 -0
  1096. package/dist/skills/bundled/crypto-hft/index.js +361 -0
  1097. package/dist/skills/bundled/crypto-hft/index.js.map +1 -0
  1098. package/dist/skills/bundled/dca/index.d.ts +26 -0
  1099. package/dist/skills/bundled/dca/index.js +1342 -0
  1100. package/dist/skills/bundled/dca/index.js.map +1 -0
  1101. package/dist/skills/bundled/divergence/index.d.ts +19 -0
  1102. package/dist/skills/bundled/divergence/index.js +272 -0
  1103. package/dist/skills/bundled/divergence/index.js.map +1 -0
  1104. package/dist/skills/bundled/doctor/index.d.ts +18 -0
  1105. package/dist/skills/bundled/doctor/index.js +78 -0
  1106. package/dist/skills/bundled/doctor/index.js.map +1 -0
  1107. package/dist/skills/bundled/drift/index.d.ts +13 -0
  1108. package/dist/skills/bundled/drift/index.js +378 -0
  1109. package/dist/skills/bundled/drift/index.js.map +1 -0
  1110. package/dist/skills/bundled/drift-sdk/index.d.ts +17 -0
  1111. package/dist/skills/bundled/drift-sdk/index.js +501 -0
  1112. package/dist/skills/bundled/drift-sdk/index.js.map +1 -0
  1113. package/dist/skills/bundled/edge/index.d.ts +16 -0
  1114. package/dist/skills/bundled/edge/index.js +91 -0
  1115. package/dist/skills/bundled/edge/index.js.map +1 -0
  1116. package/dist/skills/bundled/embeddings/index.d.ts +19 -0
  1117. package/dist/skills/bundled/embeddings/index.js +215 -0
  1118. package/dist/skills/bundled/embeddings/index.js.map +1 -0
  1119. package/dist/skills/bundled/endaoment/index.d.ts +105 -0
  1120. package/dist/skills/bundled/endaoment/index.js +285 -0
  1121. package/dist/skills/bundled/endaoment/index.js.map +1 -0
  1122. package/dist/skills/bundled/ens/index.d.ts +151 -0
  1123. package/dist/skills/bundled/ens/index.js +278 -0
  1124. package/dist/skills/bundled/ens/index.js.map +1 -0
  1125. package/dist/skills/bundled/erc8004/index.d.ts +123 -0
  1126. package/dist/skills/bundled/erc8004/index.js +301 -0
  1127. package/dist/skills/bundled/erc8004/index.js.map +1 -0
  1128. package/dist/skills/bundled/execution/index.d.ts +18 -0
  1129. package/dist/skills/bundled/execution/index.js +358 -0
  1130. package/dist/skills/bundled/execution/index.js.map +1 -0
  1131. package/dist/skills/bundled/farcaster/index.d.ts +121 -0
  1132. package/dist/skills/bundled/farcaster/index.js +314 -0
  1133. package/dist/skills/bundled/farcaster/index.js.map +1 -0
  1134. package/dist/skills/bundled/features/index.d.ts +17 -0
  1135. package/dist/skills/bundled/features/index.js +305 -0
  1136. package/dist/skills/bundled/features/index.js.map +1 -0
  1137. package/dist/skills/bundled/feeds/index.d.ts +26 -0
  1138. package/dist/skills/bundled/feeds/index.js +462 -0
  1139. package/dist/skills/bundled/feeds/index.js.map +1 -0
  1140. package/dist/skills/bundled/harden/index.d.ts +55 -0
  1141. package/dist/skills/bundled/harden/index.js +510 -0
  1142. package/dist/skills/bundled/harden/index.js.map +1 -0
  1143. package/dist/skills/bundled/history/index.d.ts +21 -0
  1144. package/dist/skills/bundled/history/index.js +195 -0
  1145. package/dist/skills/bundled/history/index.js.map +1 -0
  1146. package/dist/skills/bundled/hyperliquid/index.d.ts +19 -0
  1147. package/dist/skills/bundled/hyperliquid/index.js +1280 -0
  1148. package/dist/skills/bundled/hyperliquid/index.js.map +1 -0
  1149. package/dist/skills/bundled/identity/index.d.ts +17 -0
  1150. package/dist/skills/bundled/identity/index.js +223 -0
  1151. package/dist/skills/bundled/identity/index.js.map +1 -0
  1152. package/dist/skills/bundled/integrations/index.d.ts +17 -0
  1153. package/dist/skills/bundled/integrations/index.js +138 -0
  1154. package/dist/skills/bundled/integrations/index.js.map +1 -0
  1155. package/dist/skills/bundled/jupiter/index.d.ts +41 -0
  1156. package/dist/skills/bundled/jupiter/index.js +872 -0
  1157. package/dist/skills/bundled/jupiter/index.js.map +1 -0
  1158. package/dist/skills/bundled/kamino/index.d.ts +33 -0
  1159. package/dist/skills/bundled/kamino/index.js +578 -0
  1160. package/dist/skills/bundled/kamino/index.js.map +1 -0
  1161. package/dist/skills/bundled/ledger/index.d.ts +14 -0
  1162. package/dist/skills/bundled/ledger/index.js +186 -0
  1163. package/dist/skills/bundled/ledger/index.js.map +1 -0
  1164. package/dist/skills/bundled/market-index/index.d.ts +18 -0
  1165. package/dist/skills/bundled/market-index/index.js +182 -0
  1166. package/dist/skills/bundled/market-index/index.js.map +1 -0
  1167. package/dist/skills/bundled/markets/index.d.ts +16 -0
  1168. package/dist/skills/bundled/markets/index.js +95 -0
  1169. package/dist/skills/bundled/markets/index.js.map +1 -0
  1170. package/dist/skills/bundled/mcp/index.d.ts +19 -0
  1171. package/dist/skills/bundled/mcp/index.js +212 -0
  1172. package/dist/skills/bundled/mcp/index.js.map +1 -0
  1173. package/dist/skills/bundled/memory/index.d.ts +20 -0
  1174. package/dist/skills/bundled/memory/index.js +210 -0
  1175. package/dist/skills/bundled/memory/index.js.map +1 -0
  1176. package/dist/skills/bundled/metaculus/index.d.ts +17 -0
  1177. package/dist/skills/bundled/metaculus/index.js +168 -0
  1178. package/dist/skills/bundled/metaculus/index.js.map +1 -0
  1179. package/dist/skills/bundled/meteora/index.d.ts +39 -0
  1180. package/dist/skills/bundled/meteora/index.js +837 -0
  1181. package/dist/skills/bundled/meteora/index.js.map +1 -0
  1182. package/dist/skills/bundled/meteora-dbc/index.d.ts +33 -0
  1183. package/dist/skills/bundled/meteora-dbc/index.js +993 -0
  1184. package/dist/skills/bundled/meteora-dbc/index.js.map +1 -0
  1185. package/dist/skills/bundled/metrics/index.d.ts +18 -0
  1186. package/dist/skills/bundled/metrics/index.js +91 -0
  1187. package/dist/skills/bundled/metrics/index.js.map +1 -0
  1188. package/dist/skills/bundled/mev/index.d.ts +17 -0
  1189. package/dist/skills/bundled/mev/index.js +108 -0
  1190. package/dist/skills/bundled/mev/index.js.map +1 -0
  1191. package/dist/skills/bundled/mexc-futures/index.d.ts +16 -0
  1192. package/dist/skills/bundled/mexc-futures/index.js +389 -0
  1193. package/dist/skills/bundled/mexc-futures/index.js.map +1 -0
  1194. package/dist/skills/bundled/mm/index.d.ts +18 -0
  1195. package/dist/skills/bundled/mm/index.js +315 -0
  1196. package/dist/skills/bundled/mm/index.js.map +1 -0
  1197. package/dist/skills/bundled/monitoring/index.d.ts +18 -0
  1198. package/dist/skills/bundled/monitoring/index.js +146 -0
  1199. package/dist/skills/bundled/monitoring/index.js.map +1 -0
  1200. package/dist/skills/bundled/news/index.d.ts +17 -0
  1201. package/dist/skills/bundled/news/index.js +161 -0
  1202. package/dist/skills/bundled/news/index.js.map +1 -0
  1203. package/dist/skills/bundled/onchainkit/index.d.ts +92 -0
  1204. package/dist/skills/bundled/onchainkit/index.js +429 -0
  1205. package/dist/skills/bundled/onchainkit/index.js.map +1 -0
  1206. package/dist/skills/bundled/opinion/index.d.ts +12 -0
  1207. package/dist/skills/bundled/opinion/index.js +429 -0
  1208. package/dist/skills/bundled/opinion/index.js.map +1 -0
  1209. package/dist/skills/bundled/opportunity/index.d.ts +25 -0
  1210. package/dist/skills/bundled/opportunity/index.js +289 -0
  1211. package/dist/skills/bundled/opportunity/index.js.map +1 -0
  1212. package/dist/skills/bundled/orca/index.d.ts +12 -0
  1213. package/dist/skills/bundled/orca/index.js +663 -0
  1214. package/dist/skills/bundled/orca/index.js.map +1 -0
  1215. package/dist/skills/bundled/pairing/index.d.ts +24 -0
  1216. package/dist/skills/bundled/pairing/index.js +228 -0
  1217. package/dist/skills/bundled/pairing/index.js.map +1 -0
  1218. package/dist/skills/bundled/percolator/index.d.ts +20 -0
  1219. package/dist/skills/bundled/percolator/index.js +229 -0
  1220. package/dist/skills/bundled/percolator/index.js.map +1 -0
  1221. package/dist/skills/bundled/permissions/index.d.ts +21 -0
  1222. package/dist/skills/bundled/permissions/index.js +204 -0
  1223. package/dist/skills/bundled/permissions/index.js.map +1 -0
  1224. package/dist/skills/bundled/plugins/index.d.ts +20 -0
  1225. package/dist/skills/bundled/plugins/index.js +209 -0
  1226. package/dist/skills/bundled/plugins/index.js.map +1 -0
  1227. package/dist/skills/bundled/portfolio/index.d.ts +20 -0
  1228. package/dist/skills/bundled/portfolio/index.js +367 -0
  1229. package/dist/skills/bundled/portfolio/index.js.map +1 -0
  1230. package/dist/skills/bundled/portfolio-sync/index.d.ts +17 -0
  1231. package/dist/skills/bundled/portfolio-sync/index.js +116 -0
  1232. package/dist/skills/bundled/portfolio-sync/index.js.map +1 -0
  1233. package/dist/skills/bundled/positions/index.d.ts +18 -0
  1234. package/dist/skills/bundled/positions/index.js +161 -0
  1235. package/dist/skills/bundled/positions/index.js.map +1 -0
  1236. package/dist/skills/bundled/predictfun/index.d.ts +13 -0
  1237. package/dist/skills/bundled/predictfun/index.js +612 -0
  1238. package/dist/skills/bundled/predictfun/index.js.map +1 -0
  1239. package/dist/skills/bundled/predictit/index.d.ts +16 -0
  1240. package/dist/skills/bundled/predictit/index.js +138 -0
  1241. package/dist/skills/bundled/predictit/index.js.map +1 -0
  1242. package/dist/skills/bundled/presence/index.d.ts +18 -0
  1243. package/dist/skills/bundled/presence/index.js +151 -0
  1244. package/dist/skills/bundled/presence/index.js.map +1 -0
  1245. package/dist/skills/bundled/processes/index.d.ts +17 -0
  1246. package/dist/skills/bundled/processes/index.js +121 -0
  1247. package/dist/skills/bundled/processes/index.js.map +1 -0
  1248. package/dist/skills/bundled/pump-swarm/index.d.ts +16 -0
  1249. package/dist/skills/bundled/pump-swarm/index.js +2235 -0
  1250. package/dist/skills/bundled/pump-swarm/index.js.map +1 -0
  1251. package/dist/skills/bundled/pumpfun/index.d.ts +47 -0
  1252. package/dist/skills/bundled/pumpfun/index.js +1400 -0
  1253. package/dist/skills/bundled/pumpfun/index.js.map +1 -0
  1254. package/dist/skills/bundled/qmd/index.d.ts +18 -0
  1255. package/dist/skills/bundled/qmd/index.js +116 -0
  1256. package/dist/skills/bundled/qmd/index.js.map +1 -0
  1257. package/dist/skills/bundled/qrcoin/index.d.ts +92 -0
  1258. package/dist/skills/bundled/qrcoin/index.js +328 -0
  1259. package/dist/skills/bundled/qrcoin/index.js.map +1 -0
  1260. package/dist/skills/bundled/raydium/index.d.ts +35 -0
  1261. package/dist/skills/bundled/raydium/index.js +695 -0
  1262. package/dist/skills/bundled/raydium/index.js.map +1 -0
  1263. package/dist/skills/bundled/remote/index.d.ts +19 -0
  1264. package/dist/skills/bundled/remote/index.js +186 -0
  1265. package/dist/skills/bundled/remote/index.js.map +1 -0
  1266. package/dist/skills/bundled/research/index.d.ts +17 -0
  1267. package/dist/skills/bundled/research/index.js +185 -0
  1268. package/dist/skills/bundled/research/index.js.map +1 -0
  1269. package/dist/skills/bundled/risk/index.d.ts +31 -0
  1270. package/dist/skills/bundled/risk/index.js +379 -0
  1271. package/dist/skills/bundled/risk/index.js.map +1 -0
  1272. package/dist/skills/bundled/router/index.d.ts +17 -0
  1273. package/dist/skills/bundled/router/index.js +160 -0
  1274. package/dist/skills/bundled/router/index.js.map +1 -0
  1275. package/dist/skills/bundled/routing/index.d.ts +23 -0
  1276. package/dist/skills/bundled/routing/index.js +257 -0
  1277. package/dist/skills/bundled/routing/index.js.map +1 -0
  1278. package/dist/skills/bundled/sandbox/index.d.ts +18 -0
  1279. package/dist/skills/bundled/sandbox/index.js +119 -0
  1280. package/dist/skills/bundled/sandbox/index.js.map +1 -0
  1281. package/dist/skills/bundled/search-config/index.d.ts +18 -0
  1282. package/dist/skills/bundled/search-config/index.js +170 -0
  1283. package/dist/skills/bundled/search-config/index.js.map +1 -0
  1284. package/dist/skills/bundled/sessions/index.d.ts +29 -0
  1285. package/dist/skills/bundled/sessions/index.js +193 -0
  1286. package/dist/skills/bundled/sessions/index.js.map +1 -0
  1287. package/dist/skills/bundled/shield/index.d.ts +22 -0
  1288. package/dist/skills/bundled/shield/index.js +245 -0
  1289. package/dist/skills/bundled/shield/index.js.map +1 -0
  1290. package/dist/skills/bundled/signals/index.d.ts +24 -0
  1291. package/dist/skills/bundled/signals/index.js +776 -0
  1292. package/dist/skills/bundled/signals/index.js.map +1 -0
  1293. package/dist/skills/bundled/sizing/index.d.ts +16 -0
  1294. package/dist/skills/bundled/sizing/index.js +168 -0
  1295. package/dist/skills/bundled/sizing/index.js.map +1 -0
  1296. package/dist/skills/bundled/slippage/index.d.ts +16 -0
  1297. package/dist/skills/bundled/slippage/index.js +111 -0
  1298. package/dist/skills/bundled/slippage/index.js.map +1 -0
  1299. package/dist/skills/bundled/smarkets/index.d.ts +23 -0
  1300. package/dist/skills/bundled/smarkets/index.js +473 -0
  1301. package/dist/skills/bundled/smarkets/index.js.map +1 -0
  1302. package/dist/skills/bundled/strategy/index.d.ts +18 -0
  1303. package/dist/skills/bundled/strategy/index.js +168 -0
  1304. package/dist/skills/bundled/strategy/index.js.map +1 -0
  1305. package/dist/skills/bundled/streaming/index.d.ts +19 -0
  1306. package/dist/skills/bundled/streaming/index.js +147 -0
  1307. package/dist/skills/bundled/streaming/index.js.map +1 -0
  1308. package/dist/skills/bundled/tailscale/index.d.ts +18 -0
  1309. package/dist/skills/bundled/tailscale/index.js +173 -0
  1310. package/dist/skills/bundled/tailscale/index.js.map +1 -0
  1311. package/dist/skills/bundled/ticks/index.d.ts +17 -0
  1312. package/dist/skills/bundled/ticks/index.js +287 -0
  1313. package/dist/skills/bundled/ticks/index.js.map +1 -0
  1314. package/dist/skills/bundled/token-security/index.d.ts +19 -0
  1315. package/dist/skills/bundled/token-security/index.js +138 -0
  1316. package/dist/skills/bundled/token-security/index.js.map +1 -0
  1317. package/dist/skills/bundled/trading-evm/index.d.ts +19 -0
  1318. package/dist/skills/bundled/trading-evm/index.js +302 -0
  1319. package/dist/skills/bundled/trading-evm/index.js.map +1 -0
  1320. package/dist/skills/bundled/trading-futures/index.d.ts +14 -0
  1321. package/dist/skills/bundled/trading-futures/index.js +874 -0
  1322. package/dist/skills/bundled/trading-futures/index.js.map +1 -0
  1323. package/dist/skills/bundled/trading-kalshi/index.d.ts +36 -0
  1324. package/dist/skills/bundled/trading-kalshi/index.js +1199 -0
  1325. package/dist/skills/bundled/trading-kalshi/index.js.map +1 -0
  1326. package/dist/skills/bundled/trading-manifold/index.d.ts +23 -0
  1327. package/dist/skills/bundled/trading-manifold/index.js +391 -0
  1328. package/dist/skills/bundled/trading-manifold/index.js.map +1 -0
  1329. package/dist/skills/bundled/trading-polymarket/index.d.ts +27 -0
  1330. package/dist/skills/bundled/trading-polymarket/index.js +1321 -0
  1331. package/dist/skills/bundled/trading-polymarket/index.js.map +1 -0
  1332. package/dist/skills/bundled/trading-solana/index.d.ts +19 -0
  1333. package/dist/skills/bundled/trading-solana/index.js +383 -0
  1334. package/dist/skills/bundled/trading-solana/index.js.map +1 -0
  1335. package/dist/skills/bundled/trading-system/index.d.ts +22 -0
  1336. package/dist/skills/bundled/trading-system/index.js +355 -0
  1337. package/dist/skills/bundled/trading-system/index.js.map +1 -0
  1338. package/dist/skills/bundled/triggers/index.d.ts +18 -0
  1339. package/dist/skills/bundled/triggers/index.js +172 -0
  1340. package/dist/skills/bundled/triggers/index.js.map +1 -0
  1341. package/dist/skills/bundled/tts/index.d.ts +16 -0
  1342. package/dist/skills/bundled/tts/index.js +150 -0
  1343. package/dist/skills/bundled/tts/index.js.map +1 -0
  1344. package/dist/skills/bundled/tweet-ideas/index.d.ts +20 -0
  1345. package/dist/skills/bundled/tweet-ideas/index.js +470 -0
  1346. package/dist/skills/bundled/tweet-ideas/index.js.map +1 -0
  1347. package/dist/skills/bundled/usage/index.d.ts +17 -0
  1348. package/dist/skills/bundled/usage/index.js +145 -0
  1349. package/dist/skills/bundled/usage/index.js.map +1 -0
  1350. package/dist/skills/bundled/veil/index.d.ts +79 -0
  1351. package/dist/skills/bundled/veil/index.js +322 -0
  1352. package/dist/skills/bundled/veil/index.js.map +1 -0
  1353. package/dist/skills/bundled/verify/index.d.ts +20 -0
  1354. package/dist/skills/bundled/verify/index.js +157 -0
  1355. package/dist/skills/bundled/verify/index.js.map +1 -0
  1356. package/dist/skills/bundled/virtuals/index.d.ts +20 -0
  1357. package/dist/skills/bundled/virtuals/index.js +255 -0
  1358. package/dist/skills/bundled/virtuals/index.js.map +1 -0
  1359. package/dist/skills/bundled/voice/index.d.ts +18 -0
  1360. package/dist/skills/bundled/voice/index.js +190 -0
  1361. package/dist/skills/bundled/voice/index.js.map +1 -0
  1362. package/dist/skills/bundled/weather/index.d.ts +20 -0
  1363. package/dist/skills/bundled/weather/index.js +475 -0
  1364. package/dist/skills/bundled/weather/index.js.map +1 -0
  1365. package/dist/skills/bundled/webhooks/index.d.ts +18 -0
  1366. package/dist/skills/bundled/webhooks/index.js +136 -0
  1367. package/dist/skills/bundled/webhooks/index.js.map +1 -0
  1368. package/dist/skills/bundled/whale-tracking/index.d.ts +18 -0
  1369. package/dist/skills/bundled/whale-tracking/index.js +441 -0
  1370. package/dist/skills/bundled/whale-tracking/index.js.map +1 -0
  1371. package/dist/skills/bundled/yoink/index.d.ts +78 -0
  1372. package/dist/skills/bundled/yoink/index.js +236 -0
  1373. package/dist/skills/bundled/yoink/index.js.map +1 -0
  1374. package/dist/skills/executor.d.ts +117 -0
  1375. package/dist/skills/executor.js +469 -0
  1376. package/dist/skills/executor.js.map +1 -0
  1377. package/dist/skills/frontmatter.d.ts +69 -0
  1378. package/dist/skills/frontmatter.js +187 -0
  1379. package/dist/skills/frontmatter.js.map +1 -0
  1380. package/dist/skills/index.d.ts +150 -0
  1381. package/dist/skills/index.js +531 -0
  1382. package/dist/skills/index.js.map +1 -0
  1383. package/dist/skills/loader.d.ts +48 -0
  1384. package/dist/skills/loader.js +594 -0
  1385. package/dist/skills/loader.js.map +1 -0
  1386. package/dist/skills/registry.d.ts +94 -0
  1387. package/dist/skills/registry.js +308 -0
  1388. package/dist/skills/registry.js.map +1 -0
  1389. package/dist/solana/copytrade.d.ts +116 -0
  1390. package/dist/solana/copytrade.js +493 -0
  1391. package/dist/solana/copytrade.js.map +1 -0
  1392. package/dist/solana/drift.d.ts +154 -0
  1393. package/dist/solana/drift.js +599 -0
  1394. package/dist/solana/drift.js.map +1 -0
  1395. package/dist/solana/jupiter.d.ts +283 -0
  1396. package/dist/solana/jupiter.js +553 -0
  1397. package/dist/solana/jupiter.js.map +1 -0
  1398. package/dist/solana/kamino.d.ts +206 -0
  1399. package/dist/solana/kamino.js +546 -0
  1400. package/dist/solana/kamino.js.map +1 -0
  1401. package/dist/solana/meteora-dbc.d.ts +430 -0
  1402. package/dist/solana/meteora-dbc.js +1105 -0
  1403. package/dist/solana/meteora-dbc.js.map +1 -0
  1404. package/dist/solana/meteora.d.ts +232 -0
  1405. package/dist/solana/meteora.js +682 -0
  1406. package/dist/solana/meteora.js.map +1 -0
  1407. package/dist/solana/orca.d.ts +163 -0
  1408. package/dist/solana/orca.js +378 -0
  1409. package/dist/solana/orca.js.map +1 -0
  1410. package/dist/solana/pools.d.ts +26 -0
  1411. package/dist/solana/pools.js +96 -0
  1412. package/dist/solana/pools.js.map +1 -0
  1413. package/dist/solana/pump-swarm.d.ts +349 -0
  1414. package/dist/solana/pump-swarm.js +1663 -0
  1415. package/dist/solana/pump-swarm.js.map +1 -0
  1416. package/dist/solana/pumpapi.d.ts +196 -0
  1417. package/dist/solana/pumpapi.js +462 -0
  1418. package/dist/solana/pumpapi.js.map +1 -0
  1419. package/dist/solana/raydium.d.ts +170 -0
  1420. package/dist/solana/raydium.js +673 -0
  1421. package/dist/solana/raydium.js.map +1 -0
  1422. package/dist/solana/swarm-ai-builder.d.ts +97 -0
  1423. package/dist/solana/swarm-ai-builder.js +571 -0
  1424. package/dist/solana/swarm-ai-builder.js.map +1 -0
  1425. package/dist/solana/swarm-arbitrage.d.ts +111 -0
  1426. package/dist/solana/swarm-arbitrage.js +437 -0
  1427. package/dist/solana/swarm-arbitrage.js.map +1 -0
  1428. package/dist/solana/swarm-builders.d.ts +71 -0
  1429. package/dist/solana/swarm-builders.js +402 -0
  1430. package/dist/solana/swarm-builders.js.map +1 -0
  1431. package/dist/solana/swarm-copytrade.d.ts +103 -0
  1432. package/dist/solana/swarm-copytrade.js +420 -0
  1433. package/dist/solana/swarm-copytrade.js.map +1 -0
  1434. package/dist/solana/swarm-presets.d.ts +49 -0
  1435. package/dist/solana/swarm-presets.js +282 -0
  1436. package/dist/solana/swarm-presets.js.map +1 -0
  1437. package/dist/solana/swarm-signals.d.ts +128 -0
  1438. package/dist/solana/swarm-signals.js +529 -0
  1439. package/dist/solana/swarm-signals.js.map +1 -0
  1440. package/dist/solana/swarm-strategies.d.ts +230 -0
  1441. package/dist/solana/swarm-strategies.js +611 -0
  1442. package/dist/solana/swarm-strategies.js.map +1 -0
  1443. package/dist/solana/tokenlist.d.ts +10 -0
  1444. package/dist/solana/tokenlist.js +54 -0
  1445. package/dist/solana/tokenlist.js.map +1 -0
  1446. package/dist/solana/wallet.d.ts +12 -0
  1447. package/dist/solana/wallet.js +90 -0
  1448. package/dist/solana/wallet.js.map +1 -0
  1449. package/dist/strategies/crypto-hft/index.d.ts +46 -0
  1450. package/dist/strategies/crypto-hft/index.js +469 -0
  1451. package/dist/strategies/crypto-hft/index.js.map +1 -0
  1452. package/dist/strategies/crypto-hft/market-scanner.d.ts +26 -0
  1453. package/dist/strategies/crypto-hft/market-scanner.js +177 -0
  1454. package/dist/strategies/crypto-hft/market-scanner.js.map +1 -0
  1455. package/dist/strategies/crypto-hft/orderbook.d.ts +37 -0
  1456. package/dist/strategies/crypto-hft/orderbook.js +184 -0
  1457. package/dist/strategies/crypto-hft/orderbook.js.map +1 -0
  1458. package/dist/strategies/crypto-hft/positions.d.ts +49 -0
  1459. package/dist/strategies/crypto-hft/positions.js +376 -0
  1460. package/dist/strategies/crypto-hft/positions.js.map +1 -0
  1461. package/dist/strategies/crypto-hft/presets.d.ts +11 -0
  1462. package/dist/strategies/crypto-hft/presets.js +164 -0
  1463. package/dist/strategies/crypto-hft/presets.js.map +1 -0
  1464. package/dist/strategies/crypto-hft/strategies.d.ts +96 -0
  1465. package/dist/strategies/crypto-hft/strategies.js +330 -0
  1466. package/dist/strategies/crypto-hft/strategies.js.map +1 -0
  1467. package/dist/strategies/crypto-hft/types.d.ts +196 -0
  1468. package/dist/strategies/crypto-hft/types.js +32 -0
  1469. package/dist/strategies/crypto-hft/types.js.map +1 -0
  1470. package/dist/strategies/hft-divergence/detector.d.ts +29 -0
  1471. package/dist/strategies/hft-divergence/detector.js +182 -0
  1472. package/dist/strategies/hft-divergence/detector.js.map +1 -0
  1473. package/dist/strategies/hft-divergence/index.d.ts +12 -0
  1474. package/dist/strategies/hft-divergence/index.js +19 -0
  1475. package/dist/strategies/hft-divergence/index.js.map +1 -0
  1476. package/dist/strategies/hft-divergence/market-rotator.d.ts +17 -0
  1477. package/dist/strategies/hft-divergence/market-rotator.js +128 -0
  1478. package/dist/strategies/hft-divergence/market-rotator.js.map +1 -0
  1479. package/dist/strategies/hft-divergence/position-manager.d.ts +35 -0
  1480. package/dist/strategies/hft-divergence/position-manager.js +188 -0
  1481. package/dist/strategies/hft-divergence/position-manager.js.map +1 -0
  1482. package/dist/strategies/hft-divergence/strategy.d.ts +31 -0
  1483. package/dist/strategies/hft-divergence/strategy.js +295 -0
  1484. package/dist/strategies/hft-divergence/strategy.js.map +1 -0
  1485. package/dist/strategies/hft-divergence/types.d.ts +114 -0
  1486. package/dist/strategies/hft-divergence/types.js +10 -0
  1487. package/dist/strategies/hft-divergence/types.js.map +1 -0
  1488. package/dist/streaming/index.d.ts +70 -0
  1489. package/dist/streaming/index.js +296 -0
  1490. package/dist/streaming/index.js.map +1 -0
  1491. package/dist/tailscale/index.d.ts +139 -0
  1492. package/dist/tailscale/index.js +345 -0
  1493. package/dist/tailscale/index.js.map +1 -0
  1494. package/dist/telemetry/index.d.ts +143 -0
  1495. package/dist/telemetry/index.js +535 -0
  1496. package/dist/telemetry/index.js.map +1 -0
  1497. package/dist/terminal/index.d.ts +121 -0
  1498. package/dist/terminal/index.js +548 -0
  1499. package/dist/terminal/index.js.map +1 -0
  1500. package/dist/token-security/index.d.ts +36 -0
  1501. package/dist/token-security/index.js +253 -0
  1502. package/dist/token-security/index.js.map +1 -0
  1503. package/dist/tools/browser.d.ts +128 -0
  1504. package/dist/tools/browser.js +459 -0
  1505. package/dist/tools/browser.js.map +1 -0
  1506. package/dist/tools/canvas.d.ts +93 -0
  1507. package/dist/tools/canvas.js +349 -0
  1508. package/dist/tools/canvas.js.map +1 -0
  1509. package/dist/tools/docker.d.ts +59 -0
  1510. package/dist/tools/docker.js +191 -0
  1511. package/dist/tools/docker.js.map +1 -0
  1512. package/dist/tools/email.d.ts +25 -0
  1513. package/dist/tools/email.js +131 -0
  1514. package/dist/tools/email.js.map +1 -0
  1515. package/dist/tools/exec.d.ts +81 -0
  1516. package/dist/tools/exec.js +373 -0
  1517. package/dist/tools/exec.js.map +1 -0
  1518. package/dist/tools/files.d.ts +46 -0
  1519. package/dist/tools/files.js +185 -0
  1520. package/dist/tools/files.js.map +1 -0
  1521. package/dist/tools/git.d.ts +29 -0
  1522. package/dist/tools/git.js +105 -0
  1523. package/dist/tools/git.js.map +1 -0
  1524. package/dist/tools/image.d.ts +57 -0
  1525. package/dist/tools/image.js +308 -0
  1526. package/dist/tools/image.js.map +1 -0
  1527. package/dist/tools/index.d.ts +39 -0
  1528. package/dist/tools/index.js +46 -0
  1529. package/dist/tools/index.js.map +1 -0
  1530. package/dist/tools/message.d.ts +99 -0
  1531. package/dist/tools/message.js +200 -0
  1532. package/dist/tools/message.js.map +1 -0
  1533. package/dist/tools/nodes.d.ts +134 -0
  1534. package/dist/tools/nodes.js +357 -0
  1535. package/dist/tools/nodes.js.map +1 -0
  1536. package/dist/tools/sessions.d.ts +60 -0
  1537. package/dist/tools/sessions.js +119 -0
  1538. package/dist/tools/sessions.js.map +1 -0
  1539. package/dist/tools/shell-history.d.ts +17 -0
  1540. package/dist/tools/shell-history.js +118 -0
  1541. package/dist/tools/shell-history.js.map +1 -0
  1542. package/dist/tools/sms.d.ts +18 -0
  1543. package/dist/tools/sms.js +66 -0
  1544. package/dist/tools/sms.js.map +1 -0
  1545. package/dist/tools/sql.d.ts +19 -0
  1546. package/dist/tools/sql.js +91 -0
  1547. package/dist/tools/sql.js.map +1 -0
  1548. package/dist/tools/transcription.d.ts +13 -0
  1549. package/dist/tools/transcription.js +99 -0
  1550. package/dist/tools/transcription.js.map +1 -0
  1551. package/dist/tools/web-fetch.d.ts +69 -0
  1552. package/dist/tools/web-fetch.js +251 -0
  1553. package/dist/tools/web-fetch.js.map +1 -0
  1554. package/dist/tools/web-search.d.ts +58 -0
  1555. package/dist/tools/web-search.js +204 -0
  1556. package/dist/tools/web-search.js.map +1 -0
  1557. package/dist/tools/webhooks.d.ts +74 -0
  1558. package/dist/tools/webhooks.js +165 -0
  1559. package/dist/tools/webhooks.js.map +1 -0
  1560. package/dist/trading/accounts.d.ts +167 -0
  1561. package/dist/trading/accounts.js +394 -0
  1562. package/dist/trading/accounts.js.map +1 -0
  1563. package/dist/trading/adapters/index.d.ts +27 -0
  1564. package/dist/trading/adapters/index.js +165 -0
  1565. package/dist/trading/adapters/index.js.map +1 -0
  1566. package/dist/trading/backtest.d.ts +161 -0
  1567. package/dist/trading/backtest.js +665 -0
  1568. package/dist/trading/backtest.js.map +1 -0
  1569. package/dist/trading/bots/index.d.ts +196 -0
  1570. package/dist/trading/bots/index.js +688 -0
  1571. package/dist/trading/bots/index.js.map +1 -0
  1572. package/dist/trading/bridge.d.ts +33 -0
  1573. package/dist/trading/bridge.js +121 -0
  1574. package/dist/trading/bridge.js.map +1 -0
  1575. package/dist/trading/builder.d.ts +102 -0
  1576. package/dist/trading/builder.js +430 -0
  1577. package/dist/trading/builder.js.map +1 -0
  1578. package/dist/trading/copy-trading.d.ts +125 -0
  1579. package/dist/trading/copy-trading.js +611 -0
  1580. package/dist/trading/copy-trading.js.map +1 -0
  1581. package/dist/trading/devtools.d.ts +172 -0
  1582. package/dist/trading/devtools.js +425 -0
  1583. package/dist/trading/devtools.js.map +1 -0
  1584. package/dist/trading/futures/index.d.ts +981 -0
  1585. package/dist/trading/futures/index.js +4011 -0
  1586. package/dist/trading/futures/index.js.map +1 -0
  1587. package/dist/trading/index.d.ts +102 -0
  1588. package/dist/trading/index.js +310 -0
  1589. package/dist/trading/index.js.map +1 -0
  1590. package/dist/trading/kelly.d.ts +137 -0
  1591. package/dist/trading/kelly.js +328 -0
  1592. package/dist/trading/kelly.js.map +1 -0
  1593. package/dist/trading/logger.d.ts +163 -0
  1594. package/dist/trading/logger.js +424 -0
  1595. package/dist/trading/logger.js.map +1 -0
  1596. package/dist/trading/market-making/engine.d.ts +44 -0
  1597. package/dist/trading/market-making/engine.js +165 -0
  1598. package/dist/trading/market-making/engine.js.map +1 -0
  1599. package/dist/trading/market-making/index.d.ts +10 -0
  1600. package/dist/trading/market-making/index.js +29 -0
  1601. package/dist/trading/market-making/index.js.map +1 -0
  1602. package/dist/trading/market-making/strategy.d.ts +25 -0
  1603. package/dist/trading/market-making/strategy.js +250 -0
  1604. package/dist/trading/market-making/strategy.js.map +1 -0
  1605. package/dist/trading/market-making/types.d.ts +92 -0
  1606. package/dist/trading/market-making/types.js +6 -0
  1607. package/dist/trading/market-making/types.js.map +1 -0
  1608. package/dist/trading/ml-signals.d.ts +175 -0
  1609. package/dist/trading/ml-signals.js +548 -0
  1610. package/dist/trading/ml-signals.js.map +1 -0
  1611. package/dist/trading/orchestrator.d.ts +59 -0
  1612. package/dist/trading/orchestrator.js +199 -0
  1613. package/dist/trading/orchestrator.js.map +1 -0
  1614. package/dist/trading/position-bridge.d.ts +41 -0
  1615. package/dist/trading/position-bridge.js +178 -0
  1616. package/dist/trading/position-bridge.js.map +1 -0
  1617. package/dist/trading/resilience.d.ts +81 -0
  1618. package/dist/trading/resilience.js +257 -0
  1619. package/dist/trading/resilience.js.map +1 -0
  1620. package/dist/trading/risk.d.ts +18 -0
  1621. package/dist/trading/risk.js +91 -0
  1622. package/dist/trading/risk.js.map +1 -0
  1623. package/dist/trading/safety.d.ts +114 -0
  1624. package/dist/trading/safety.js +372 -0
  1625. package/dist/trading/safety.js.map +1 -0
  1626. package/dist/trading/secrets.d.ts +48 -0
  1627. package/dist/trading/secrets.js +243 -0
  1628. package/dist/trading/secrets.js.map +1 -0
  1629. package/dist/trading/state.d.ts +88 -0
  1630. package/dist/trading/state.js +221 -0
  1631. package/dist/trading/state.js.map +1 -0
  1632. package/dist/trading/stream.d.ts +121 -0
  1633. package/dist/trading/stream.js +396 -0
  1634. package/dist/trading/stream.js.map +1 -0
  1635. package/dist/trading/tracking.d.ts +136 -0
  1636. package/dist/trading/tracking.js +512 -0
  1637. package/dist/trading/tracking.js.map +1 -0
  1638. package/dist/tts/index.d.ts +28 -0
  1639. package/dist/tts/index.js +64 -0
  1640. package/dist/tts/index.js.map +1 -0
  1641. package/dist/tui/index.d.ts +159 -0
  1642. package/dist/tui/index.js +580 -0
  1643. package/dist/tui/index.js.map +1 -0
  1644. package/dist/types.d.ts +1373 -0
  1645. package/dist/types.js +7 -0
  1646. package/dist/types.js.map +1 -0
  1647. package/dist/usage/index.d.ts +57 -0
  1648. package/dist/usage/index.js +191 -0
  1649. package/dist/usage/index.js.map +1 -0
  1650. package/dist/utils/attachments.d.ts +12 -0
  1651. package/dist/utils/attachments.js +104 -0
  1652. package/dist/utils/attachments.js.map +1 -0
  1653. package/dist/utils/config.d.ts +14 -0
  1654. package/dist/utils/config.js +474 -0
  1655. package/dist/utils/config.js.map +1 -0
  1656. package/dist/utils/http.d.ts +22 -0
  1657. package/dist/utils/http.js +191 -0
  1658. package/dist/utils/http.js.map +1 -0
  1659. package/dist/utils/id.d.ts +21 -0
  1660. package/dist/utils/id.js +41 -0
  1661. package/dist/utils/id.js.map +1 -0
  1662. package/dist/utils/json-utils.d.ts +201 -0
  1663. package/dist/utils/json-utils.js +151 -0
  1664. package/dist/utils/json-utils.js.map +1 -0
  1665. package/dist/utils/kalshi-auth.d.ts +10 -0
  1666. package/dist/utils/kalshi-auth.js +48 -0
  1667. package/dist/utils/kalshi-auth.js.map +1 -0
  1668. package/dist/utils/kelly.d.ts +153 -0
  1669. package/dist/utils/kelly.js +322 -0
  1670. package/dist/utils/kelly.js.map +1 -0
  1671. package/dist/utils/logger.d.ts +7 -0
  1672. package/dist/utils/logger.js +26 -0
  1673. package/dist/utils/logger.js.map +1 -0
  1674. package/dist/utils/opinion-auth.d.ts +17 -0
  1675. package/dist/utils/opinion-auth.js +25 -0
  1676. package/dist/utils/opinion-auth.js.map +1 -0
  1677. package/dist/utils/polymarket-auth.d.ts +11 -0
  1678. package/dist/utils/polymarket-auth.js +32 -0
  1679. package/dist/utils/polymarket-auth.js.map +1 -0
  1680. package/dist/utils/polymarket-order-signer.d.ts +118 -0
  1681. package/dist/utils/polymarket-order-signer.js +329 -0
  1682. package/dist/utils/polymarket-order-signer.js.map +1 -0
  1683. package/dist/utils/polymarket-setup.d.ts +70 -0
  1684. package/dist/utils/polymarket-setup.js +288 -0
  1685. package/dist/utils/polymarket-setup.js.map +1 -0
  1686. package/dist/utils/production.d.ts +112 -0
  1687. package/dist/utils/production.js +294 -0
  1688. package/dist/utils/production.js.map +1 -0
  1689. package/dist/utils/rate-limiter.d.ts +77 -0
  1690. package/dist/utils/rate-limiter.js +271 -0
  1691. package/dist/utils/rate-limiter.js.map +1 -0
  1692. package/dist/utils/webhook-security.d.ts +63 -0
  1693. package/dist/utils/webhook-security.js +183 -0
  1694. package/dist/utils/webhook-security.js.map +1 -0
  1695. package/dist/voice/index.d.ts +125 -0
  1696. package/dist/voice/index.js +557 -0
  1697. package/dist/voice/index.js.map +1 -0
  1698. package/dist/weather/edge.d.ts +70 -0
  1699. package/dist/weather/edge.js +281 -0
  1700. package/dist/weather/edge.js.map +1 -0
  1701. package/dist/weather/index.d.ts +6 -0
  1702. package/dist/weather/index.js +23 -0
  1703. package/dist/weather/index.js.map +1 -0
  1704. package/dist/weather/markets.d.ts +84 -0
  1705. package/dist/weather/markets.js +320 -0
  1706. package/dist/weather/markets.js.map +1 -0
  1707. package/dist/weather/noaa.d.ts +113 -0
  1708. package/dist/weather/noaa.js +287 -0
  1709. package/dist/weather/noaa.js.map +1 -0
  1710. package/dist/web/index.d.ts +112 -0
  1711. package/dist/web/index.js +639 -0
  1712. package/dist/web/index.js.map +1 -0
  1713. package/dist/wizard/index.d.ts +27 -0
  1714. package/dist/wizard/index.js +186 -0
  1715. package/dist/wizard/index.js.map +1 -0
  1716. package/dist/workspace/index.d.ts +73 -0
  1717. package/dist/workspace/index.js +403 -0
  1718. package/dist/workspace/index.js.map +1 -0
  1719. package/package.json +168 -0
@@ -0,0 +1,1283 @@
1
+ "use strict";
2
+ /**
3
+ * Cron Service - Clawdbot-style scheduled tasks
4
+ *
5
+ * Features:
6
+ * - One-shot and recurring jobs
7
+ * - Cron expressions
8
+ * - Agent wakeups
9
+ * - Alert checking
10
+ * - Market monitoring
11
+ */
12
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ var desc = Object.getOwnPropertyDescriptor(m, k);
15
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
16
+ desc = { enumerable: true, get: function() { return m[k]; } };
17
+ }
18
+ Object.defineProperty(o, k2, desc);
19
+ }) : (function(o, m, k, k2) {
20
+ if (k2 === undefined) k2 = k;
21
+ o[k2] = m[k];
22
+ }));
23
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
24
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
25
+ }) : function(o, v) {
26
+ o["default"] = v;
27
+ });
28
+ var __importStar = (this && this.__importStar) || (function () {
29
+ var ownKeys = function(o) {
30
+ ownKeys = Object.getOwnPropertyNames || function (o) {
31
+ var ar = [];
32
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
33
+ return ar;
34
+ };
35
+ return ownKeys(o);
36
+ };
37
+ return function (mod) {
38
+ if (mod && mod.__esModule) return mod;
39
+ var result = {};
40
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
41
+ __setModuleDefault(result, mod);
42
+ return result;
43
+ };
44
+ })();
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.createCronService = createCronService;
47
+ exports.createCronManager = createCronManager;
48
+ const eventemitter3_1 = require("eventemitter3");
49
+ const crypto_1 = require("crypto");
50
+ const id_1 = require("../utils/id");
51
+ const child_process_1 = require("child_process");
52
+ const path_1 = require("path");
53
+ const kalshi_auth_1 = require("../utils/kalshi-auth");
54
+ const logger_1 = require("../utils/logger");
55
+ // =============================================================================
56
+ // HELPERS
57
+ // =============================================================================
58
+ /** Parse simple cron expression to next run time */
59
+ function getNextCronTime(expr, _tz) {
60
+ // Simple cron parser - supports: minute hour dayOfMonth month dayOfWeek
61
+ // Format: "0 9 * * *" = 9 AM daily
62
+ const parts = expr.trim().split(/\s+/);
63
+ if (parts.length < 5) {
64
+ // Invalid, return next minute
65
+ const now = new Date();
66
+ now.setSeconds(0);
67
+ now.setMilliseconds(0);
68
+ now.setMinutes(now.getMinutes() + 1);
69
+ return now.getTime();
70
+ }
71
+ const [minute, hour, _dayOfMonth, _month, _dayOfWeek] = parts;
72
+ const now = new Date();
73
+ const next = new Date(now);
74
+ // Set to specific minute/hour if specified
75
+ if (minute !== '*') {
76
+ next.setMinutes(parseInt(minute, 10));
77
+ }
78
+ if (hour !== '*') {
79
+ next.setHours(parseInt(hour, 10));
80
+ }
81
+ next.setSeconds(0);
82
+ next.setMilliseconds(0);
83
+ // If time already passed today, move to tomorrow
84
+ if (next.getTime() <= now.getTime()) {
85
+ next.setDate(next.getDate() + 1);
86
+ }
87
+ return next.getTime();
88
+ }
89
+ /** Calculate next run time for a schedule */
90
+ function calculateNextRun(schedule, lastRunMs) {
91
+ const now = Date.now();
92
+ switch (schedule.kind) {
93
+ case 'at':
94
+ return schedule.atMs > now ? schedule.atMs : -1; // -1 = already passed
95
+ case 'every': {
96
+ const anchor = schedule.anchorMs || now;
97
+ const elapsed = now - anchor;
98
+ const intervals = Math.floor(elapsed / schedule.everyMs);
99
+ return anchor + (intervals + 1) * schedule.everyMs;
100
+ }
101
+ case 'cron':
102
+ return getNextCronTime(schedule.expr, schedule.tz);
103
+ default:
104
+ return -1;
105
+ }
106
+ }
107
+ function createCronService(deps) {
108
+ const emitter = new eventemitter3_1.EventEmitter();
109
+ const jobs = new Map();
110
+ const timers = new Map();
111
+ let running = false;
112
+ let tickInterval = null;
113
+ const digestSentOn = new Map();
114
+ const alertDefaults = {
115
+ priceChangeThresholdPct: deps.config?.alerts?.priceChange?.threshold ?? 5,
116
+ priceChangeWindowSecs: deps.config?.alerts?.priceChange?.windowSecs ?? 600,
117
+ volumeSpikeMultiplier: deps.config?.alerts?.volumeSpike?.multiplier ?? 3,
118
+ };
119
+ /** Generate unique job ID */
120
+ function generateId() {
121
+ return (0, id_1.generateId)('cron');
122
+ }
123
+ function persistJob(job) {
124
+ job.updatedAtMs = Date.now();
125
+ deps.db.upsertCronJob({
126
+ id: job.id,
127
+ data: JSON.stringify(job),
128
+ enabled: job.enabled,
129
+ createdAtMs: job.createdAtMs,
130
+ updatedAtMs: job.updatedAtMs,
131
+ });
132
+ }
133
+ function loadPersistedJobs() {
134
+ const records = deps.db.listCronJobs();
135
+ if (records.length === 0)
136
+ return;
137
+ for (const record of records) {
138
+ try {
139
+ const parsed = JSON.parse(record.data);
140
+ if (!parsed || typeof parsed !== 'object' || !parsed.id)
141
+ continue;
142
+ const job = {
143
+ ...parsed,
144
+ enabled: record.enabled,
145
+ createdAtMs: record.createdAtMs ?? parsed.createdAtMs ?? Date.now(),
146
+ updatedAtMs: record.updatedAtMs ?? parsed.updatedAtMs ?? Date.now(),
147
+ state: parsed.state || {},
148
+ };
149
+ jobs.set(job.id, job);
150
+ }
151
+ catch (error) {
152
+ logger_1.logger.warn({ error, jobId: record.id }, 'Failed to parse persisted cron job');
153
+ }
154
+ }
155
+ }
156
+ function formatCents(price) {
157
+ return `${(price * 100).toFixed(1)}¢`;
158
+ }
159
+ function getPrimaryOutcome(market) {
160
+ if (!market?.outcomes?.length)
161
+ return null;
162
+ const yesOutcome = market.outcomes.find((o) => o.name?.toLowerCase() === 'yes');
163
+ const outcome = yesOutcome || market.outcomes[0];
164
+ if (!outcome || typeof outcome.price !== 'number')
165
+ return null;
166
+ return {
167
+ name: outcome.name,
168
+ price: outcome.price,
169
+ previousPrice: outcome.previousPrice,
170
+ };
171
+ }
172
+ function normalizeThresholdPct(value) {
173
+ if (!Number.isFinite(value))
174
+ return alertDefaults.priceChangeThresholdPct;
175
+ return value <= 1 ? value * 100 : value;
176
+ }
177
+ function resolveAlertRecipient(userId) {
178
+ const latest = deps.db.getLatestSessionForUser(userId);
179
+ if (latest) {
180
+ return { platform: latest.channel, chatId: latest.chatId };
181
+ }
182
+ const user = deps.db.getUser(userId);
183
+ if (!user)
184
+ return null;
185
+ return { platform: user.platform, chatId: user.platformUserId };
186
+ }
187
+ function buildPolymarketEnv(creds) {
188
+ return {
189
+ ...process.env,
190
+ PRIVATE_KEY: creds.privateKey,
191
+ POLY_FUNDER_ADDRESS: creds.funderAddress,
192
+ POLY_API_KEY: creds.apiKey,
193
+ POLY_API_SECRET: creds.apiSecret,
194
+ POLY_API_PASSPHRASE: creds.apiPassphrase,
195
+ };
196
+ }
197
+ function buildKalshiEnv(creds) {
198
+ const env = { ...process.env };
199
+ if (creds.apiKeyId && creds.privateKeyPem) {
200
+ env.KALSHI_API_KEY_ID = creds.apiKeyId;
201
+ env.KALSHI_PRIVATE_KEY = creds.privateKeyPem;
202
+ }
203
+ if (creds.email && creds.password) {
204
+ env.KALSHI_EMAIL = creds.email;
205
+ env.KALSHI_PASSWORD = creds.password;
206
+ }
207
+ return env;
208
+ }
209
+ /** Execute a job based on its payload */
210
+ async function executeJob(job) {
211
+ const { payload } = job;
212
+ switch (payload.kind) {
213
+ case 'alertScan':
214
+ await checkAllAlerts();
215
+ break;
216
+ case 'alert':
217
+ await checkSingleAlert(payload.alertId);
218
+ break;
219
+ case 'marketCheck':
220
+ await checkMarket(payload.marketId, payload.platform);
221
+ break;
222
+ case 'portfolioSync':
223
+ await syncAllPortfolios();
224
+ break;
225
+ case 'dailyDigest':
226
+ await runDailyDigest();
227
+ break;
228
+ case 'stopLossScan':
229
+ await scanStopLosses();
230
+ break;
231
+ case 'agentTurn':
232
+ if (deps.executeAgentTurn) {
233
+ await deps.executeAgentTurn(payload.message, {
234
+ model: payload.model,
235
+ thinking: payload.thinking,
236
+ channel: payload.channel,
237
+ to: payload.to,
238
+ });
239
+ }
240
+ break;
241
+ case 'systemEvent':
242
+ logger_1.logger.info({ event: payload.text }, 'System event triggered');
243
+ break;
244
+ }
245
+ }
246
+ /** Check all active alerts */
247
+ async function checkAllAlerts() {
248
+ const activeAlerts = deps.db.getActiveAlerts();
249
+ for (const alert of activeAlerts) {
250
+ try {
251
+ await checkSingleAlert(alert.id);
252
+ }
253
+ catch (error) {
254
+ logger_1.logger.error({ alertId: alert.id, error }, 'Error checking alert');
255
+ }
256
+ }
257
+ }
258
+ /** Check a single alert */
259
+ async function checkSingleAlert(alertId) {
260
+ const alerts = deps.db.getActiveAlerts();
261
+ const alert = alerts.find((a) => a.id === alertId);
262
+ if (!alert || !alert.marketId || !alert.platform)
263
+ return;
264
+ const market = await deps.feeds.getMarket(alert.marketId, alert.platform);
265
+ if (!market)
266
+ return;
267
+ const outcome = getPrimaryOutcome(market);
268
+ if (!outcome)
269
+ return;
270
+ const currentPrice = outcome.price;
271
+ const windowSecs = alert.condition.timeWindowSecs ?? alertDefaults.priceChangeWindowSecs;
272
+ const previousMarket = deps.db.getCachedMarket(alert.platform, alert.marketId, windowSecs * 1000);
273
+ const previousOutcome = previousMarket ? getPrimaryOutcome(previousMarket) : null;
274
+ const previousPrice = previousOutcome?.price ?? outcome.previousPrice;
275
+ const currentVolume = market.volume24h ?? 0;
276
+ const previousVolume = previousMarket?.volume24h ?? 0;
277
+ let triggered = false;
278
+ let message = '';
279
+ switch (alert.condition.type) {
280
+ case 'price_above':
281
+ if (currentPrice >= alert.condition.threshold) {
282
+ triggered = true;
283
+ message = `📈 Price Alert: ${market.question}\nPrice is now ${(currentPrice * 100).toFixed(1)}¢ (above ${(alert.condition.threshold * 100).toFixed(1)}¢)`;
284
+ }
285
+ break;
286
+ case 'price_below':
287
+ if (currentPrice <= alert.condition.threshold) {
288
+ triggered = true;
289
+ message = `📉 Price Alert: ${market.question}\nPrice is now ${(currentPrice * 100).toFixed(1)}¢ (below ${(alert.condition.threshold * 100).toFixed(1)}¢)`;
290
+ }
291
+ break;
292
+ case 'price_change_pct': {
293
+ if (previousPrice === undefined || previousPrice <= 0)
294
+ break;
295
+ const thresholdPct = normalizeThresholdPct(alert.condition.threshold);
296
+ const changePct = ((currentPrice - previousPrice) / previousPrice) * 100;
297
+ const direction = alert.condition.direction ?? 'any';
298
+ const directionMatch = direction === 'any'
299
+ ? Math.abs(changePct) >= thresholdPct
300
+ : direction === 'up'
301
+ ? changePct >= thresholdPct
302
+ : changePct <= -thresholdPct;
303
+ if (directionMatch) {
304
+ triggered = true;
305
+ const arrow = changePct >= 0 ? '📈' : '📉';
306
+ message =
307
+ `${arrow} Price Change Alert: ${market.question}\n` +
308
+ `Price moved ${changePct >= 0 ? '+' : ''}${changePct.toFixed(2)}% ` +
309
+ `(${formatCents(previousPrice)} → ${formatCents(currentPrice)})`;
310
+ }
311
+ break;
312
+ }
313
+ case 'volume_spike': {
314
+ const multiplier = Number.isFinite(alert.condition.threshold)
315
+ ? alert.condition.threshold
316
+ : alertDefaults.volumeSpikeMultiplier;
317
+ if (previousVolume > 0 && currentVolume / previousVolume >= multiplier) {
318
+ triggered = true;
319
+ const ratio = currentVolume / previousVolume;
320
+ message =
321
+ `📊 Volume Spike: ${market.question}\n` +
322
+ `24h volume is ${ratio.toFixed(2)}x (${currentVolume.toLocaleString()} vs ${previousVolume.toLocaleString()})`;
323
+ }
324
+ break;
325
+ }
326
+ }
327
+ deps.db.cacheMarket(market);
328
+ if (triggered) {
329
+ deps.db.triggerAlert(alert.id);
330
+ const target = alert.channel && alert.chatId
331
+ ? { platform: alert.channel, chatId: alert.chatId }
332
+ : resolveAlertRecipient(alert.userId);
333
+ if (target) {
334
+ await deps.sendMessage({
335
+ platform: target.platform,
336
+ chatId: target.chatId,
337
+ text: message,
338
+ });
339
+ }
340
+ logger_1.logger.info({ alertId: alert.id }, 'Alert triggered');
341
+ }
342
+ }
343
+ /** Check a specific market */
344
+ async function checkMarket(marketId, platform) {
345
+ const market = await deps.feeds.getMarket(marketId, platform);
346
+ if (market) {
347
+ logger_1.logger.debug({ marketId, platform, price: market.outcomes[0]?.price }, 'Market checked');
348
+ }
349
+ }
350
+ function parseDigestTime(raw) {
351
+ if (!raw)
352
+ return { hour: 9, minute: 0 };
353
+ const parts = raw.split(':').map((p) => p.trim()).filter(Boolean);
354
+ const hour = Number.parseInt(parts[0] ?? '', 10);
355
+ const minute = Number.parseInt(parts[1] ?? '0', 10);
356
+ if (!Number.isFinite(hour) || hour < 0 || hour > 23)
357
+ return null;
358
+ if (!Number.isFinite(minute) || minute < 0 || minute > 59)
359
+ return null;
360
+ return { hour, minute };
361
+ }
362
+ function shouldSendDigest(user, now, windowMinutes) {
363
+ if (!user.settings?.digestEnabled)
364
+ return false;
365
+ const time = parseDigestTime(user.settings.digestTime);
366
+ if (!time)
367
+ return false;
368
+ const today = now.toISOString().slice(0, 10);
369
+ if (digestSentOn.get(user.id) === today)
370
+ return false;
371
+ if (now.getHours() !== time.hour)
372
+ return false;
373
+ const minute = now.getMinutes();
374
+ return minute >= time.minute && minute < time.minute + windowMinutes;
375
+ }
376
+ function buildPosition(params) {
377
+ const value = params.shares * params.currentPrice;
378
+ const pnl = params.shares * (params.currentPrice - params.avgPrice);
379
+ const pnlPct = params.avgPrice > 0 ? ((params.currentPrice - params.avgPrice) / params.avgPrice) * 100 : 0;
380
+ return {
381
+ id: (0, crypto_1.randomUUID)(),
382
+ platform: params.platform,
383
+ marketId: params.marketId,
384
+ marketQuestion: params.marketQuestion,
385
+ outcome: params.outcome,
386
+ outcomeId: params.outcomeId,
387
+ side: (params.side === 'YES' || params.side === 'NO' ? params.side : params.side.toUpperCase() === 'LONG' ? 'YES' : 'NO'),
388
+ shares: params.shares,
389
+ avgPrice: params.avgPrice,
390
+ currentPrice: params.currentPrice,
391
+ pnl,
392
+ pnlPct,
393
+ value,
394
+ openedAt: new Date(),
395
+ };
396
+ }
397
+ function normalizeSide(outcome) {
398
+ return outcome && outcome.toString().toUpperCase().includes('NO') ? 'NO' : 'YES';
399
+ }
400
+ function toNumber(value) {
401
+ if (typeof value === 'number' && Number.isFinite(value))
402
+ return value;
403
+ if (value === null || value === undefined)
404
+ return null;
405
+ const parsed = Number.parseFloat(String(value));
406
+ return Number.isFinite(parsed) ? parsed : null;
407
+ }
408
+ function normalizeKalshiPrice(value) {
409
+ const num = toNumber(value);
410
+ if (num === null)
411
+ return null;
412
+ return num > 1 ? num / 100 : num;
413
+ }
414
+ async function runDailyDigest() {
415
+ const users = deps.db.listUsers();
416
+ if (users.length === 0)
417
+ return;
418
+ const now = new Date();
419
+ const windowMinutes = 5;
420
+ for (const user of users) {
421
+ if (!shouldSendDigest(user, now, windowMinutes))
422
+ continue;
423
+ const positions = deps.db.getPositions(user.id);
424
+ const alerts = deps.db.getAlerts(user.id).filter((a) => a.enabled && !a.triggered);
425
+ const news = deps.feeds.getRecentNews(5);
426
+ const lines = [];
427
+ lines.push(`📬 Daily Digest — ${now.toLocaleDateString()}`);
428
+ if (positions.length > 0) {
429
+ const totalValue = positions.reduce((sum, p) => sum + p.value, 0);
430
+ const totalPnl = positions.reduce((sum, p) => sum + p.pnl, 0);
431
+ lines.push(`Portfolio: $${totalValue.toFixed(2)} (${totalPnl >= 0 ? '+' : ''}$${totalPnl.toFixed(2)})`);
432
+ const topPositions = [...positions]
433
+ .sort((a, b) => Math.abs(b.pnl) - Math.abs(a.pnl))
434
+ .slice(0, 3);
435
+ for (const pos of topPositions) {
436
+ lines.push(`• ${pos.marketQuestion.slice(0, 60)} — ${pos.side} ${formatCents(pos.currentPrice)} ` +
437
+ `(${pos.pnl >= 0 ? '+' : ''}$${pos.pnl.toFixed(2)})`);
438
+ }
439
+ }
440
+ else {
441
+ lines.push('Portfolio: no tracked positions yet.');
442
+ }
443
+ if (alerts.length > 0) {
444
+ lines.push(`Active alerts: ${alerts.length}`);
445
+ }
446
+ if (news.length > 0) {
447
+ lines.push('', 'Top news:');
448
+ for (const item of news.slice(0, 3)) {
449
+ lines.push(`• ${item.title} (${item.source})`);
450
+ }
451
+ }
452
+ const target = resolveAlertRecipient(user.id);
453
+ if (!target)
454
+ continue;
455
+ await deps.sendMessage({
456
+ platform: target.platform,
457
+ chatId: target.chatId,
458
+ text: lines.join('\n'),
459
+ });
460
+ digestSentOn.set(user.id, now.toISOString().slice(0, 10));
461
+ }
462
+ }
463
+ async function fetchPolymarketPositions(userId, creds) {
464
+ const address = creds.funderAddress;
465
+ if (!address)
466
+ return [];
467
+ const response = await fetch(`https://data-api.polymarket.com/positions?user=${address}`);
468
+ if (!response.ok) {
469
+ throw new Error(`Polymarket positions fetch failed: ${response.status}`);
470
+ }
471
+ const data = await response.json();
472
+ const positions = [];
473
+ for (const item of data || []) {
474
+ const marketId = item.conditionId ||
475
+ item.condition_id ||
476
+ item.marketId ||
477
+ item.market_id ||
478
+ item.market;
479
+ if (!marketId)
480
+ continue;
481
+ const outcome = item.outcome || 'YES';
482
+ const side = normalizeSide(outcome);
483
+ const shares = toNumber(item.size ?? item.shares ?? item.balance) ?? 0;
484
+ if (shares <= 0)
485
+ continue;
486
+ const avgPrice = toNumber(item.avgPrice ?? item.avg_price ?? item.entryPrice ?? item.entry_price) ?? 0;
487
+ const currentPrice = toNumber(item.currentPrice ?? item.current_price ?? item.price) ?? avgPrice;
488
+ const outcomeId = item.tokenId || item.token_id || `${marketId}-${side}`;
489
+ const marketQuestion = item.title ||
490
+ item.market ||
491
+ item.question ||
492
+ marketId;
493
+ positions.push(buildPosition({
494
+ platform: 'polymarket',
495
+ marketId,
496
+ marketQuestion,
497
+ outcome,
498
+ outcomeId,
499
+ side,
500
+ shares,
501
+ avgPrice: avgPrice > 0 ? avgPrice : currentPrice,
502
+ currentPrice,
503
+ }));
504
+ }
505
+ await deps.credentials?.markSuccess(userId, 'polymarket');
506
+ return positions;
507
+ }
508
+ async function fetchKalshiPositions(userId, creds) {
509
+ const KALSHI_API_BASE = 'https://api.elections.kalshi.com/trade-api/v2';
510
+ let headers;
511
+ if (creds.apiKeyId && creds.privateKeyPem) {
512
+ headers = (0, kalshi_auth_1.buildKalshiHeadersForUrl)({ apiKeyId: creds.apiKeyId, privateKeyPem: creds.privateKeyPem }, 'GET', `${KALSHI_API_BASE}/portfolio/positions`);
513
+ }
514
+ else if (creds.email && creds.password) {
515
+ const loginRes = await fetch(`${KALSHI_API_BASE}/login`, {
516
+ method: 'POST',
517
+ headers: { 'Content-Type': 'application/json' },
518
+ body: JSON.stringify({ email: creds.email, password: creds.password }),
519
+ });
520
+ if (!loginRes.ok) {
521
+ throw new Error(`Kalshi login failed: ${loginRes.status}`);
522
+ }
523
+ const loginData = await loginRes.json();
524
+ headers = { Authorization: `Bearer ${loginData.token}` };
525
+ }
526
+ else {
527
+ return [];
528
+ }
529
+ const posRes = await fetch(`${KALSHI_API_BASE}/portfolio/positions`, { headers });
530
+ if (!posRes.ok) {
531
+ throw new Error(`Kalshi positions fetch failed: ${posRes.status}`);
532
+ }
533
+ const posData = await posRes.json();
534
+ const marketCache = new Map();
535
+ const positions = [];
536
+ for (const entry of posData.market_positions || []) {
537
+ const ticker = entry.ticker;
538
+ if (!ticker)
539
+ continue;
540
+ const rawPosition = toNumber(entry.position ?? entry.shares ?? entry.count) ?? 0;
541
+ if (rawPosition === 0)
542
+ continue;
543
+ const side = rawPosition >= 0 ? 'YES' : 'NO';
544
+ const shares = Math.abs(rawPosition);
545
+ let market = marketCache.get(ticker);
546
+ if (!market) {
547
+ const marketRes = await fetch(`${KALSHI_API_BASE}/markets/${ticker}`, { headers });
548
+ if (marketRes.ok) {
549
+ const marketJson = await marketRes.json();
550
+ market = (marketJson.market || marketJson);
551
+ marketCache.set(ticker, market);
552
+ }
553
+ }
554
+ const marketQuestion = market?.title || entry.market || ticker;
555
+ const yesPrice = normalizeKalshiPrice(market?.yes_bid ?? market?.yes_ask ?? market?.yes_price ?? market?.last_price) ?? 0.5;
556
+ const currentPrice = side === 'YES' ? yesPrice : Math.max(0, 1 - yesPrice);
557
+ let avgPrice = normalizeKalshiPrice(entry.avg_price ?? entry.average_price ?? entry.avg_entry_price) ??
558
+ null;
559
+ if (avgPrice === null) {
560
+ const totalTraded = toNumber(entry.total_traded ?? entry.cost_basis);
561
+ if (totalTraded && shares > 0) {
562
+ avgPrice = normalizeKalshiPrice(totalTraded / shares);
563
+ }
564
+ }
565
+ avgPrice = avgPrice ?? currentPrice;
566
+ positions.push(buildPosition({
567
+ platform: 'kalshi',
568
+ marketId: ticker,
569
+ marketQuestion,
570
+ outcome: side,
571
+ outcomeId: `${ticker}-${side}`,
572
+ side,
573
+ shares,
574
+ avgPrice,
575
+ currentPrice,
576
+ }));
577
+ }
578
+ await deps.credentials?.markSuccess(userId, 'kalshi');
579
+ return positions;
580
+ }
581
+ async function fetchManifoldPositions(userId, creds) {
582
+ if (!creds.apiKey)
583
+ return [];
584
+ const headers = { Authorization: `Key ${creds.apiKey}` };
585
+ const meRes = await fetch('https://api.manifold.markets/v0/me', { headers });
586
+ if (!meRes.ok) {
587
+ throw new Error(`Manifold /me failed: ${meRes.status}`);
588
+ }
589
+ const meData = await meRes.json();
590
+ if (!meData.id)
591
+ return [];
592
+ const betsRes = await fetch(`https://api.manifold.markets/v0/bets?userId=${meData.id}&limit=1000`, { headers });
593
+ if (!betsRes.ok) {
594
+ throw new Error(`Manifold bets fetch failed: ${betsRes.status}`);
595
+ }
596
+ const bets = await betsRes.json();
597
+ const byMarket = new Map();
598
+ for (const bet of bets || []) {
599
+ if (bet.isSold || bet.isCancelled)
600
+ continue;
601
+ const marketId = bet.contractId;
602
+ if (!marketId)
603
+ continue;
604
+ const entry = byMarket.get(marketId) || {
605
+ question: bet.contractQuestion,
606
+ yesShares: 0,
607
+ noShares: 0,
608
+ yesInvested: 0,
609
+ noInvested: 0,
610
+ };
611
+ const shares = toNumber(bet.shares) ?? 0;
612
+ const amount = toNumber(bet.amount) ?? 0;
613
+ if (bet.outcome === 'YES') {
614
+ entry.yesShares += shares;
615
+ entry.yesInvested += amount;
616
+ }
617
+ else if (bet.outcome === 'NO') {
618
+ entry.noShares += shares;
619
+ entry.noInvested += amount;
620
+ }
621
+ if (!entry.question && bet.contractQuestion) {
622
+ entry.question = bet.contractQuestion;
623
+ }
624
+ byMarket.set(marketId, entry);
625
+ }
626
+ const marketCache = new Map();
627
+ const positions = [];
628
+ for (const [marketId, entry] of byMarket.entries()) {
629
+ if (entry.yesShares <= 0 && entry.noShares <= 0)
630
+ continue;
631
+ let market = marketCache.get(marketId);
632
+ if (!market) {
633
+ const marketRes = await fetch(`https://api.manifold.markets/v0/market/${marketId}`);
634
+ if (marketRes.ok) {
635
+ market = await marketRes.json();
636
+ marketCache.set(marketId, market);
637
+ }
638
+ }
639
+ const question = market?.question || entry.question || marketId;
640
+ const prob = toNumber(market?.probability) ?? 0.5;
641
+ if (entry.yesShares > 0) {
642
+ const avg = entry.yesShares > 0 ? entry.yesInvested / entry.yesShares : prob;
643
+ positions.push(buildPosition({
644
+ platform: 'manifold',
645
+ marketId,
646
+ marketQuestion: question,
647
+ outcome: 'YES',
648
+ outcomeId: `${marketId}-YES`,
649
+ side: 'YES',
650
+ shares: entry.yesShares,
651
+ avgPrice: avg,
652
+ currentPrice: prob,
653
+ }));
654
+ }
655
+ if (entry.noShares > 0) {
656
+ const noPrice = Math.max(0, 1 - prob);
657
+ const avg = entry.noShares > 0 ? entry.noInvested / entry.noShares : noPrice;
658
+ positions.push(buildPosition({
659
+ platform: 'manifold',
660
+ marketId,
661
+ marketQuestion: question,
662
+ outcome: 'NO',
663
+ outcomeId: `${marketId}-NO`,
664
+ side: 'NO',
665
+ shares: entry.noShares,
666
+ avgPrice: avg,
667
+ currentPrice: noPrice,
668
+ }));
669
+ }
670
+ }
671
+ await deps.credentials?.markSuccess(userId, 'manifold');
672
+ return positions;
673
+ }
674
+ async function syncAllPortfolios() {
675
+ const credentials = deps.credentials;
676
+ if (!credentials) {
677
+ logger_1.logger.warn('Portfolio sync skipped: credentials manager not configured');
678
+ return;
679
+ }
680
+ const credentialUsers = deps.db.query('SELECT DISTINCT user_id FROM trading_credentials WHERE enabled = 1');
681
+ const userIds = credentialUsers.map((row) => row.user_id);
682
+ if (userIds.length === 0)
683
+ return;
684
+ for (const userId of userIds) {
685
+ const user = deps.db.getUser(userId);
686
+ if (!user)
687
+ continue;
688
+ const platforms = await credentials.listUserPlatforms(userId);
689
+ if (platforms.length === 0)
690
+ continue;
691
+ for (const platform of platforms) {
692
+ try {
693
+ let positions = null;
694
+ if (platform === 'polymarket') {
695
+ const creds = await credentials.getCredentials(userId, 'polymarket');
696
+ if (creds)
697
+ positions = await fetchPolymarketPositions(userId, creds);
698
+ }
699
+ else if (platform === 'kalshi') {
700
+ const creds = await credentials.getCredentials(userId, 'kalshi');
701
+ if (creds)
702
+ positions = await fetchKalshiPositions(userId, creds);
703
+ }
704
+ else if (platform === 'manifold') {
705
+ const creds = await credentials.getCredentials(userId, 'manifold');
706
+ if (creds)
707
+ positions = await fetchManifoldPositions(userId, creds);
708
+ }
709
+ else if (platform === 'hyperliquid') {
710
+ const creds = await credentials.getCredentials(userId, 'hyperliquid');
711
+ if (creds) {
712
+ const hl = await Promise.resolve().then(() => __importStar(require('../exchanges/hyperliquid/index')));
713
+ const state = await hl.getUserState(creds.walletAddress);
714
+ positions = state.assetPositions
715
+ .filter((ap) => parseFloat(ap.position.szi) !== 0)
716
+ .map((ap) => {
717
+ const p = ap.position;
718
+ const shares = Math.abs(parseFloat(p.szi));
719
+ const entryPrice = parseFloat(p.entryPx);
720
+ const uPnl = parseFloat(p.unrealizedPnl);
721
+ const isLong = parseFloat(p.szi) > 0;
722
+ const currentPrice = shares > 0 ? entryPrice + uPnl / shares : entryPrice;
723
+ return buildPosition({
724
+ platform: 'hyperliquid',
725
+ marketId: p.coin,
726
+ marketQuestion: `${p.coin} Perp`,
727
+ outcome: isLong ? 'Long' : 'Short',
728
+ outcomeId: `hl_${p.coin}_${isLong ? 'long' : 'short'}`,
729
+ side: isLong ? 'LONG' : 'SHORT',
730
+ shares,
731
+ avgPrice: entryPrice,
732
+ currentPrice,
733
+ });
734
+ });
735
+ }
736
+ }
737
+ else if (platform === 'binance') {
738
+ const creds = await credentials.getCredentials(userId, 'binance');
739
+ if (creds) {
740
+ const bin = await Promise.resolve().then(() => __importStar(require('../exchanges/binance-futures/index')));
741
+ const rawPositions = await bin.getPositions(creds);
742
+ positions = rawPositions
743
+ .filter((p) => p.positionAmt !== 0)
744
+ .map((p) => {
745
+ const isLong = p.positionAmt > 0;
746
+ return buildPosition({
747
+ platform: 'binance',
748
+ marketId: p.symbol,
749
+ marketQuestion: `${p.symbol} Perp`,
750
+ outcome: isLong ? 'Long' : 'Short',
751
+ outcomeId: `binance_${p.symbol}_${p.positionSide}`,
752
+ side: isLong ? 'LONG' : 'SHORT',
753
+ shares: Math.abs(p.positionAmt),
754
+ avgPrice: p.entryPrice,
755
+ currentPrice: p.markPrice,
756
+ });
757
+ });
758
+ }
759
+ }
760
+ else if (platform === 'bybit') {
761
+ const creds = await credentials.getCredentials(userId, 'bybit');
762
+ if (creds) {
763
+ const bb = await Promise.resolve().then(() => __importStar(require('../exchanges/bybit/index')));
764
+ const rawPositions = await bb.getPositions(creds);
765
+ positions = rawPositions
766
+ .filter((p) => p.size !== 0)
767
+ .map((p) => {
768
+ const isLong = p.side === 'Buy';
769
+ return buildPosition({
770
+ platform: 'bybit',
771
+ marketId: p.symbol,
772
+ marketQuestion: `${p.symbol} Perp`,
773
+ outcome: isLong ? 'Long' : 'Short',
774
+ outcomeId: `bybit_${p.symbol}_${p.side}`,
775
+ side: isLong ? 'LONG' : 'SHORT',
776
+ shares: p.size,
777
+ avgPrice: p.entryPrice,
778
+ currentPrice: p.markPrice,
779
+ });
780
+ });
781
+ }
782
+ }
783
+ else if (platform === 'mexc') {
784
+ const creds = await credentials.getCredentials(userId, 'mexc');
785
+ if (creds) {
786
+ const mx = await Promise.resolve().then(() => __importStar(require('../exchanges/mexc/index')));
787
+ const rawPositions = await mx.getPositions(creds);
788
+ positions = rawPositions
789
+ .filter((p) => p.holdVol !== 0)
790
+ .map((p) => {
791
+ const isLong = p.positionType === 1;
792
+ return buildPosition({
793
+ platform: 'mexc',
794
+ marketId: p.symbol,
795
+ marketQuestion: `${p.symbol} Perp`,
796
+ outcome: isLong ? 'Long' : 'Short',
797
+ outcomeId: `mexc_${p.symbol}_${isLong ? 'long' : 'short'}`,
798
+ side: isLong ? 'LONG' : 'SHORT',
799
+ shares: p.holdVol,
800
+ avgPrice: p.openAvgPrice,
801
+ currentPrice: p.markPrice,
802
+ });
803
+ });
804
+ }
805
+ }
806
+ if (!positions)
807
+ continue;
808
+ const existing = deps.db.getPositions(userId).filter((p) => p.platform === platform);
809
+ const currentIds = new Set(positions.map((p) => p.outcomeId));
810
+ for (const position of positions) {
811
+ deps.db.upsertPosition(userId, position);
812
+ }
813
+ for (const position of existing) {
814
+ if (!currentIds.has(position.outcomeId)) {
815
+ deps.db.deletePosition(position.id);
816
+ }
817
+ }
818
+ logger_1.logger.info({ userId, platform, positions: positions.length, removed: Math.max(0, existing.length - currentIds.size) }, 'Portfolio sync complete');
819
+ }
820
+ catch (error) {
821
+ logger_1.logger.warn({ error, userId, platform }, 'Portfolio sync failed');
822
+ await credentials.markFailure(userId, platform);
823
+ }
824
+ }
825
+ // Create portfolio snapshot after syncing all platforms for this user
826
+ try {
827
+ const allPositions = deps.db.getPositions(userId);
828
+ if (allPositions.length > 0) {
829
+ const totalValue = allPositions.reduce((sum, p) => sum + p.value, 0);
830
+ const totalCostBasis = allPositions.reduce((sum, p) => sum + (p.shares * p.avgPrice), 0);
831
+ const totalPnl = totalValue - totalCostBasis;
832
+ const totalPnlPct = totalCostBasis > 0 ? (totalPnl / totalCostBasis) * 100 : 0;
833
+ const byPlatform = {};
834
+ for (const p of allPositions) {
835
+ const entry = byPlatform[p.platform] || { value: 0, pnl: 0 };
836
+ entry.value += p.value;
837
+ entry.pnl += p.value - (p.shares * p.avgPrice);
838
+ byPlatform[p.platform] = entry;
839
+ }
840
+ deps.db.createPortfolioSnapshot({
841
+ userId,
842
+ totalValue,
843
+ totalPnl,
844
+ totalPnlPct,
845
+ totalCostBasis,
846
+ positionsCount: allPositions.length,
847
+ byPlatform,
848
+ });
849
+ logger_1.logger.debug({ userId, totalValue, positionsCount: allPositions.length }, 'Portfolio snapshot created');
850
+ }
851
+ }
852
+ catch (error) {
853
+ logger_1.logger.warn({ error, userId }, 'Failed to create portfolio snapshot');
854
+ }
855
+ }
856
+ // Clean up old snapshots (>90 days)
857
+ try {
858
+ const cutoffMs = Date.now() - 90 * 24 * 60 * 60 * 1000;
859
+ deps.db.deletePortfolioSnapshotsBefore(cutoffMs);
860
+ }
861
+ catch (error) {
862
+ logger_1.logger.warn({ error }, 'Failed to clean up old portfolio snapshots');
863
+ }
864
+ }
865
+ function normalizeStopLossPct(value) {
866
+ if (value === undefined || value === null)
867
+ return null;
868
+ if (!Number.isFinite(value))
869
+ return null;
870
+ if (value <= 0)
871
+ return null;
872
+ return value > 1 ? value / 100 : value;
873
+ }
874
+ async function executeStopLoss(user, position) {
875
+ if (!deps.credentials) {
876
+ return { status: 'skipped', error: 'Credentials manager not configured' };
877
+ }
878
+ if (!Number.isFinite(position.shares) || position.shares <= 0) {
879
+ return { status: 'skipped', error: 'No position size' };
880
+ }
881
+ const dryRun = deps.config?.trading?.dryRun !== false;
882
+ if (dryRun) {
883
+ return { status: 'dry-run' };
884
+ }
885
+ const platform = position.platform;
886
+ if (platform === 'polymarket') {
887
+ const creds = await deps.credentials.getCredentials(user.id, 'polymarket');
888
+ if (!creds)
889
+ return { status: 'skipped', error: 'Missing Polymarket credentials' };
890
+ const tradingDir = (0, path_1.join)(__dirname, '..', '..', 'trading');
891
+ const tokenId = position.outcomeId;
892
+ const size = position.shares;
893
+ const cmd = `cd ${tradingDir} && python3 polymarket.py market_sell ${tokenId} ${size}`;
894
+ try {
895
+ const output = (0, child_process_1.execSync)(cmd, { timeout: 30000, encoding: 'utf-8', env: buildPolymarketEnv(creds) });
896
+ await deps.credentials.markSuccess(user.id, 'polymarket');
897
+ return { status: 'executed', output: output.trim() };
898
+ }
899
+ catch (err) {
900
+ const error = err;
901
+ await deps.credentials.markFailure(user.id, 'polymarket');
902
+ return { status: 'failed', error: error.stderr || error.message };
903
+ }
904
+ }
905
+ if (platform === 'kalshi') {
906
+ const creds = await deps.credentials.getCredentials(user.id, 'kalshi');
907
+ if (!creds)
908
+ return { status: 'skipped', error: 'Missing Kalshi credentials' };
909
+ const tradingDir = (0, path_1.join)(__dirname, '..', '..', 'trading');
910
+ const ticker = position.marketId;
911
+ const side = position.side.toLowerCase();
912
+ const count = Math.round(position.shares);
913
+ const cmd = `cd ${tradingDir} && python3 kalshi.py market_order ${ticker} ${side} sell ${count}`;
914
+ try {
915
+ const output = (0, child_process_1.execSync)(cmd, { timeout: 30000, encoding: 'utf-8', env: buildKalshiEnv(creds) });
916
+ await deps.credentials.markSuccess(user.id, 'kalshi');
917
+ return { status: 'executed', output: output.trim() };
918
+ }
919
+ catch (err) {
920
+ const error = err;
921
+ await deps.credentials.markFailure(user.id, 'kalshi');
922
+ return { status: 'failed', error: error.stderr || error.message };
923
+ }
924
+ }
925
+ if (platform === 'manifold') {
926
+ const creds = await deps.credentials.getCredentials(user.id, 'manifold');
927
+ if (!creds)
928
+ return { status: 'skipped', error: 'Missing Manifold credentials' };
929
+ const apiKey = creds.apiKey;
930
+ const body = {
931
+ contractId: position.marketId,
932
+ outcome: position.side,
933
+ shares: position.shares,
934
+ };
935
+ try {
936
+ const response = await fetch(`https://api.manifold.markets/v0/market/${position.marketId}/sell`, {
937
+ method: 'POST',
938
+ headers: {
939
+ 'Content-Type': 'application/json',
940
+ 'Authorization': `Key ${apiKey}`,
941
+ },
942
+ body: JSON.stringify(body),
943
+ });
944
+ if (!response.ok) {
945
+ const errorText = await response.text();
946
+ await deps.credentials.markFailure(user.id, 'manifold');
947
+ return { status: 'failed', error: errorText };
948
+ }
949
+ await deps.credentials.markSuccess(user.id, 'manifold');
950
+ const result = await response.json();
951
+ return { status: 'executed', output: JSON.stringify(result) };
952
+ }
953
+ catch (err) {
954
+ const error = err;
955
+ await deps.credentials.markFailure(user.id, 'manifold');
956
+ return { status: 'failed', error: error.message };
957
+ }
958
+ }
959
+ return { status: 'skipped', error: `Unsupported platform: ${platform}` };
960
+ }
961
+ async function scanStopLosses() {
962
+ const users = deps.db.listUsers();
963
+ if (users.length === 0)
964
+ return;
965
+ const cooldownMs = deps.config?.trading?.stopLossCooldownMs ?? 10 * 60 * 1000;
966
+ const now = Date.now();
967
+ for (const user of users) {
968
+ const stopLossPct = normalizeStopLossPct(user.settings.stopLossPct);
969
+ if (!stopLossPct)
970
+ continue;
971
+ const positions = deps.db.getPositions(user.id);
972
+ if (positions.length === 0)
973
+ continue;
974
+ for (const position of positions) {
975
+ if (!position.avgPrice || !position.currentPrice)
976
+ continue;
977
+ const threshold = position.avgPrice * (1 - stopLossPct);
978
+ if (position.currentPrice > threshold)
979
+ continue;
980
+ const existing = deps.db.getStopLossTrigger(user.id, position.platform, position.outcomeId);
981
+ if (existing?.cooldownUntil && existing.cooldownUntil.getTime() > now) {
982
+ continue;
983
+ }
984
+ const result = await executeStopLoss(user, position);
985
+ const cooldownUntil = new Date(now + cooldownMs);
986
+ deps.db.upsertStopLossTrigger({
987
+ userId: user.id,
988
+ platform: position.platform,
989
+ outcomeId: position.outcomeId,
990
+ marketId: position.marketId,
991
+ status: result.status,
992
+ triggeredAt: new Date(now),
993
+ lastPrice: position.currentPrice,
994
+ lastError: result.error,
995
+ cooldownUntil,
996
+ });
997
+ const target = resolveAlertRecipient(user.id);
998
+ if (target) {
999
+ const lines = [
1000
+ '🛑 Stop-loss triggered',
1001
+ `${position.marketQuestion || position.marketId} (${position.platform})`,
1002
+ `Side: ${position.side}`,
1003
+ `Price: ${position.currentPrice.toFixed(4)} (avg ${position.avgPrice.toFixed(4)})`,
1004
+ `Threshold: ${threshold.toFixed(4)} (${Math.round(stopLossPct * 100)}%)`,
1005
+ result.status === 'executed' ? `Sold ${position.shares} shares.` : `Status: ${result.status}`,
1006
+ ];
1007
+ if (result.error) {
1008
+ lines.push(`Error: ${result.error}`);
1009
+ }
1010
+ if (result.status === 'dry-run') {
1011
+ lines.push('Dry run enabled - no trade executed.');
1012
+ }
1013
+ await deps.sendMessage({
1014
+ platform: target.platform,
1015
+ chatId: target.chatId,
1016
+ text: lines.join('\n'),
1017
+ });
1018
+ }
1019
+ }
1020
+ }
1021
+ }
1022
+ /** Schedule a job's next execution */
1023
+ function scheduleJob(job) {
1024
+ // Clear existing timer
1025
+ const existing = timers.get(job.id);
1026
+ if (existing) {
1027
+ clearTimeout(existing);
1028
+ timers.delete(job.id);
1029
+ }
1030
+ if (!job.enabled || !running)
1031
+ return;
1032
+ const nextRun = calculateNextRun(job.schedule, job.state.lastRunAtMs);
1033
+ if (nextRun < 0) {
1034
+ if (job.deleteAfterRun) {
1035
+ jobs.delete(job.id);
1036
+ }
1037
+ return;
1038
+ }
1039
+ job.state.nextRunAtMs = nextRun;
1040
+ const delay = Math.max(0, nextRun - Date.now());
1041
+ const timer = setTimeout(async () => {
1042
+ timers.delete(job.id);
1043
+ await executeJobInternal(job);
1044
+ }, delay);
1045
+ timers.set(job.id, timer);
1046
+ emitter.emit('event', { type: 'job:scheduled', job });
1047
+ logger_1.logger.debug({ jobId: job.id, name: job.name, nextRun: new Date(nextRun) }, 'Job scheduled');
1048
+ persistJob(job);
1049
+ }
1050
+ /** Execute a job */
1051
+ async function executeJobInternal(job) {
1052
+ if (!job.enabled) {
1053
+ emitter.emit('event', { type: 'job:skipped', job, reason: 'disabled' });
1054
+ return;
1055
+ }
1056
+ job.state.runningAtMs = Date.now();
1057
+ emitter.emit('event', { type: 'job:started', job });
1058
+ logger_1.logger.info({ jobId: job.id, name: job.name }, 'Running cron job');
1059
+ const startTime = Date.now();
1060
+ try {
1061
+ await executeJob(job);
1062
+ const durationMs = Date.now() - startTime;
1063
+ job.state.lastRunAtMs = startTime;
1064
+ job.state.lastStatus = 'ok';
1065
+ job.state.lastDurationMs = durationMs;
1066
+ job.state.lastError = undefined;
1067
+ job.state.runningAtMs = undefined;
1068
+ emitter.emit('event', { type: 'job:completed', job, durationMs });
1069
+ logger_1.logger.info({ jobId: job.id, name: job.name, durationMs }, 'Cron job completed');
1070
+ persistJob(job);
1071
+ if (job.deleteAfterRun && job.schedule.kind === 'at') {
1072
+ jobs.delete(job.id);
1073
+ }
1074
+ else {
1075
+ scheduleJob(job);
1076
+ }
1077
+ }
1078
+ catch (error) {
1079
+ const durationMs = Date.now() - startTime;
1080
+ const errorMsg = error instanceof Error ? error.message : String(error);
1081
+ job.state.lastRunAtMs = startTime;
1082
+ job.state.lastStatus = 'error';
1083
+ job.state.lastError = errorMsg;
1084
+ job.state.lastDurationMs = durationMs;
1085
+ job.state.runningAtMs = undefined;
1086
+ emitter.emit('event', { type: 'job:failed', job, error: errorMsg });
1087
+ logger_1.logger.error({ jobId: job.id, name: job.name, error: errorMsg }, 'Cron job failed');
1088
+ persistJob(job);
1089
+ if (job.schedule.kind !== 'at') {
1090
+ scheduleJob(job);
1091
+ }
1092
+ }
1093
+ }
1094
+ // =========================================================================
1095
+ // PUBLIC API
1096
+ // =========================================================================
1097
+ emitter.start = async () => {
1098
+ if (running)
1099
+ return;
1100
+ running = true;
1101
+ logger_1.logger.info('Starting cron service');
1102
+ const cronConfig = deps.config?.cron ?? {};
1103
+ if (cronConfig.enabled === false) {
1104
+ logger_1.logger.info('Cron service disabled by configuration');
1105
+ running = false;
1106
+ return;
1107
+ }
1108
+ const alertScanIntervalMs = cronConfig.alertScanIntervalMs ?? 30000;
1109
+ const digestIntervalMs = cronConfig.digestIntervalMs ?? 5 * 60 * 1000;
1110
+ const portfolioSyncIntervalMs = cronConfig.portfolioSyncIntervalMs ?? 60 * 60 * 1000;
1111
+ const stopLossIntervalMs = cronConfig.stopLossIntervalMs ?? 2 * 60 * 1000;
1112
+ if (jobs.size === 0) {
1113
+ loadPersistedJobs();
1114
+ }
1115
+ // Add default alert scan job if none exists
1116
+ if (!Array.from(jobs.values()).some((j) => j.payload.kind === 'alertScan')) {
1117
+ emitter.add({
1118
+ name: 'Alert Scanner',
1119
+ description: 'Check all price alerts every 30 seconds',
1120
+ enabled: true,
1121
+ schedule: { kind: 'every', everyMs: alertScanIntervalMs },
1122
+ sessionTarget: 'main',
1123
+ wakeMode: 'now',
1124
+ payload: { kind: 'alertScan' },
1125
+ });
1126
+ }
1127
+ if (!Array.from(jobs.values()).some((j) => j.payload.kind === 'portfolioSync')) {
1128
+ emitter.add({
1129
+ name: 'Portfolio Sync',
1130
+ description: 'Sync portfolio positions from linked trading accounts',
1131
+ enabled: true,
1132
+ schedule: { kind: 'every', everyMs: portfolioSyncIntervalMs },
1133
+ sessionTarget: 'main',
1134
+ wakeMode: 'now',
1135
+ payload: { kind: 'portfolioSync' },
1136
+ });
1137
+ }
1138
+ if (!Array.from(jobs.values()).some((j) => j.payload.kind === 'dailyDigest')) {
1139
+ emitter.add({
1140
+ name: 'Daily Digest',
1141
+ description: 'Send daily digest messages to users who enabled it',
1142
+ enabled: true,
1143
+ schedule: { kind: 'every', everyMs: digestIntervalMs },
1144
+ sessionTarget: 'main',
1145
+ wakeMode: 'now',
1146
+ payload: { kind: 'dailyDigest' },
1147
+ });
1148
+ }
1149
+ if (stopLossIntervalMs > 0 &&
1150
+ !Array.from(jobs.values()).some((j) => j.payload.kind === 'stopLossScan')) {
1151
+ emitter.add({
1152
+ name: 'Stop-Loss Scanner',
1153
+ description: 'Monitor positions and execute stop-loss orders',
1154
+ enabled: true,
1155
+ schedule: { kind: 'every', everyMs: stopLossIntervalMs },
1156
+ sessionTarget: 'main',
1157
+ wakeMode: 'now',
1158
+ payload: { kind: 'stopLossScan' },
1159
+ });
1160
+ }
1161
+ // Schedule all enabled jobs
1162
+ for (const job of jobs.values()) {
1163
+ scheduleJob(job);
1164
+ }
1165
+ // Tick every minute to catch any drift
1166
+ tickInterval = setInterval(() => {
1167
+ const now = Date.now();
1168
+ for (const job of jobs.values()) {
1169
+ if (job.enabled && job.state.nextRunAtMs && job.state.nextRunAtMs <= now && !job.state.runningAtMs) {
1170
+ scheduleJob(job);
1171
+ }
1172
+ }
1173
+ }, 60000);
1174
+ logger_1.logger.info('Cron service started');
1175
+ };
1176
+ emitter.stop = () => {
1177
+ if (!running)
1178
+ return;
1179
+ running = false;
1180
+ for (const timer of timers.values()) {
1181
+ clearTimeout(timer);
1182
+ }
1183
+ timers.clear();
1184
+ if (tickInterval) {
1185
+ clearInterval(tickInterval);
1186
+ tickInterval = null;
1187
+ }
1188
+ logger_1.logger.info('Cron service stopped');
1189
+ };
1190
+ emitter.status = () => {
1191
+ let nextJobAt;
1192
+ for (const job of jobs.values()) {
1193
+ if (job.enabled && job.state.nextRunAtMs) {
1194
+ if (!nextJobAt || job.state.nextRunAtMs < nextJobAt) {
1195
+ nextJobAt = job.state.nextRunAtMs;
1196
+ }
1197
+ }
1198
+ }
1199
+ return { running, jobCount: jobs.size, nextJobAt };
1200
+ };
1201
+ emitter.list = (opts) => {
1202
+ const all = Array.from(jobs.values());
1203
+ return opts?.includeDisabled ? all : all.filter((j) => j.enabled);
1204
+ };
1205
+ emitter.get = (id) => jobs.get(id);
1206
+ emitter.add = (input) => {
1207
+ const now = Date.now();
1208
+ const job = {
1209
+ id: generateId(),
1210
+ ...input,
1211
+ createdAtMs: now,
1212
+ updatedAtMs: now,
1213
+ state: input.state || {},
1214
+ };
1215
+ jobs.set(job.id, job);
1216
+ logger_1.logger.info({ jobId: job.id, name: job.name }, 'Cron job added');
1217
+ if (running && job.enabled) {
1218
+ scheduleJob(job);
1219
+ }
1220
+ persistJob(job);
1221
+ return job;
1222
+ };
1223
+ emitter.update = (id, patch) => {
1224
+ const job = jobs.get(id);
1225
+ if (!job)
1226
+ return null;
1227
+ const updated = {
1228
+ ...job,
1229
+ ...patch,
1230
+ id: job.id,
1231
+ createdAtMs: job.createdAtMs,
1232
+ updatedAtMs: Date.now(),
1233
+ state: { ...job.state, ...patch.state },
1234
+ };
1235
+ jobs.set(id, updated);
1236
+ logger_1.logger.info({ jobId: id, name: updated.name }, 'Cron job updated');
1237
+ if (running) {
1238
+ scheduleJob(updated);
1239
+ }
1240
+ persistJob(updated);
1241
+ return updated;
1242
+ };
1243
+ emitter.remove = (id) => {
1244
+ const job = jobs.get(id);
1245
+ if (!job)
1246
+ return false;
1247
+ const timer = timers.get(id);
1248
+ if (timer) {
1249
+ clearTimeout(timer);
1250
+ timers.delete(id);
1251
+ }
1252
+ jobs.delete(id);
1253
+ deps.db.deleteCronJob(id);
1254
+ logger_1.logger.info({ jobId: id, name: job.name }, 'Cron job removed');
1255
+ return true;
1256
+ };
1257
+ emitter.run = async (id, mode = 'due') => {
1258
+ const job = jobs.get(id);
1259
+ if (!job)
1260
+ return false;
1261
+ if (mode === 'due') {
1262
+ const nextRun = calculateNextRun(job.schedule, job.state.lastRunAtMs);
1263
+ if (nextRun > Date.now()) {
1264
+ return false;
1265
+ }
1266
+ }
1267
+ await executeJobInternal(job);
1268
+ return true;
1269
+ };
1270
+ return emitter;
1271
+ }
1272
+ function createCronManager(db, feeds, sendMessage) {
1273
+ const service = createCronService({ db, feeds, sendMessage });
1274
+ return {
1275
+ start() {
1276
+ service.start();
1277
+ },
1278
+ stop() {
1279
+ service.stop();
1280
+ },
1281
+ };
1282
+ }
1283
+ //# sourceMappingURL=index.js.map