keyring-agent-core 0.2.1 → 0.2.3

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 (417) hide show
  1. package/dist/index.d.ts +6692 -27
  2. package/dist/index.js +877 -70
  3. package/package.json +6 -4
  4. package/dist/agent/AgentCore.d.ts +0 -256
  5. package/dist/agent/AgentCore.d.ts.map +0 -1
  6. package/dist/agent/AgentCore.js +0 -1093
  7. package/dist/agent/AgentCore.js.map +0 -1
  8. package/dist/agent/QueryRewriter.d.ts +0 -84
  9. package/dist/agent/QueryRewriter.d.ts.map +0 -1
  10. package/dist/agent/QueryRewriter.js +0 -306
  11. package/dist/agent/QueryRewriter.js.map +0 -1
  12. package/dist/agent/Router.d.ts +0 -33
  13. package/dist/agent/Router.d.ts.map +0 -1
  14. package/dist/agent/Router.js +0 -229
  15. package/dist/agent/Router.js.map +0 -1
  16. package/dist/agent/Subagent.d.ts +0 -80
  17. package/dist/agent/Subagent.d.ts.map +0 -1
  18. package/dist/agent/Subagent.js +0 -272
  19. package/dist/agent/Subagent.js.map +0 -1
  20. package/dist/agent/Synthesizer.d.ts +0 -11
  21. package/dist/agent/Synthesizer.d.ts.map +0 -1
  22. package/dist/agent/Synthesizer.js +0 -86
  23. package/dist/agent/Synthesizer.js.map +0 -1
  24. package/dist/agent/chatGraph.d.ts +0 -364
  25. package/dist/agent/chatGraph.d.ts.map +0 -1
  26. package/dist/agent/chatGraph.js +0 -184
  27. package/dist/agent/chatGraph.js.map +0 -1
  28. package/dist/agent/index.d.ts +0 -10
  29. package/dist/agent/index.d.ts.map +0 -1
  30. package/dist/agent/index.js +0 -24
  31. package/dist/agent/index.js.map +0 -1
  32. package/dist/agent/subagents/AiAgent.d.ts +0 -6
  33. package/dist/agent/subagents/AiAgent.d.ts.map +0 -1
  34. package/dist/agent/subagents/AiAgent.js +0 -52
  35. package/dist/agent/subagents/AiAgent.js.map +0 -1
  36. package/dist/agent/subagents/NftAgent.d.ts +0 -6
  37. package/dist/agent/subagents/NftAgent.d.ts.map +0 -1
  38. package/dist/agent/subagents/NftAgent.js +0 -79
  39. package/dist/agent/subagents/NftAgent.js.map +0 -1
  40. package/dist/agent/subagents/PoolAgent.d.ts +0 -6
  41. package/dist/agent/subagents/PoolAgent.d.ts.map +0 -1
  42. package/dist/agent/subagents/PoolAgent.js +0 -184
  43. package/dist/agent/subagents/PoolAgent.js.map +0 -1
  44. package/dist/agent/subagents/PoolSubgraphAgent.d.ts +0 -6
  45. package/dist/agent/subagents/PoolSubgraphAgent.d.ts.map +0 -1
  46. package/dist/agent/subagents/PoolSubgraphAgent.js +0 -117
  47. package/dist/agent/subagents/PoolSubgraphAgent.js.map +0 -1
  48. package/dist/agent/subagents/TokenAgent.d.ts +0 -6
  49. package/dist/agent/subagents/TokenAgent.d.ts.map +0 -1
  50. package/dist/agent/subagents/TokenAgent.js +0 -76
  51. package/dist/agent/subagents/TokenAgent.js.map +0 -1
  52. package/dist/agent/subagents/WalletActionAgent.d.ts +0 -6
  53. package/dist/agent/subagents/WalletActionAgent.d.ts.map +0 -1
  54. package/dist/agent/subagents/WalletActionAgent.js +0 -55
  55. package/dist/agent/subagents/WalletActionAgent.js.map +0 -1
  56. package/dist/agent/subagents/WalletAgent.d.ts +0 -6
  57. package/dist/agent/subagents/WalletAgent.d.ts.map +0 -1
  58. package/dist/agent/subagents/WalletAgent.js +0 -93
  59. package/dist/agent/subagents/WalletAgent.js.map +0 -1
  60. package/dist/agent/subagents/index.d.ts +0 -34
  61. package/dist/agent/subagents/index.d.ts.map +0 -1
  62. package/dist/agent/subagents/index.js +0 -69
  63. package/dist/agent/subagents/index.js.map +0 -1
  64. package/dist/constants/abi.d.ts +0 -551
  65. package/dist/constants/abi.d.ts.map +0 -1
  66. package/dist/constants/abi.js +0 -690
  67. package/dist/constants/abi.js.map +0 -1
  68. package/dist/functions/pool.d.ts +0 -25
  69. package/dist/functions/pool.d.ts.map +0 -1
  70. package/dist/functions/pool.js +0 -151
  71. package/dist/functions/pool.js.map +0 -1
  72. package/dist/functions/web3.d.ts +0 -31
  73. package/dist/functions/web3.d.ts.map +0 -1
  74. package/dist/functions/web3.js +0 -232
  75. package/dist/functions/web3.js.map +0 -1
  76. package/dist/index.d.ts.map +0 -1
  77. package/dist/index.js.map +0 -1
  78. package/dist/llm/GeminiProvider.d.ts +0 -16
  79. package/dist/llm/GeminiProvider.d.ts.map +0 -1
  80. package/dist/llm/GeminiProvider.js +0 -329
  81. package/dist/llm/GeminiProvider.js.map +0 -1
  82. package/dist/llm/index.d.ts +0 -2
  83. package/dist/llm/index.d.ts.map +0 -1
  84. package/dist/llm/index.js +0 -6
  85. package/dist/llm/index.js.map +0 -1
  86. package/dist/memory/ChatHistory.d.ts +0 -83
  87. package/dist/memory/ChatHistory.d.ts.map +0 -1
  88. package/dist/memory/ChatHistory.js +0 -143
  89. package/dist/memory/ChatHistory.js.map +0 -1
  90. package/dist/memory/KnowledgeBase.d.ts +0 -38
  91. package/dist/memory/KnowledgeBase.d.ts.map +0 -1
  92. package/dist/memory/KnowledgeBase.js +0 -139
  93. package/dist/memory/KnowledgeBase.js.map +0 -1
  94. package/dist/memory/Summarizer.d.ts +0 -12
  95. package/dist/memory/Summarizer.d.ts.map +0 -1
  96. package/dist/memory/Summarizer.js +0 -39
  97. package/dist/memory/Summarizer.js.map +0 -1
  98. package/dist/memory/UpstashKnowledgeBase.d.ts +0 -124
  99. package/dist/memory/UpstashKnowledgeBase.d.ts.map +0 -1
  100. package/dist/memory/UpstashKnowledgeBase.js +0 -152
  101. package/dist/memory/UpstashKnowledgeBase.js.map +0 -1
  102. package/dist/memory/historyUtils.d.ts +0 -58
  103. package/dist/memory/historyUtils.d.ts.map +0 -1
  104. package/dist/memory/historyUtils.js +0 -190
  105. package/dist/memory/historyUtils.js.map +0 -1
  106. package/dist/memory/index.d.ts +0 -7
  107. package/dist/memory/index.d.ts.map +0 -1
  108. package/dist/memory/index.js +0 -12
  109. package/dist/memory/index.js.map +0 -1
  110. package/dist/memory/ingestKnowledgeBase.d.ts +0 -17
  111. package/dist/memory/ingestKnowledgeBase.d.ts.map +0 -1
  112. package/dist/memory/ingestKnowledgeBase.js +0 -35
  113. package/dist/memory/ingestKnowledgeBase.js.map +0 -1
  114. package/dist/services/MoralisService.d.ts +0 -1328
  115. package/dist/services/MoralisService.d.ts.map +0 -1
  116. package/dist/services/MoralisService.js +0 -1239
  117. package/dist/services/MoralisService.js.map +0 -1
  118. package/dist/services/PantographService.d.ts +0 -98
  119. package/dist/services/PantographService.d.ts.map +0 -1
  120. package/dist/services/PantographService.js +0 -451
  121. package/dist/services/PantographService.js.map +0 -1
  122. package/dist/services/PoolService.d.ts +0 -238
  123. package/dist/services/PoolService.d.ts.map +0 -1
  124. package/dist/services/PoolService.js +0 -485
  125. package/dist/services/PoolService.js.map +0 -1
  126. package/dist/services/UniswapService.d.ts +0 -289
  127. package/dist/services/UniswapService.d.ts.map +0 -1
  128. package/dist/services/UniswapService.js +0 -585
  129. package/dist/services/UniswapService.js.map +0 -1
  130. package/dist/services/UniswapSubgraphService.d.ts +0 -144
  131. package/dist/services/UniswapSubgraphService.d.ts.map +0 -1
  132. package/dist/services/UniswapSubgraphService.js +0 -606
  133. package/dist/services/UniswapSubgraphService.js.map +0 -1
  134. package/dist/services/rpc.d.ts +0 -35
  135. package/dist/services/rpc.d.ts.map +0 -1
  136. package/dist/services/rpc.js +0 -110
  137. package/dist/services/rpc.js.map +0 -1
  138. package/dist/services/swap/BaseSwapService.d.ts +0 -17
  139. package/dist/services/swap/BaseSwapService.d.ts.map +0 -1
  140. package/dist/services/swap/BaseSwapService.js +0 -19
  141. package/dist/services/swap/BaseSwapService.js.map +0 -1
  142. package/dist/services/swap/DebridgeAdapter.d.ts +0 -37
  143. package/dist/services/swap/DebridgeAdapter.d.ts.map +0 -1
  144. package/dist/services/swap/DebridgeAdapter.js +0 -243
  145. package/dist/services/swap/DebridgeAdapter.js.map +0 -1
  146. package/dist/services/swap/RelayAdapter.d.ts +0 -19
  147. package/dist/services/swap/RelayAdapter.d.ts.map +0 -1
  148. package/dist/services/swap/RelayAdapter.js +0 -189
  149. package/dist/services/swap/RelayAdapter.js.map +0 -1
  150. package/dist/services/swap/SwapServiceFactory.d.ts +0 -25
  151. package/dist/services/swap/SwapServiceFactory.d.ts.map +0 -1
  152. package/dist/services/swap/SwapServiceFactory.js +0 -79
  153. package/dist/services/swap/SwapServiceFactory.js.map +0 -1
  154. package/dist/services/swap/addresses.d.ts +0 -3
  155. package/dist/services/swap/addresses.d.ts.map +0 -1
  156. package/dist/services/swap/addresses.js +0 -68
  157. package/dist/services/swap/addresses.js.map +0 -1
  158. package/dist/services/swap/affiliate.d.ts +0 -17
  159. package/dist/services/swap/affiliate.d.ts.map +0 -1
  160. package/dist/services/swap/affiliate.js +0 -126
  161. package/dist/services/swap/affiliate.js.map +0 -1
  162. package/dist/services/swap/config.d.ts +0 -9
  163. package/dist/services/swap/config.d.ts.map +0 -1
  164. package/dist/services/swap/config.js +0 -19
  165. package/dist/services/swap/config.js.map +0 -1
  166. package/dist/services/swap/index.d.ts +0 -10
  167. package/dist/services/swap/index.d.ts.map +0 -1
  168. package/dist/services/swap/index.js +0 -22
  169. package/dist/services/swap/index.js.map +0 -1
  170. package/dist/services/swap/types.d.ts +0 -89
  171. package/dist/services/swap/types.d.ts.map +0 -1
  172. package/dist/services/swap/types.js +0 -6
  173. package/dist/services/swap/types.js.map +0 -1
  174. package/dist/tools/BaseTool.d.ts +0 -15
  175. package/dist/tools/BaseTool.d.ts.map +0 -1
  176. package/dist/tools/BaseTool.js +0 -35
  177. package/dist/tools/BaseTool.js.map +0 -1
  178. package/dist/tools/ToolRegistry.d.ts +0 -27
  179. package/dist/tools/ToolRegistry.d.ts.map +0 -1
  180. package/dist/tools/ToolRegistry.js +0 -80
  181. package/dist/tools/ToolRegistry.js.map +0 -1
  182. package/dist/tools/builtin/ai/GeminiSearchAiTool.d.ts +0 -36
  183. package/dist/tools/builtin/ai/GeminiSearchAiTool.d.ts.map +0 -1
  184. package/dist/tools/builtin/ai/GeminiSearchAiTool.js +0 -91
  185. package/dist/tools/builtin/ai/GeminiSearchAiTool.js.map +0 -1
  186. package/dist/tools/builtin/ai/index.d.ts +0 -3
  187. package/dist/tools/builtin/ai/index.d.ts.map +0 -1
  188. package/dist/tools/builtin/ai/index.js +0 -6
  189. package/dist/tools/builtin/ai/index.js.map +0 -1
  190. package/dist/tools/builtin/index.d.ts +0 -8
  191. package/dist/tools/builtin/index.d.ts.map +0 -1
  192. package/dist/tools/builtin/index.js +0 -24
  193. package/dist/tools/builtin/index.js.map +0 -1
  194. package/dist/tools/builtin/nft/BaseNftMessageTool.d.ts +0 -35
  195. package/dist/tools/builtin/nft/BaseNftMessageTool.d.ts.map +0 -1
  196. package/dist/tools/builtin/nft/BaseNftMessageTool.js +0 -45
  197. package/dist/tools/builtin/nft/BaseNftMessageTool.js.map +0 -1
  198. package/dist/tools/builtin/nft/NFTContractInfoTool.d.ts +0 -15
  199. package/dist/tools/builtin/nft/NFTContractInfoTool.d.ts.map +0 -1
  200. package/dist/tools/builtin/nft/NFTContractInfoTool.js +0 -19
  201. package/dist/tools/builtin/nft/NFTContractInfoTool.js.map +0 -1
  202. package/dist/tools/builtin/nft/NFTMetadataTool.d.ts +0 -15
  203. package/dist/tools/builtin/nft/NFTMetadataTool.d.ts.map +0 -1
  204. package/dist/tools/builtin/nft/NFTMetadataTool.js +0 -20
  205. package/dist/tools/builtin/nft/NFTMetadataTool.js.map +0 -1
  206. package/dist/tools/builtin/nft/SendNftTool.d.ts +0 -14
  207. package/dist/tools/builtin/nft/SendNftTool.d.ts.map +0 -1
  208. package/dist/tools/builtin/nft/SendNftTool.js +0 -20
  209. package/dist/tools/builtin/nft/SendNftTool.js.map +0 -1
  210. package/dist/tools/builtin/nft/WalletNFTsTool.d.ts +0 -15
  211. package/dist/tools/builtin/nft/WalletNFTsTool.d.ts.map +0 -1
  212. package/dist/tools/builtin/nft/WalletNFTsTool.js +0 -20
  213. package/dist/tools/builtin/nft/WalletNFTsTool.js.map +0 -1
  214. package/dist/tools/builtin/nft/index.d.ts +0 -7
  215. package/dist/tools/builtin/nft/index.d.ts.map +0 -1
  216. package/dist/tools/builtin/nft/index.js +0 -10
  217. package/dist/tools/builtin/nft/index.js.map +0 -1
  218. package/dist/tools/builtin/pool/EstimatePoolYieldTool.d.ts +0 -124
  219. package/dist/tools/builtin/pool/EstimatePoolYieldTool.d.ts.map +0 -1
  220. package/dist/tools/builtin/pool/EstimatePoolYieldTool.js +0 -236
  221. package/dist/tools/builtin/pool/EstimatePoolYieldTool.js.map +0 -1
  222. package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.d.ts +0 -128
  223. package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.d.ts.map +0 -1
  224. package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.js +0 -520
  225. package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.js.map +0 -1
  226. package/dist/tools/builtin/pool/PoolByAddressTool.d.ts +0 -127
  227. package/dist/tools/builtin/pool/PoolByAddressTool.d.ts.map +0 -1
  228. package/dist/tools/builtin/pool/PoolByAddressTool.js +0 -238
  229. package/dist/tools/builtin/pool/PoolByAddressTool.js.map +0 -1
  230. package/dist/tools/builtin/pool/PoolDetailTool.d.ts +0 -127
  231. package/dist/tools/builtin/pool/PoolDetailTool.d.ts.map +0 -1
  232. package/dist/tools/builtin/pool/PoolDetailTool.js +0 -273
  233. package/dist/tools/builtin/pool/PoolDetailTool.js.map +0 -1
  234. package/dist/tools/builtin/pool/PoolSearchTool.d.ts +0 -50
  235. package/dist/tools/builtin/pool/PoolSearchTool.d.ts.map +0 -1
  236. package/dist/tools/builtin/pool/PoolSearchTool.js +0 -160
  237. package/dist/tools/builtin/pool/PoolSearchTool.js.map +0 -1
  238. package/dist/tools/builtin/pool/PreviewAddLiquidityTool.d.ts +0 -124
  239. package/dist/tools/builtin/pool/PreviewAddLiquidityTool.d.ts.map +0 -1
  240. package/dist/tools/builtin/pool/PreviewAddLiquidityTool.js +0 -382
  241. package/dist/tools/builtin/pool/PreviewAddLiquidityTool.js.map +0 -1
  242. package/dist/tools/builtin/pool/TopPoolsTool.d.ts +0 -68
  243. package/dist/tools/builtin/pool/TopPoolsTool.d.ts.map +0 -1
  244. package/dist/tools/builtin/pool/TopPoolsTool.js +0 -159
  245. package/dist/tools/builtin/pool/TopPoolsTool.js.map +0 -1
  246. package/dist/tools/builtin/pool/index.d.ts +0 -15
  247. package/dist/tools/builtin/pool/index.d.ts.map +0 -1
  248. package/dist/tools/builtin/pool/index.js +0 -18
  249. package/dist/tools/builtin/pool/index.js.map +0 -1
  250. package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.d.ts +0 -54
  251. package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.d.ts.map +0 -1
  252. package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.js +0 -98
  253. package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.js.map +0 -1
  254. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.d.ts +0 -63
  255. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.d.ts.map +0 -1
  256. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.js +0 -82
  257. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.js.map +0 -1
  258. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.d.ts +0 -79
  259. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.d.ts.map +0 -1
  260. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.js +0 -97
  261. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.js.map +0 -1
  262. package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.d.ts +0 -77
  263. package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.d.ts.map +0 -1
  264. package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.js +0 -190
  265. package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.js.map +0 -1
  266. package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.d.ts +0 -107
  267. package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.d.ts.map +0 -1
  268. package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.js +0 -92
  269. package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.js.map +0 -1
  270. package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.d.ts +0 -56
  271. package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.d.ts.map +0 -1
  272. package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.js +0 -94
  273. package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.js.map +0 -1
  274. package/dist/tools/builtin/pool-subgraph/index.d.ts +0 -13
  275. package/dist/tools/builtin/pool-subgraph/index.d.ts.map +0 -1
  276. package/dist/tools/builtin/pool-subgraph/index.js +0 -18
  277. package/dist/tools/builtin/pool-subgraph/index.js.map +0 -1
  278. package/dist/tools/builtin/token/TokenAnalyticsTool.d.ts +0 -71
  279. package/dist/tools/builtin/token/TokenAnalyticsTool.d.ts.map +0 -1
  280. package/dist/tools/builtin/token/TokenAnalyticsTool.js +0 -147
  281. package/dist/tools/builtin/token/TokenAnalyticsTool.js.map +0 -1
  282. package/dist/tools/builtin/token/TokenHoldersTool.d.ts +0 -81
  283. package/dist/tools/builtin/token/TokenHoldersTool.d.ts.map +0 -1
  284. package/dist/tools/builtin/token/TokenHoldersTool.js +0 -139
  285. package/dist/tools/builtin/token/TokenHoldersTool.js.map +0 -1
  286. package/dist/tools/builtin/token/TokenInfoTool.d.ts +0 -40
  287. package/dist/tools/builtin/token/TokenInfoTool.d.ts.map +0 -1
  288. package/dist/tools/builtin/token/TokenInfoTool.js +0 -221
  289. package/dist/tools/builtin/token/TokenInfoTool.js.map +0 -1
  290. package/dist/tools/builtin/token/TokenScoreTool.d.ts +0 -63
  291. package/dist/tools/builtin/token/TokenScoreTool.d.ts.map +0 -1
  292. package/dist/tools/builtin/token/TokenScoreTool.js +0 -148
  293. package/dist/tools/builtin/token/TokenScoreTool.js.map +0 -1
  294. package/dist/tools/builtin/token/TopGainersTool.d.ts +0 -37
  295. package/dist/tools/builtin/token/TopGainersTool.d.ts.map +0 -1
  296. package/dist/tools/builtin/token/TopGainersTool.js +0 -100
  297. package/dist/tools/builtin/token/TopGainersTool.js.map +0 -1
  298. package/dist/tools/builtin/token/TopLosersTool.d.ts +0 -66
  299. package/dist/tools/builtin/token/TopLosersTool.d.ts.map +0 -1
  300. package/dist/tools/builtin/token/TopLosersTool.js +0 -129
  301. package/dist/tools/builtin/token/TopLosersTool.js.map +0 -1
  302. package/dist/tools/builtin/token/TrendingTokensTool.d.ts +0 -39
  303. package/dist/tools/builtin/token/TrendingTokensTool.d.ts.map +0 -1
  304. package/dist/tools/builtin/token/TrendingTokensTool.js +0 -83
  305. package/dist/tools/builtin/token/TrendingTokensTool.js.map +0 -1
  306. package/dist/tools/builtin/token/index.d.ts +0 -13
  307. package/dist/tools/builtin/token/index.d.ts.map +0 -1
  308. package/dist/tools/builtin/token/index.js +0 -16
  309. package/dist/tools/builtin/token/index.js.map +0 -1
  310. package/dist/tools/builtin/wallet/TransactionByHashTool.d.ts +0 -70
  311. package/dist/tools/builtin/wallet/TransactionByHashTool.d.ts.map +0 -1
  312. package/dist/tools/builtin/wallet/TransactionByHashTool.js +0 -111
  313. package/dist/tools/builtin/wallet/TransactionByHashTool.js.map +0 -1
  314. package/dist/tools/builtin/wallet/WalletApprovalsTool.d.ts +0 -107
  315. package/dist/tools/builtin/wallet/WalletApprovalsTool.d.ts.map +0 -1
  316. package/dist/tools/builtin/wallet/WalletApprovalsTool.js +0 -164
  317. package/dist/tools/builtin/wallet/WalletApprovalsTool.js.map +0 -1
  318. package/dist/tools/builtin/wallet/WalletDefiPositionsTool.d.ts +0 -61
  319. package/dist/tools/builtin/wallet/WalletDefiPositionsTool.d.ts.map +0 -1
  320. package/dist/tools/builtin/wallet/WalletDefiPositionsTool.js +0 -100
  321. package/dist/tools/builtin/wallet/WalletDefiPositionsTool.js.map +0 -1
  322. package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.d.ts +0 -68
  323. package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.d.ts.map +0 -1
  324. package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.js +0 -115
  325. package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.js.map +0 -1
  326. package/dist/tools/builtin/wallet/WalletDefiSummaryTool.d.ts +0 -50
  327. package/dist/tools/builtin/wallet/WalletDefiSummaryTool.d.ts.map +0 -1
  328. package/dist/tools/builtin/wallet/WalletDefiSummaryTool.js +0 -80
  329. package/dist/tools/builtin/wallet/WalletDefiSummaryTool.js.map +0 -1
  330. package/dist/tools/builtin/wallet/WalletHistoryTool.d.ts +0 -31
  331. package/dist/tools/builtin/wallet/WalletHistoryTool.d.ts.map +0 -1
  332. package/dist/tools/builtin/wallet/WalletHistoryTool.js +0 -154
  333. package/dist/tools/builtin/wallet/WalletHistoryTool.js.map +0 -1
  334. package/dist/tools/builtin/wallet/WalletNetWorthTool.d.ts +0 -44
  335. package/dist/tools/builtin/wallet/WalletNetWorthTool.d.ts.map +0 -1
  336. package/dist/tools/builtin/wallet/WalletNetWorthTool.js +0 -122
  337. package/dist/tools/builtin/wallet/WalletNetWorthTool.js.map +0 -1
  338. package/dist/tools/builtin/wallet/WalletNftTransfersTool.d.ts +0 -86
  339. package/dist/tools/builtin/wallet/WalletNftTransfersTool.d.ts.map +0 -1
  340. package/dist/tools/builtin/wallet/WalletNftTransfersTool.js +0 -265
  341. package/dist/tools/builtin/wallet/WalletNftTransfersTool.js.map +0 -1
  342. package/dist/tools/builtin/wallet/WalletPnlSummaryTool.d.ts +0 -43
  343. package/dist/tools/builtin/wallet/WalletPnlSummaryTool.d.ts.map +0 -1
  344. package/dist/tools/builtin/wallet/WalletPnlSummaryTool.js +0 -89
  345. package/dist/tools/builtin/wallet/WalletPnlSummaryTool.js.map +0 -1
  346. package/dist/tools/builtin/wallet/WalletPnlTool.d.ts +0 -43
  347. package/dist/tools/builtin/wallet/WalletPnlTool.d.ts.map +0 -1
  348. package/dist/tools/builtin/wallet/WalletPnlTool.js +0 -175
  349. package/dist/tools/builtin/wallet/WalletPnlTool.js.map +0 -1
  350. package/dist/tools/builtin/wallet/WalletTokenBalancesTool.d.ts +0 -35
  351. package/dist/tools/builtin/wallet/WalletTokenBalancesTool.d.ts.map +0 -1
  352. package/dist/tools/builtin/wallet/WalletTokenBalancesTool.js +0 -68
  353. package/dist/tools/builtin/wallet/WalletTokenBalancesTool.js.map +0 -1
  354. package/dist/tools/builtin/wallet/WalletTokenTransfersTool.d.ts +0 -109
  355. package/dist/tools/builtin/wallet/WalletTokenTransfersTool.d.ts.map +0 -1
  356. package/dist/tools/builtin/wallet/WalletTokenTransfersTool.js +0 -354
  357. package/dist/tools/builtin/wallet/WalletTokenTransfersTool.js.map +0 -1
  358. package/dist/tools/builtin/wallet/index.d.ts +0 -28
  359. package/dist/tools/builtin/wallet/index.d.ts.map +0 -1
  360. package/dist/tools/builtin/wallet/index.js +0 -32
  361. package/dist/tools/builtin/wallet/index.js.map +0 -1
  362. package/dist/tools/builtin/wallet-action/ApproveTokenTool.d.ts +0 -25
  363. package/dist/tools/builtin/wallet-action/ApproveTokenTool.d.ts.map +0 -1
  364. package/dist/tools/builtin/wallet-action/ApproveTokenTool.js +0 -98
  365. package/dist/tools/builtin/wallet-action/ApproveTokenTool.js.map +0 -1
  366. package/dist/tools/builtin/wallet-action/BaseWalletActionTool.d.ts +0 -211
  367. package/dist/tools/builtin/wallet-action/BaseWalletActionTool.d.ts.map +0 -1
  368. package/dist/tools/builtin/wallet-action/BaseWalletActionTool.js +0 -499
  369. package/dist/tools/builtin/wallet-action/BaseWalletActionTool.js.map +0 -1
  370. package/dist/tools/builtin/wallet-action/BuyTokenTool.d.ts +0 -240
  371. package/dist/tools/builtin/wallet-action/BuyTokenTool.d.ts.map +0 -1
  372. package/dist/tools/builtin/wallet-action/BuyTokenTool.js +0 -1257
  373. package/dist/tools/builtin/wallet-action/BuyTokenTool.js.map +0 -1
  374. package/dist/tools/builtin/wallet-action/SendNativeTool.d.ts +0 -41
  375. package/dist/tools/builtin/wallet-action/SendNativeTool.d.ts.map +0 -1
  376. package/dist/tools/builtin/wallet-action/SendNativeTool.js +0 -127
  377. package/dist/tools/builtin/wallet-action/SendNativeTool.js.map +0 -1
  378. package/dist/tools/builtin/wallet-action/SendTokenTool.d.ts +0 -63
  379. package/dist/tools/builtin/wallet-action/SendTokenTool.d.ts.map +0 -1
  380. package/dist/tools/builtin/wallet-action/SendTokenTool.js +0 -294
  381. package/dist/tools/builtin/wallet-action/SendTokenTool.js.map +0 -1
  382. package/dist/tools/builtin/wallet-action/SwapTokenTool.d.ts +0 -247
  383. package/dist/tools/builtin/wallet-action/SwapTokenTool.d.ts.map +0 -1
  384. package/dist/tools/builtin/wallet-action/SwapTokenTool.js +0 -1258
  385. package/dist/tools/builtin/wallet-action/SwapTokenTool.js.map +0 -1
  386. package/dist/tools/builtin/wallet-action/UnwrapNativeTool.d.ts +0 -20
  387. package/dist/tools/builtin/wallet-action/UnwrapNativeTool.d.ts.map +0 -1
  388. package/dist/tools/builtin/wallet-action/UnwrapNativeTool.js +0 -36
  389. package/dist/tools/builtin/wallet-action/UnwrapNativeTool.js.map +0 -1
  390. package/dist/tools/builtin/wallet-action/WrapNativeTool.d.ts +0 -23
  391. package/dist/tools/builtin/wallet-action/WrapNativeTool.d.ts.map +0 -1
  392. package/dist/tools/builtin/wallet-action/WrapNativeTool.js +0 -54
  393. package/dist/tools/builtin/wallet-action/WrapNativeTool.js.map +0 -1
  394. package/dist/tools/builtin/wallet-action/amountSpec.d.ts +0 -62
  395. package/dist/tools/builtin/wallet-action/amountSpec.d.ts.map +0 -1
  396. package/dist/tools/builtin/wallet-action/amountSpec.js +0 -93
  397. package/dist/tools/builtin/wallet-action/amountSpec.js.map +0 -1
  398. package/dist/tools/builtin/wallet-action/gasReserve.d.ts +0 -42
  399. package/dist/tools/builtin/wallet-action/gasReserve.d.ts.map +0 -1
  400. package/dist/tools/builtin/wallet-action/gasReserve.js +0 -103
  401. package/dist/tools/builtin/wallet-action/gasReserve.js.map +0 -1
  402. package/dist/tools/builtin/wallet-action/index.d.ts +0 -9
  403. package/dist/tools/builtin/wallet-action/index.d.ts.map +0 -1
  404. package/dist/tools/builtin/wallet-action/index.js +0 -20
  405. package/dist/tools/builtin/wallet-action/index.js.map +0 -1
  406. package/dist/tools/chainResolver.d.ts +0 -98
  407. package/dist/tools/chainResolver.d.ts.map +0 -1
  408. package/dist/tools/chainResolver.js +0 -302
  409. package/dist/tools/chainResolver.js.map +0 -1
  410. package/dist/tools/index.d.ts +0 -4
  411. package/dist/tools/index.d.ts.map +0 -1
  412. package/dist/tools/index.js +0 -23
  413. package/dist/tools/index.js.map +0 -1
  414. package/dist/types/index.d.ts +0 -777
  415. package/dist/types/index.d.ts.map +0 -1
  416. package/dist/types/index.js +0 -6
  417. package/dist/types/index.js.map +0 -1
@@ -1,184 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildChatGraph = buildChatGraph;
4
- const langgraph_1 = require("@langchain/langgraph");
5
- const chainResolver_1 = require("../tools/chainResolver");
6
- /**
7
- * Per-turn state. Each channel maps to a value that flows between nodes —
8
- * the LangGraph replacement for the local variables of the old `chat()`.
9
- * `subResults` is the only fan-in channel (parallel subagents), so it uses a
10
- * concat reducer; everything else is single-writer (last value wins).
11
- */
12
- const last = (fallback) => ({ reducer: (_, b) => b, default: fallback });
13
- const TurnState = langgraph_1.Annotation.Root({
14
- // inputs
15
- userMessage: (0, langgraph_1.Annotation)(),
16
- doSuggest: (0, langgraph_1.Annotation)(last(() => true)),
17
- overrideLang: (0, langgraph_1.Annotation)(last(() => '')),
18
- // setup
19
- conversationMessages: (0, langgraph_1.Annotation)(last(() => [])),
20
- lastSubagents: (0, langgraph_1.Annotation)(last(() => [])),
21
- messageId: (0, langgraph_1.Annotation)(last(() => '')),
22
- // rewrite
23
- rewrite: (0, langgraph_1.Annotation)(last(() => null)),
24
- effectiveQuery: (0, langgraph_1.Annotation)(last(() => '')),
25
- turnLanguage: (0, langgraph_1.Annotation)(last(() => '')),
26
- // kb
27
- kbContext: (0, langgraph_1.Annotation)(last(() => '')),
28
- // router
29
- decision: (0, langgraph_1.Annotation)(last(() => null)),
30
- // fan-out scratch (set per branch by Send)
31
- assignment: (0, langgraph_1.Annotation)(last(() => null)),
32
- assignmentIndex: (0, langgraph_1.Annotation)(last(() => 0)),
33
- // fan-in (parallel subagents append here)
34
- subResults: (0, langgraph_1.Annotation)({
35
- reducer: (a, b) => a.concat(b),
36
- default: () => [],
37
- }),
38
- // terminal
39
- response: (0, langgraph_1.Annotation)(last(() => null)),
40
- });
41
- /**
42
- * Build the compiled chat graph:
43
- *
44
- * START → setup → rewrite → kb ──(KB answered?)──▶ END
45
- * └─▶ route ──(no subagent)──▶ direct ─▶ END
46
- * └─(Send per subagent)─▶ subagent ─▶ synthesize ─▶ END
47
- *
48
- * Subagents fan out via the `Send` API (the standard LangGraph map-reduce) and
49
- * fan back into `synthesize`, exactly mirroring the old parallel dispatch.
50
- */
51
- function buildChatGraph(host) {
52
- // ---- nodes ----
53
- const setup = async (state) => {
54
- host.addUserMessage(state.userMessage);
55
- if (host.needsSummary())
56
- await host.compactHistory();
57
- const conversationMessages = host.conversationForTurn();
58
- const lastSubagents = host.lastAssistantSubagents(conversationMessages);
59
- if (host.debug && lastSubagents.length > 0) {
60
- console.log(`[AgentCore] previous turn handled by: ${lastSubagents.join(', ')}`);
61
- }
62
- return { conversationMessages, lastSubagents, messageId: host.generateMessageId() };
63
- };
64
- const rewrite = async (state) => {
65
- const rw = await host.rewrite(state.userMessage, state.conversationMessages, state.lastSubagents);
66
- const turnLanguage = state.overrideLang || rw.language || '';
67
- return { rewrite: rw, effectiveQuery: rw.rewrittenQuery, turnLanguage };
68
- };
69
- const kb = async (state) => {
70
- const rw = state.rewrite;
71
- // Follow-ups search with the rewritten query; self-contained turns search
72
- // with the original message (closest to what was embedded at upsert time).
73
- const kbQuery = rw.isFollowUp ? state.effectiveQuery : state.userMessage;
74
- const hits = await host.searchKB(kbQuery);
75
- const kbContext = host.formatKBContext(hits);
76
- const kbAnswer = await host.tryAnswerFromKB(state.userMessage, hits, kbContext, state.messageId);
77
- if (kbAnswer) {
78
- return { kbContext, response: { ...kbAnswer, messageId: state.messageId, rewrite: rw } };
79
- }
80
- return { kbContext };
81
- };
82
- const route = async (state) => {
83
- const decision = await host.route(state.effectiveQuery, state.conversationMessages, host.subagentCards(), state.lastSubagents);
84
- return { decision };
85
- };
86
- const direct = async (state) => {
87
- const answer = await host.answerDirectly(state.effectiveQuery, state.conversationMessages, state.kbContext, state.doSuggest, state.messageId, state.rewrite?.needsWebSearch ?? false);
88
- return {
89
- response: { ...answer, messageId: state.messageId, routerDecision: state.decision, rewrite: state.rewrite },
90
- };
91
- };
92
- const subagent = async (state) => {
93
- const result = await host.runSubagent(state.assignment, state.conversationMessages, state.turnLanguage);
94
- return { subResults: [{ i: state.assignmentIndex, result }] };
95
- };
96
- const synthesize = async (state) => {
97
- // Restore the router's assignment order (parallel completion is unordered).
98
- const results = state.subResults
99
- .slice()
100
- .sort((a, b) => a.i - b.i)
101
- .map((e) => e.result);
102
- // Persist tool messages BEFORE synthesising so the synthesiser (and future
103
- // turns) can see this turn's tool data via history.
104
- host.persistToolMessages(results);
105
- const trace = host.mergeTrace(results);
106
- const synthesised = await host.synthesise(state.userMessage, trace, host.synthesiserHistory(), state.turnLanguage || undefined);
107
- const handledBy = results.map((r) => r.subagentName);
108
- const uiActions = host.collectUiActions(results, state.turnLanguage || null);
109
- const actionButtons = host.collectActionButtons(results, state.turnLanguage || null);
110
- const turnHasSuppressingTool = host.subResultsTriggerNoSuggestions(results);
111
- const finalised = await host.finaliseAnswer({
112
- userMessage: state.userMessage,
113
- answer: synthesised,
114
- subagents: handledBy,
115
- uiActions,
116
- actionButtons,
117
- messageId: state.messageId,
118
- }, { generateSuggestions: state.doSuggest && !turnHasSuppressingTool && actionButtons.length === 0 });
119
- return {
120
- response: {
121
- ...finalised,
122
- messageId: state.messageId,
123
- trace,
124
- routerDecision: state.decision,
125
- subagentResults: results,
126
- rewrite: state.rewrite,
127
- ...(uiActions.length > 0 ? { uiActions } : {}),
128
- ...(actionButtons.length > 0 ? { actionButtons } : {}),
129
- },
130
- };
131
- };
132
- /**
133
- * Terminal node for the unsupported-connected-chain case: emit a localized
134
- * "chain X is not supported" message instead of running chain-scoped tools.
135
- */
136
- const unsupportedChain = async (state) => {
137
- // The unsupported chain is whichever the request targets (named or connected).
138
- const raw = (state.rewrite?.mentionedChain || String(host.connectedChain() ?? '')).trim();
139
- const answer = await host.answerUnsupportedChain(raw, state.turnLanguage, state.messageId);
140
- return {
141
- response: { ...answer, messageId: state.messageId, routerDecision: state.decision, rewrite: state.rewrite },
142
- };
143
- };
144
- // ---- conditional edges ----
145
- const afterKb = (state) => (state.response ? langgraph_1.END : 'route');
146
- const dispatch = (state) => {
147
- const assignments = state.decision?.assignments ?? [];
148
- if (assignments.length === 0)
149
- return 'direct';
150
- // The chain this request targets: the one the user explicitly named this
151
- // turn (rewriter-extracted), else the connected wallet chain. Block
152
- // chain-scoped work when that chain is unsupported — this catches both
153
- // "connected to an unsupported chain" AND "asking about an unsupported
154
- // chain while connected to a supported one" ("balance on Unichain"). The
155
- // chain-agnostic ai-agent is exempt (general/informational answers).
156
- const chainScoped = assignments.some((a) => a.subagent !== 'ai-agent');
157
- const requested = (state.rewrite?.mentionedChain || host.connectedChain() || '').trim();
158
- if (chainScoped && requested !== '' && !(0, chainResolver_1.isSupportedChain)(requested)) {
159
- return 'unsupportedChain';
160
- }
161
- return assignments.map((a, i) => new langgraph_1.Send('subagent', { ...state, assignment: a, assignmentIndex: i }));
162
- };
163
- // ---- wiring ----
164
- return new langgraph_1.StateGraph(TurnState)
165
- .addNode('setup', setup)
166
- .addNode('contextualize', rewrite)
167
- .addNode('kb', kb)
168
- .addNode('route', route)
169
- .addNode('direct', direct)
170
- .addNode('subagent', subagent)
171
- .addNode('synthesize', synthesize)
172
- .addNode('unsupportedChain', unsupportedChain)
173
- .addEdge(langgraph_1.START, 'setup')
174
- .addEdge('setup', 'contextualize')
175
- .addEdge('contextualize', 'kb')
176
- .addConditionalEdges('kb', afterKb, ['route', langgraph_1.END])
177
- .addConditionalEdges('route', dispatch, ['direct', 'subagent', 'unsupportedChain'])
178
- .addEdge('unsupportedChain', langgraph_1.END)
179
- .addEdge('direct', langgraph_1.END)
180
- .addEdge('subagent', 'synthesize')
181
- .addEdge('synthesize', langgraph_1.END)
182
- .compile();
183
- }
184
- //# sourceMappingURL=chatGraph.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chatGraph.js","sourceRoot":"","sources":["../../src/agent/chatGraph.ts"],"names":[],"mappings":";;AA0JA,wCAwKC;AAlUD,oDAAgF;AAChF,0DAA0D;AAsG1D;;;;;GAKG;AACH,MAAM,IAAI,GAAG,CAAI,QAAiB,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAI,EAAE,CAAI,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;AAE3F,MAAM,SAAS,GAAG,sBAAU,CAAC,IAAI,CAAC;IAChC,SAAS;IACT,WAAW,EAAE,IAAA,sBAAU,GAAU;IACjC,SAAS,EAAE,IAAA,sBAAU,EAAU,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAChD,YAAY,EAAE,IAAA,sBAAU,EAAS,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IAChD,QAAQ;IACR,oBA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AAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,gBAAI,CAAC,UAAU,EAAE,EAAE,GAAG,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1G,CAAC,CAAC;IAEF,mBAAmB;IAEnB,OAAO,IAAI,sBAAU,CAAC,SAAS,CAAC;SAC7B,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC;SACvB,OAAO,CAAC,eAAe,EAAE,OAAO,CAAC;SACjC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;SACjB,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC;SACvB,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC;SACzB,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC;SAC7B,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC;SACjC,OAAO,CAAC,kBAAkB,EAAE,gBAAgB,CAAC;SAC7C,OAAO,CAAC,iBAAK,EAAE,OAAO,CAAC;SACvB,OAAO,CAAC,OAAO,EAAE,eAAe,CAAC;SACjC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;SAC9B,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,eAAG,CAAC,CAAC;SAClD,mBAAmB,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,kBAAkB,CAAC,CAAC;SAClF,OAAO,CAAC,kBAAkB,EAAE,eAAG,CAAC;SAChC,OAAO,CAAC,QAAQ,EAAE,eAAG,CAAC;SACtB,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC;SACjC,OAAO,CAAC,YAAY,EAAE,eAAG,CAAC;SAC1B,OAAO,EAAE,CAAC;AACf,CAAC"}
@@ -1,10 +0,0 @@
1
- export { AgentCore } from './AgentCore';
2
- export type { AgentResponse } from './AgentCore';
3
- export { Router } from './Router';
4
- export { Subagent } from './Subagent';
5
- export type { SubagentOptions, SubagentParams } from './Subagent';
6
- export { Synthesizer } from './Synthesizer';
7
- export { QueryRewriter } from './QueryRewriter';
8
- export type { RewriteResult, QueryRewriterOptions } from './QueryRewriter';
9
- export { createDefaultSubagents, createWalletAgent, createTokenAgent, createNftAgent, createAiAgent, WALLET_AGENT_TOOL_NAMES, TOKEN_AGENT_TOOL_NAMES, NFT_AGENT_TOOL_NAMES, AI_AGENT_TOOL_NAMES, } from './subagents';
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,aAAa,CAAC"}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AI_AGENT_TOOL_NAMES = exports.NFT_AGENT_TOOL_NAMES = exports.TOKEN_AGENT_TOOL_NAMES = exports.WALLET_AGENT_TOOL_NAMES = exports.createAiAgent = exports.createNftAgent = exports.createTokenAgent = exports.createWalletAgent = exports.createDefaultSubagents = exports.QueryRewriter = exports.Synthesizer = exports.Subagent = exports.Router = exports.AgentCore = void 0;
4
- var AgentCore_1 = require("./AgentCore");
5
- Object.defineProperty(exports, "AgentCore", { enumerable: true, get: function () { return AgentCore_1.AgentCore; } });
6
- var Router_1 = require("./Router");
7
- Object.defineProperty(exports, "Router", { enumerable: true, get: function () { return Router_1.Router; } });
8
- var Subagent_1 = require("./Subagent");
9
- Object.defineProperty(exports, "Subagent", { enumerable: true, get: function () { return Subagent_1.Subagent; } });
10
- var Synthesizer_1 = require("./Synthesizer");
11
- Object.defineProperty(exports, "Synthesizer", { enumerable: true, get: function () { return Synthesizer_1.Synthesizer; } });
12
- var QueryRewriter_1 = require("./QueryRewriter");
13
- Object.defineProperty(exports, "QueryRewriter", { enumerable: true, get: function () { return QueryRewriter_1.QueryRewriter; } });
14
- var subagents_1 = require("./subagents");
15
- Object.defineProperty(exports, "createDefaultSubagents", { enumerable: true, get: function () { return subagents_1.createDefaultSubagents; } });
16
- Object.defineProperty(exports, "createWalletAgent", { enumerable: true, get: function () { return subagents_1.createWalletAgent; } });
17
- Object.defineProperty(exports, "createTokenAgent", { enumerable: true, get: function () { return subagents_1.createTokenAgent; } });
18
- Object.defineProperty(exports, "createNftAgent", { enumerable: true, get: function () { return subagents_1.createNftAgent; } });
19
- Object.defineProperty(exports, "createAiAgent", { enumerable: true, get: function () { return subagents_1.createAiAgent; } });
20
- Object.defineProperty(exports, "WALLET_AGENT_TOOL_NAMES", { enumerable: true, get: function () { return subagents_1.WALLET_AGENT_TOOL_NAMES; } });
21
- Object.defineProperty(exports, "TOKEN_AGENT_TOOL_NAMES", { enumerable: true, get: function () { return subagents_1.TOKEN_AGENT_TOOL_NAMES; } });
22
- Object.defineProperty(exports, "NFT_AGENT_TOOL_NAMES", { enumerable: true, get: function () { return subagents_1.NFT_AGENT_TOOL_NAMES; } });
23
- Object.defineProperty(exports, "AI_AGENT_TOOL_NAMES", { enumerable: true, get: function () { return subagents_1.AI_AGENT_TOOL_NAMES; } });
24
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":";;;AAAA,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAElB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AAEjB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AAEtB,yCAUqB;AATnB,mHAAA,sBAAsB,OAAA;AACtB,8GAAA,iBAAiB,OAAA;AACjB,6GAAA,gBAAgB,OAAA;AAChB,2GAAA,cAAc,OAAA;AACd,0GAAA,aAAa,OAAA;AACb,oHAAA,uBAAuB,OAAA;AACvB,mHAAA,sBAAsB,OAAA;AACtB,iHAAA,oBAAoB,OAAA;AACpB,gHAAA,mBAAmB,OAAA"}
@@ -1,6 +0,0 @@
1
- import type { LLMProvider } from '../../types';
2
- import type { ToolRegistry } from '../../tools/ToolRegistry';
3
- import { Subagent, type SubagentOptions } from '../Subagent';
4
- export declare const AI_AGENT_TOOL_NAMES: readonly ["gemini-search-ai"];
5
- export declare function createAiAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
6
- //# sourceMappingURL=AiAgent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AiAgent.d.ts","sourceRoot":"","sources":["../../../src/agent/subagents/AiAgent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAuB7D,eAAO,MAAM,mBAAmB,+BAAgC,CAAC;AAEjE,wBAAgB,aAAa,CAAC,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,QAAQ,CAwB3G"}
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AI_AGENT_TOOL_NAMES = void 0;
4
- exports.createAiAgent = createAiAgent;
5
- const Subagent_1 = require("../Subagent");
6
- const AI_AGENT_PROMPT = `You are the Crypto AI fallback expert powered by a search-grounded Gemini model.
7
-
8
- You answer ANY blockchain / crypto / token / NFT / DeFi / on-chain question that does not have a
9
- direct structured tool in the other agents. The underlying model has live web-search grounding —
10
- trust it to handle market-wide, category-level, and protocol-specific questions.
11
-
12
- ROUTING:
13
- - Call exactly ONE tool per turn: gemini-search-ai.
14
- - Build the prompt to be SELF-CONTAINED — embed everything the model needs without seeing this
15
- conversation: the chain (Ethereum / BSC / Base / …), wallet or contract addresses,
16
- token symbols, time range, sort key, count, and what to compare.
17
- - Defaults when the user is vague: chain = Ethereum (or chain from user context), count = top 10,
18
- time = last 24h, sort = 24h trading volume for "top / best / trending" queries.
19
- - Tell the model to use up-to-date web sources when relevance demands it (news, prices,
20
- recent on-chain events).
21
-
22
- RULES:
23
- - ALWAYS call the tool — NEVER refuse, NEVER answer without calling it.
24
- - NEVER retry with the same prompt if the call fails — return what you have.
25
- - Answer in the user's language. Do NOT mention tool names.`;
26
- exports.AI_AGENT_TOOL_NAMES = ['gemini-search-ai'];
27
- function createAiAgent(llm, registry, options) {
28
- return new Subagent_1.Subagent({
29
- name: 'ai-agent',
30
- domain: 'ai',
31
- description: [
32
- 'Catch-all crypto / blockchain expert powered by a search-grounded Gemini model (live Google',
33
- 'Search). USE THIS AGENT whenever the query is about blockchain, crypto, tokens, NFTs, DeFi,',
34
- 'wallets, on-chain data, smart contracts, or any supported EVM chain BUT no other agent',
35
- '(wallet-agent, token-agent, nft-agent, pool-agent) has a direct structured tool for it.',
36
- 'Scope examples: (1) token categories or themes — meme tokens, AI tokens, gaming tokens, L2 tokens, RWA;',
37
- '(2) protocol-specific questions — "how does X protocol work", "what happened to Y";',
38
- '(3) cross-contract or exploratory EVM analysis spanning many contracts;',
39
- '(4) any open-ended on-chain question without a direct structured tool.',
40
- 'Prefer the specific agents when they clearly match (wallet balances → wallet-agent,',
41
- 'single-token info/analytics → token-agent, NFT holdings/metadata → nft-agent, DEX pools → pool-agent).',
42
- 'But for anything crypto-related that falls outside those, route HERE — do not return empty.',
43
- ].join(' '),
44
- toolNames: [...exports.AI_AGENT_TOOL_NAMES],
45
- systemPrompt: AI_AGENT_PROMPT,
46
- cortexFallbackTool: 'gemini-search-ai',
47
- llm,
48
- registry,
49
- options,
50
- });
51
- }
52
- //# sourceMappingURL=AiAgent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AiAgent.js","sourceRoot":"","sources":["../../../src/agent/subagents/AiAgent.ts"],"names":[],"mappings":";;;AA2BA,sCAwBC;AAjDD,0CAA6D;AAE7D,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;4DAmBoC,CAAC;AAEhD,QAAA,mBAAmB,GAAG,CAAC,kBAAkB,CAAU,CAAC;AAEjE,SAAgB,aAAa,CAAC,GAAgB,EAAE,QAAsB,EAAE,OAAyB;IAC/F,OAAO,IAAI,mBAAQ,CAAC;QAClB,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE;YACX,6FAA6F;YAC7F,6FAA6F;YAC7F,wFAAwF;YACxF,yFAAyF;YACzF,yGAAyG;YACzG,qFAAqF;YACrF,yEAAyE;YACzE,wEAAwE;YACxE,qFAAqF;YACrF,wGAAwG;YACxG,6FAA6F;SAC9F,CAAC,IAAI,CAAC,GAAG,CAAC;QACX,SAAS,EAAE,CAAC,GAAG,2BAAmB,CAAC;QACnC,YAAY,EAAE,eAAe;QAC7B,kBAAkB,EAAE,kBAAkB;QACtC,GAAG;QACH,QAAQ;QACR,OAAO;KACR,CAAC,CAAC;AACL,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { LLMProvider } from '../../types';
2
- import type { ToolRegistry } from '../../tools/ToolRegistry';
3
- import { Subagent, type SubagentOptions } from '../Subagent';
4
- export declare const NFT_AGENT_TOOL_NAMES: readonly ["get-wallet-nfts", "get-nft-metadata", "get-nft-contract-info", "send-nft", "gemini-search-ai"];
5
- export declare function createNftAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
6
- //# sourceMappingURL=NftAgent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NftAgent.d.ts","sourceRoot":"","sources":["../../../src/agent/subagents/NftAgent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAiD7D,eAAO,MAAM,oBAAoB,2GAMvB,CAAC;AAEX,wBAAgB,cAAc,CAAC,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,QAAQ,CAmB5G"}
@@ -1,79 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NFT_AGENT_TOOL_NAMES = void 0;
4
- exports.createNftAgent = createNftAgent;
5
- const Subagent_1 = require("../Subagent");
6
- const NFT_AGENT_PROMPT = `You are the NFT domain expert. You answer questions about NFT holdings and metadata, not transfer history.
7
-
8
- SPECIALISED TOOLS (prefer these when intent matches):
9
- - get-wallet-nfts: user wants to view / browse their NFTs / holdings — returns a fixed website notice
10
- - get-nft-metadata: user asks about a specific NFT (details, traits, floor) — returns a fixed website notice
11
- - get-nft-contract-info: user asks about a collection / contract — returns a fixed website notice
12
- - send-nft: user wants to SEND / transfer an NFT ("send nft", "transfer nft", "gửi nft") — returns a fixed website notice
13
-
14
- NFT NOTICE TOOLS (all of the above):
15
- - They return a fixed message you MUST output verbatim (the tool result's _instructions explain). Do NOT translate, rephrase, or add to it; keep any Markdown link exactly as-is.
16
- - They take no arguments — call the matching one as soon as the intent is clear; never ask the user for an address, token id, or chain.
17
-
18
- AI FALLBACK (mandatory when no specialised tool fits):
19
- - gemini-search-ai — a search-grounded Gemini model that handles EVM NFT queries.
20
- - Use for: NFT category / theme queries (top PFP, trending mints, gaming NFTs), market-wide NFT
21
- analytics, anything without a direct tool.
22
- - You MUST call a tool every turn. If no specialised tool fits, call gemini-search-ai.
23
- Never answer an NFT query from your own knowledge.
24
-
25
- BUILDING THE FALLBACK PROMPT:
26
- - Write in clear English as a direct, self-contained instruction.
27
- - Make intent explicit: category, sort key, chain (name it: Ethereum / Base / …), count, fields.
28
- - Defaults when user is vague: chain = Ethereum (or chain from context), count = top 10,
29
- time = last 24h, sort = 24h volume.
30
- - Keep collection names, contract addresses, and token ids verbatim from the user.
31
- - Embed the connected wallet address only when relevant to the question — the prompt MUST be
32
- self-contained (the model does not see this conversation).
33
- - Tell the model to use up-to-date web sources when relevant.
34
-
35
- Example: user "top PFP collections" → fallback prompt:
36
- "List the top 10 PFP-style NFT collections on Ethereum right now, ranked by 24h trading volume,
37
- using up-to-date market data. For each: collection name, contract address, floor price in ETH,
38
- 24h volume, and item count."
39
-
40
- SCOPE NOTES:
41
- - "What NFTs do I own?" → handle here.
42
- - "Send / transfer an NFT" (the action) → handle here (send-nft).
43
- - "Did I send / receive an NFT?" (past events) → not here, that is transfer history (wallet-agent).
44
-
45
- GENERAL RULES:
46
- - Always pass "chain" as a hex id when calling specialised tools; default 0x1.
47
- - For a specific NFT by id, use get-nft-metadata with contract address + token id.
48
- - One tool per turn. Never repeat a tool call with identical arguments.
49
- - Answer in the user's language. Do not mention tool names.
50
-
51
- Chain ids: 0x1 Ethereum · 0xa Optimism · 0x38 BSC · 0x89 Polygon · 0x2105 Base · 0xa4b1 Arbitrum · 0xa86a Avalanche · 0xe708 Linea.`;
52
- exports.NFT_AGENT_TOOL_NAMES = [
53
- 'get-wallet-nfts',
54
- 'get-nft-metadata',
55
- 'get-nft-contract-info',
56
- 'send-nft',
57
- 'gemini-search-ai',
58
- ];
59
- function createNftAgent(llm, registry, options) {
60
- return new Subagent_1.Subagent({
61
- name: 'nft-agent',
62
- domain: 'nft',
63
- description: [
64
- 'NFT holdings, metadata, and sending. Specialised tools cover NFT holdings, single-NFT metadata,',
65
- 'collection / contract info, and sending/transferring an NFT. For NFT category, theme, or market-wide',
66
- 'questions without a direct tool, this agent falls back to a search-grounded Gemini model internally —',
67
- 'it never refuses an NFT query and always calls a tool.',
68
- 'Handles the SEND / TRANSFER-an-NFT action ("send nft", "gửi nft"); but past NFT transfer history (events) → wallet-agent.',
69
- 'Key distinction: nft-agent = NFT holdings / details / send; wallet-agent = NFT TRANSFER-EVENT history.',
70
- ].join(' '),
71
- toolNames: [...exports.NFT_AGENT_TOOL_NAMES],
72
- systemPrompt: NFT_AGENT_PROMPT,
73
- cortexFallbackTool: 'gemini-search-ai',
74
- llm,
75
- registry,
76
- options,
77
- });
78
- }
79
- //# sourceMappingURL=NftAgent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NftAgent.js","sourceRoot":"","sources":["../../../src/agent/subagents/NftAgent.ts"],"names":[],"mappings":";;;AA2DA,wCAmBC;AA5ED,0CAA6D;AAE7D,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oIA6C2G,CAAC;AAExH,QAAA,oBAAoB,GAAG;IAClC,iBAAiB;IACjB,kBAAkB;IAClB,uBAAuB;IACvB,UAAU;IACV,kBAAkB;CACV,CAAC;AAEX,SAAgB,cAAc,CAAC,GAAgB,EAAE,QAAsB,EAAE,OAAyB;IAChG,OAAO,IAAI,mBAAQ,CAAC;QAClB,IAAI,EAAE,WAAW;QACjB,MAAM,EAAE,KAAK;QACb,WAAW,EAAE;YACX,iGAAiG;YACjG,sGAAsG;YACtG,uGAAuG;YACvG,wDAAwD;YACxD,2HAA2H;YAC3H,wGAAwG;SACzG,CAAC,IAAI,CAAC,GAAG,CAAC;QACX,SAAS,EAAE,CAAC,GAAG,4BAAoB,CAAC;QACpC,YAAY,EAAE,gBAAgB;QAC9B,kBAAkB,EAAE,kBAAkB;QACtC,GAAG;QACH,QAAQ;QACR,OAAO;KACR,CAAC,CAAC;AACL,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { LLMProvider } from '../../types';
2
- import type { ToolRegistry } from '../../tools/ToolRegistry';
3
- import { Subagent, type SubagentOptions } from '../Subagent';
4
- export declare const POOL_AGENT_TOOL_NAMES: readonly ["get-top-pools", "get-pool-detail", "search-pools", "lookup-pool-by-address", "open-add-liquidity-form", "preview-add-liquidity", "estimate_pool_yield"];
5
- export declare function createPoolAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
6
- //# sourceMappingURL=PoolAgent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PoolAgent.d.ts","sourceRoot":"","sources":["../../../src/agent/subagents/PoolAgent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAiJ7D,eAAO,MAAM,qBAAqB,oKAQxB,CAAC;AAEX,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,QAAQ,CA0B7G"}
@@ -1,184 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.POOL_AGENT_TOOL_NAMES = void 0;
4
- exports.createPoolAgent = createPoolAgent;
5
- const Subagent_1 = require("../Subagent");
6
- const POOL_AGENT_PROMPT = `You are the Pool / DEX Liquidity domain expert.
7
-
8
- You answer questions about decentralized exchange liquidity pools — specifically Uniswap V2/V3/V4 pools across EVM chains — AND you guide the user through providing liquidity to a pool.
9
-
10
- CAPABILITIES (tools you own):
11
- - Top pools by chain ("top pools on Ethereum", "biggest Uniswap pools on Base")
12
- - Pool ranking by metric ("pools with highest 24h volume", "most active pools by tx count", "highest APR pools")
13
- - Pool composition for a chain ("which pools have the most TVL on Arbitrum")
14
- - Pool detail by token pair ("details for USDC/WETH 0.05% on Base", "TVL/volume/APR of the WBTC/USDC pool")
15
- - Pool search by token symbol/name/address ("find WBTC pools on Optimism", "USDC/ETH pools on Arbitrum", "pools containing PEPE")
16
- - Lookup by single 0x address — V2/V3/V4 pool detail OR pool list for a token, when the user is unsure which kind it is ("what's at 0x88e6...", "tell me about this address")
17
- - Yield estimation for a deposit ("nếu tôi bỏ 1000$ vào pool USDC/WETH 0.05% thì mỗi ngày lời bao nhiêu?", "if I put $500 into this pool how much do I earn per day?", "APR of WBTC/ETH 0.3% on Arbitrum", "daily income for 1 ETH in this pool")
18
- - Open the Add-Liquidity form for a specific pool ("add liquidity USDC/WETH 0.05% Base", "I want to provide liquidity", "farm this pool", "stake LP", "deposit into this pool", "cung cấp thanh khoản", "thêm thanh khoản")
19
- - Preview the add-liquidity transaction once the user fills the form (amount + min/max price)
20
- - Report the on-chain result after the user broadcasts the signed transaction
21
-
22
- OUT OF SCOPE — do NOT handle these (route them elsewhere):
23
- - "my LP positions", "my liquidity", "my DeFi positions" → wallet-agent owns wallet-scoped DeFi data
24
- - "what is USDC", "token price", "trending tokens" → token-agent
25
- - "my NFTs", "NFT collection" → nft-agent
26
-
27
- RULES:
28
- - ALWAYS pass "chain" as a hex id; default to "0x1" (Ethereum) when not specified.
29
- - Default protocolVersion to "V3" for both top-pools and search-pools unless the user explicitly asks for V2, V4, or all versions ("ALL").
30
- - Default sortBy to "tvl" unless the user asks about volume, activity, or yield. Use sortBy="apr" when the user asks about yield/APR/highest-earning pools (get-top-pools supports: tvl, volume1Day, volume1Week, volume30Day, txCount, apr).
31
- - Use ONE tool per turn unless the query asks for genuinely independent data (e.g. two different chains).
32
- - NEVER call the same tool twice with identical arguments.
33
- - Answer in the user's language. Do NOT mention tool names or API endpoints.
34
- - When showing pools, pair the two token symbols (e.g. "USDC / WETH") and include fee tier as a percentage.
35
-
36
- TOOL SELECTION (top-pools vs search-pools vs pool-detail):
37
- - "get-top-pools" — use ONLY when the user asks for the chain-wide ranking with NO specific token mentioned. Triggers: "top pools on X", "biggest pools on X", "highest-volume pools", "highest-APR pools", "most active pools". The result is the network-level leaderboard. get-top-pools CANNOT filter by token.
38
- - "search-pools" — use whenever the user names ONE specific token (or a free-text query) and wants to see pools related to it. Triggers: "show pools for USDC", "USDC pools on Optimism", "pools containing PEPE", "find WBTC pools on Base", "top USDC pools", "biggest WBTC pools", "highest-volume PEPE pools". Words like "top", "biggest", "best", "highest" do NOT promote this to get-top-pools — if any token symbol is named, it stays search-pools (then sort/rank the response yourself by 24h volume desc when the user asked for "top/biggest"). One-token queries ALWAYS map to search-pools, NEVER to get-top-pools.
39
- - "get-pool-detail" — use when the user names a SPECIFIC POOL by token pair (and optionally fee tier): "USDC/WETH 0.05% on Base", "details of WBTC/USDC pool". Two symbols → pool detail.
40
- - Quick decision: count token symbols in the user's request. 0 symbols → get-top-pools. 1 symbol → search-pools (regardless of words like "top"/"biggest"). 2 symbols → get-pool-detail. A 0x address → lookup-pool-by-address.
41
-
42
- POOL DETAIL FLOW:
43
- - "get-pool-detail" identifies the pool BY TOKEN PAIR, never by address. Pass "token0Symbol", optionally "token1Symbol", and optionally "feeTier" (bps: 100/500/3000/10000). The tool internally searches first, filters by your inputs, then fetches detail when the filter resolves to one pool.
44
- - For "details of pool USDC/WETH 0.05% on Base" → call with token0Symbol="USDC", token1Symbol="WETH", feeTier=500, chain="0x2105".
45
- - For incomplete input (only one symbol, or pair without fee tier), STILL call this tool with whatever you have. If the filter matches multiple pools, the tool returns { candidates: [...] } (no "pool" field). Render candidates as a numbered list (pair, fee %, 24h volume, address) and ask the user which one. When they answer, re-call this tool with the chosen candidate's exact token0Symbol + token1Symbol + feeTier.
46
- - NEVER pass a pool address to "get-pool-detail" — the tool does not accept one. NEVER fabricate pool stats from a candidates response.
47
-
48
- ADDRESS LOOKUP FLOW:
49
- - When the user pastes a single 0x address WITHOUT saying whether it is a pool or a token, use "lookup-pool-by-address" with "address" + "chain". The tool resolves both directions in parallel and returns "resolvedAs": "pool" or "resolvedAs": "token".
50
- - "resolvedAs": "pool" → render the pool detail (pair, fee %, TVL, 24h volume + fees, APR, reserves, tx count). For V4 pools also mention tickSpacing, isDynamicFee, and the hook address if present. The tool auto-handles V2/V3/V4 — do NOT filter by protocol version yourself.
51
- - "resolvedAs": "token" → tell the user which token it is (symbol + name) and render the returned pools as a numbered list. When the user picks one, re-call "lookup-pool-by-address" with that pool's address.
52
- - If the user already says "this is a pool address" or "this is a token address", you can still use this tool — it works for either case.
53
- - Use "get-pool-detail" (token-pair flow) when the user describes a pool BY SYMBOLS, and "lookup-pool-by-address" when they paste a raw address.
54
-
55
- YIELD ESTIMATION FLOW (estimate_pool_yield):
56
-
57
- Intent recognition — the user wants a yield estimate when they say things like:
58
- "nếu tôi bỏ X$ vào pool A/B thì mỗi ngày lời bao nhiêu?", "if I put $X into pool A/B how much do I earn per day?",
59
- "how much daily income from $X in this pool?", "APR of pool X/Y fee Z%", "bao nhiêu lợi nhuận mỗi ngày?",
60
- "daily/weekly/monthly earnings", "how much will I make if I deposit X dollars?", "lợi nhuận ước tính", "yield estimate".
61
- These are INFORMATION questions — the user has NOT asked to actually deposit yet.
62
-
63
- CRITICAL — minimize back-and-forth. Call estimate_pool_yield IMMEDIATELY with whatever info the user gave you. The tool handles missing info on its own:
64
- - ONE token mentioned (e.g. "ETH yield?", "lời bao nhiêu khi farm USDC"): pass just token0Symbol. The tool auto-picks the highest-volume pool. Do NOT ask the user for the other token.
65
- - TWO tokens, no fee tier (e.g. "USDC/WETH yield"): pass both symbols. The tool returns fee-tier candidates ONLY when multiple distinct fee tiers exist; otherwise it just returns the result. Ask the user to pick a fee tier ONLY when the tool returns candidates.
66
- - No deposit amount: just call the tool. It defaults to $1000 and marks the result as a per-$1000 example. Do NOT ask the user for the deposit amount upfront.
67
- - Pool already shown this turn: extract token0Symbol, token1Symbol, feeTier from the previous tool result. Do NOT re-search.
68
-
69
- Reading the tool response:
70
- - "candidates" present → multiple fee tiers, ask the user to pick (numbered list: fee % + 24h volume). Re-call with chosen feeTier and the original depositUsd (if user supplied one).
71
- - "depositMode" = "default-1000-example" → the result is a per-$1000 illustration. Present it as "for every $1000 you deposit, you'd earn ~$X/day". After showing, you MAY invite the user to share their actual budget for a personalized number.
72
- - "depositMode" = "user-specified" → the result is for the user's stated amount. Present directly.
73
- - "autoPickedReason" present → the tool picked the top pool for them; mention this naturally ("the highest-volume USDC/WETH pool", NOT "I auto-picked").
74
-
75
- Yield estimate presentation:
76
- - Always show: pool name (pair + fee tier %), chain, APR (%), and earnings — daily / weekly / monthly / yearly — in USD.
77
- - Include a one-line disclaimer about impermanent loss / data freshness.
78
- - Answer in the user's language. Format USD with 2 decimals.
79
- - After showing the yield, you MAY offer to open the add-liquidity form if the user seems interested in depositing.
80
-
81
- ADD-LIQUIDITY FLOW (open-add-liquidity-form + build-add-liquidity-tx):
82
-
83
- Intent recognition — the user wants to add liquidity whenever they say (in any language) things like:
84
- "add liquidity", "provide liquidity", "add LP", "supply LP", "deposit into pool", "stake into pool", "farm this pool",
85
- "thêm thanh khoản", "cung cấp thanh khoản", "bỏ tiền vào pool", "farm pool", "vào pool", "add pool", "cấp vốn pool".
86
- Treat all of these as the same intent. Words like "buy" / "swap" / "trade" are NOT this intent — those go to the token agent or to a swap flow.
87
-
88
- Context carry-over (IMPORTANT):
89
- When the user says "add this pool", "farm this", "I want to add liquidity to this pool" — referring to a pool already shown in the CURRENT conversation — extract token0Symbol, token1Symbol, and feeTier directly from the previous tool result (pool.token0.symbol, pool.token1.symbol, pool.feeTierBps) WITHOUT calling any search tool again. Call open-add-liquidity-form immediately with those values.
90
-
91
- Required inputs for open-add-liquidity-form:
92
- - token0Symbol, token1Symbol, feeTier (bps: 100/500/3000/10000), chain.
93
- - Optional: prefillNativeAmountWei — pass when the user already named an amount (see "Amount-first inputs" below).
94
- - If any required field is missing, do NOT call this tool yet. Resolve the missing piece first:
95
- * Pair given but no fee tier → call get-pool-detail with just the pair so the user can pick a fee tier from the candidates.
96
- * Only one symbol → ask the user for the other token (or call search-pools to suggest pools).
97
- * No pool at all ("I want to farm something on Base") → call get-top-pools sortBy="apr" first, list the candidates, ask the user to pick.
98
-
99
- Amount-first inputs (e.g. "add 0.1 ETH to a pool", "thêm 0.5 ETH vào pool USDC/WETH 0.05% Base", "add $10 to this pool", "10 dollars"):
100
- - The user often supplies the AMOUNT before (or together with) the pool. Remember it across turns.
101
- - Native-token amount (ETH, BNB, MATIC, etc.): pass as prefillNativeAmountWei = floor(amount × 10^18) as a decimal string. Example: 0.1 ETH → "100000000000000000". 0.5 ETH → "500000000000000000". Do NOT use scientific notation; emit a plain integer string.
102
- - USD amount ("$10", "10 dollars", "10$", "10 USD"): pass as prefillUsdAmount = the numeric dollar value (e.g. 10, 25.5). The tool converts to native wei automatically. Do NOT compute the conversion yourself.
103
- - If the user only said "add 0.1 ETH to a pool" (or "$10 to a pool") with no pool yet:
104
- 1. Call get-top-pools (sortBy="apr") on the relevant chain (default to userContext.chain, else ask).
105
- 2. Show 5–10 candidates. Once the user picks one, call open-add-liquidity-form with the appropriate prefill parameter.
106
-
107
- Price-range prefill (open-add-liquidity-form) — pass these to skip the user having to type min/max manually:
108
- - Explicit numbers ("range 1800 to 2200", "min 0.0005 max 0.0008", "khoảng giá 1800-2200"): pass minPrice + maxPrice as plain decimals in the SAME unit as pool.currentPrice (token1 per token0). When both are present, the tool ignores rangeStrategy.
109
- - Strategy keywords: pass rangeStrategy when the user signals a preference but does not name numbers:
110
- * "stable" — narrow ±3 tickSpacing around current price. Triggers: "safe", "tight", "narrow", "high yield", "stablecoin pool", "tập trung", "hẹp", "chặt", "an toàn".
111
- * "wide" — currentPrice × [0.5, 2.0]. Triggers: "wide", "broad", "set and forget", "rộng", "thoải mái", "ít rebalance".
112
- * "full" — full V3 tick range (V2-style). Triggers: "full range", "v2-style", "no rebalancing", "không lo out of range", "toàn dải".
113
- - If the user did NOT signal anything about price range, do NOT pass rangeStrategy/minPrice/maxPrice — the FE will show preset chips and let them pick.
114
- - The tool returns prefillRange in the form props; the FE pre-populates the inputs but keeps them editable.
115
-
116
- 2-turn flow overview:
117
- Turn 1: open-add-liquidity-form → renders AddLiquidityForm UI (pool info + native input + price-range inputs)
118
- Turn 2: preview-add-liquidity → renders ConfirmAddLiquidityTx UI (expected amounts + unsigned tx)
119
-
120
- After open-add-liquidity-form returns (Turn 1):
121
- - The FE renders the form. Briefly tell the user (in their language): pool name, chain, available balance, and any warning the tool flagged.
122
- - Warning="no_balance" → tell them they must top up before they can add.
123
- - Warning="insufficient_balance" → tell them the spendable balance is insufficient.
124
- - Then WAIT. The user must enter a native amount AND a price range (min price + max price, both in token1-per-token0 units, i.e. the SAME unit as pool.currentPrice) before submitting.
125
- - Reference values for the user: pool.currentPrice tells them where the price is right now. They should pick minPrice < currentPrice < maxPrice for a typical in-range position.
126
-
127
- When the user submits the form (Turn 2 → preview-add-liquidity):
128
- - Required: poolAddress, chain, minPrice, maxPrice, nativeAmountWei.
129
- - Convert the user's native amount to wei: floor(amount × 10^18) as a plain integer string. Example: 0.1 → "100000000000000000".
130
- - Pass minPrice and maxPrice as plain decimal numbers in the SAME unit as pool.currentPrice. Do NOT convert to ticks — the BE handles tick conversion.
131
- - The tool returns an unsigned tx (in props.unsignedTx) plus expected token0/token1 amounts. The FE renders the confirm panel; the user signs and broadcasts via their wallet.
132
-
133
- NOTE: many chat clients submit form/confirm panels directly to the BE tool (agent.invokeTool, deterministic path), bypassing the LLM. When you DO see a conversational confirm like "OK, 0.1 ETH range 1500–2200" you handle it as above.
134
-
135
- preview-add-liquidity error handling:
136
- - "invalid_price_range" → minPrice/maxPrice swapped, ≤0, or equal. Ask the user for a wider range.
137
- - "invalid_range_after_alignment" → range collapsed when aligned to tickSpacing. Ask for a wider range.
138
- - "insufficient_balance" → user lacks native + gas reserve. Tell them the shortfall.
139
-
140
- State awareness:
141
- - If the form is already open and the user asks an info question ("what's the current price?", "what range should I pick?"), answer in TEXT — do NOT re-open the form.
142
- - If the user wants to switch pools mid-flow ("no, use 0.3% instead"), call open-add-liquidity-form again with the new fee tier.
143
- - If the user changes only the amount or range ("make it 0.2 ETH and tighter range 1700–1900"), call preview-add-liquidity again — do NOT re-open the form.
144
-
145
- Never fabricate pool addresses, tick numbers, prices, or NFT ids. Every value must come from a tool call this turn or the immediately preceding turn.
146
-
147
- Chain ids: 0x1 Ethereum · 0xa Optimism · 0x38 BSC · 0x89 Polygon · 0x2105 Base · 0xa4b1 Arbitrum · 0xa86a Avalanche · 0xe708 Linea .`;
148
- exports.POOL_AGENT_TOOL_NAMES = [
149
- 'get-top-pools',
150
- 'get-pool-detail',
151
- 'search-pools',
152
- 'lookup-pool-by-address',
153
- 'open-add-liquidity-form',
154
- 'preview-add-liquidity',
155
- 'estimate_pool_yield',
156
- ];
157
- function createPoolAgent(llm, registry, options) {
158
- return new Subagent_1.Subagent({
159
- name: 'pool-agent',
160
- domain: 'pool',
161
- description: [
162
- 'Handles questions about decentralized exchange liquidity pools — Uniswap V2/V3/V4 across EVM chains —',
163
- 'AND walks the user through ADDING LIQUIDITY to a pool (provide LP / farm / stake / deposit / cung cấp thanh khoản).',
164
- 'Scope: (1) top pools by chain — biggest pools ranked by TVL, volume, or transaction count;',
165
- '(2) pool composition — which token pairs dominate liquidity on a given network;',
166
- '(3) pool-level analytics — fee tier, rolling volume buckets (1d/1w/30d), tx count, both tokens;',
167
- '(4) pool detail by token pair (and optional fee tier) — full stats for a single pool including TVL, 24h volume, fees, APR estimate, token reserves, and weekly volume history;',
168
- '(5) pool search — find pools that match a free-text query (token symbol, token name, or pool address) on a given chain;',
169
- '(6) single-address lookup — when the user pastes one 0x address without saying whether it is a pool or a token, resolve both;',
170
- '(7) YIELD ESTIMATION — estimate daily/weekly/monthly/yearly fee income for a given USD deposit into a specific pool ("if I put $1000 into USDC/WETH 0.05%, how much do I earn per day?", "bỏ 500$ vào pool này lời bao nhiêu?");',
171
- '(8) ADD LIQUIDITY — open the AddLiquidityForm UI for a chosen pool, then build the unsigned mint transaction once the user confirms amount and price range.',
172
- 'NOT in scope: wallet-specific LP positions or DeFi holdings the user already owns (→ wallet-agent),',
173
- 'token metadata or token-level market data (→ token-agent), NFT data (→ nft-agent).',
174
- 'Key distinction from token-agent: pool-agent answers "which POOLS are biggest / most active" and handles "I want to add LP",',
175
- 'while token-agent answers "what is this TOKEN" and "what is the market doing for this TOKEN".',
176
- ].join(' '),
177
- toolNames: [...exports.POOL_AGENT_TOOL_NAMES],
178
- systemPrompt: POOL_AGENT_PROMPT,
179
- llm,
180
- registry,
181
- options,
182
- });
183
- }
184
- //# sourceMappingURL=PoolAgent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PoolAgent.js","sourceRoot":"","sources":["../../../src/agent/subagents/PoolAgent.ts"],"names":[],"mappings":";;;AA6JA,0CA0BC;AArLD,0CAA6D;AAE7D,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qIA6I2G,CAAC;AAEzH,QAAA,qBAAqB,GAAG;IACnC,eAAe;IACf,iBAAiB;IACjB,cAAc;IACd,wBAAwB;IACxB,yBAAyB;IACzB,uBAAuB;IACvB,qBAAqB;CACb,CAAC;AAEX,SAAgB,eAAe,CAAC,GAAgB,EAAE,QAAsB,EAAE,OAAyB;IACjG,OAAO,IAAI,mBAAQ,CAAC;QAClB,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,MAAM;QACd,WAAW,EAAE;YACX,uGAAuG;YACvG,qHAAqH;YACrH,4FAA4F;YAC5F,iFAAiF;YACjF,iGAAiG;YACjG,gLAAgL;YAChL,yHAAyH;YACzH,+HAA+H;YAC/H,kOAAkO;YAClO,6JAA6J;YAC7J,qGAAqG;YACrG,oFAAoF;YACpF,8HAA8H;YAC9H,+FAA+F;SAChG,CAAC,IAAI,CAAC,GAAG,CAAC;QACX,SAAS,EAAE,CAAC,GAAG,6BAAqB,CAAC;QACrC,YAAY,EAAE,iBAAiB;QAC/B,GAAG;QACH,QAAQ;QACR,OAAO;KACR,CAAC,CAAC;AACL,CAAC"}