keyring-agent-core 0.1.1 → 0.2.1
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.
- package/dist/agent/AgentCore.d.ts +37 -1
- package/dist/agent/AgentCore.d.ts.map +1 -1
- package/dist/agent/AgentCore.js +287 -144
- package/dist/agent/AgentCore.js.map +1 -1
- package/dist/agent/QueryRewriter.d.ts +17 -0
- package/dist/agent/QueryRewriter.d.ts.map +1 -1
- package/dist/agent/QueryRewriter.js +48 -4
- package/dist/agent/QueryRewriter.js.map +1 -1
- package/dist/agent/Router.d.ts.map +1 -1
- package/dist/agent/Router.js +73 -35
- package/dist/agent/Router.js.map +1 -1
- package/dist/agent/Subagent.d.ts +17 -0
- package/dist/agent/Subagent.d.ts.map +1 -1
- package/dist/agent/Subagent.js +32 -0
- package/dist/agent/Subagent.js.map +1 -1
- package/dist/agent/chatGraph.d.ts +364 -0
- package/dist/agent/chatGraph.d.ts.map +1 -0
- package/dist/agent/chatGraph.js +184 -0
- package/dist/agent/chatGraph.js.map +1 -0
- package/dist/agent/subagents/AiAgent.d.ts +1 -1
- package/dist/agent/subagents/AiAgent.d.ts.map +1 -1
- package/dist/agent/subagents/AiAgent.js +24 -20
- package/dist/agent/subagents/AiAgent.js.map +1 -1
- package/dist/agent/subagents/NftAgent.d.ts +1 -1
- package/dist/agent/subagents/NftAgent.d.ts.map +1 -1
- package/dist/agent/subagents/NftAgent.js +36 -26
- package/dist/agent/subagents/NftAgent.js.map +1 -1
- package/dist/agent/subagents/PoolSubgraphAgent.d.ts +6 -0
- package/dist/agent/subagents/PoolSubgraphAgent.d.ts.map +1 -0
- package/dist/agent/subagents/PoolSubgraphAgent.js +117 -0
- package/dist/agent/subagents/PoolSubgraphAgent.js.map +1 -0
- package/dist/agent/subagents/TokenAgent.d.ts +1 -1
- package/dist/agent/subagents/TokenAgent.d.ts.map +1 -1
- package/dist/agent/subagents/TokenAgent.js +23 -22
- package/dist/agent/subagents/TokenAgent.js.map +1 -1
- package/dist/agent/subagents/WalletActionAgent.d.ts +6 -0
- package/dist/agent/subagents/WalletActionAgent.d.ts.map +1 -0
- package/dist/agent/subagents/WalletActionAgent.js +55 -0
- package/dist/agent/subagents/WalletActionAgent.js.map +1 -0
- package/dist/agent/subagents/WalletAgent.d.ts +1 -1
- package/dist/agent/subagents/WalletAgent.d.ts.map +1 -1
- package/dist/agent/subagents/WalletAgent.js +18 -17
- package/dist/agent/subagents/WalletAgent.js.map +1 -1
- package/dist/agent/subagents/index.d.ts +23 -3
- package/dist/agent/subagents/index.d.ts.map +1 -1
- package/dist/agent/subagents/index.js +42 -11
- package/dist/agent/subagents/index.js.map +1 -1
- package/dist/constants/abi.d.ts +31 -0
- package/dist/constants/abi.d.ts.map +1 -1
- package/dist/constants/abi.js +24 -1
- package/dist/constants/abi.js.map +1 -1
- package/dist/functions/web3.d.ts +0 -1
- package/dist/functions/web3.d.ts.map +1 -1
- package/dist/functions/web3.js +0 -45
- package/dist/functions/web3.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/llm/GeminiProvider.d.ts.map +1 -1
- package/dist/llm/GeminiProvider.js +115 -34
- package/dist/llm/GeminiProvider.js.map +1 -1
- package/dist/memory/UpstashKnowledgeBase.d.ts +1 -1
- package/dist/memory/UpstashKnowledgeBase.js +1 -1
- package/dist/services/MoralisService.d.ts +3 -25
- package/dist/services/MoralisService.d.ts.map +1 -1
- package/dist/services/MoralisService.js +7 -132
- package/dist/services/MoralisService.js.map +1 -1
- package/dist/services/PantographService.d.ts +61 -1
- package/dist/services/PantographService.d.ts.map +1 -1
- package/dist/services/PantographService.js +264 -12
- package/dist/services/PantographService.js.map +1 -1
- package/dist/services/PoolService.d.ts +1 -4
- package/dist/services/PoolService.d.ts.map +1 -1
- package/dist/services/PoolService.js +18 -40
- package/dist/services/PoolService.js.map +1 -1
- package/dist/services/UniswapSubgraphService.d.ts +144 -0
- package/dist/services/UniswapSubgraphService.d.ts.map +1 -0
- package/dist/services/UniswapSubgraphService.js +606 -0
- package/dist/services/UniswapSubgraphService.js.map +1 -0
- package/dist/services/rpc.d.ts +35 -0
- package/dist/services/rpc.d.ts.map +1 -0
- package/dist/services/rpc.js +110 -0
- package/dist/services/rpc.js.map +1 -0
- package/dist/services/swap/DebridgeAdapter.d.ts +17 -0
- package/dist/services/swap/DebridgeAdapter.d.ts.map +1 -1
- package/dist/services/swap/DebridgeAdapter.js +74 -6
- package/dist/services/swap/DebridgeAdapter.js.map +1 -1
- package/dist/services/swap/SwapServiceFactory.d.ts +1 -0
- package/dist/services/swap/SwapServiceFactory.d.ts.map +1 -1
- package/dist/services/swap/SwapServiceFactory.js +8 -3
- package/dist/services/swap/SwapServiceFactory.js.map +1 -1
- package/dist/tools/builtin/ai/GeminiSearchAiTool.d.ts +36 -0
- package/dist/tools/builtin/ai/GeminiSearchAiTool.d.ts.map +1 -0
- package/dist/tools/builtin/ai/GeminiSearchAiTool.js +91 -0
- package/dist/tools/builtin/ai/GeminiSearchAiTool.js.map +1 -0
- package/dist/tools/builtin/ai/index.d.ts +2 -4
- package/dist/tools/builtin/ai/index.d.ts.map +1 -1
- package/dist/tools/builtin/ai/index.js +3 -5
- package/dist/tools/builtin/ai/index.js.map +1 -1
- package/dist/tools/builtin/index.d.ts +2 -0
- package/dist/tools/builtin/index.d.ts.map +1 -1
- package/dist/tools/builtin/index.js +2 -0
- package/dist/tools/builtin/index.js.map +1 -1
- package/dist/tools/builtin/nft/BaseNftMessageTool.d.ts +35 -0
- package/dist/tools/builtin/nft/BaseNftMessageTool.d.ts.map +1 -0
- package/dist/tools/builtin/nft/BaseNftMessageTool.js +45 -0
- package/dist/tools/builtin/nft/BaseNftMessageTool.js.map +1 -0
- package/dist/tools/builtin/nft/NFTContractInfoTool.d.ts +7 -13
- package/dist/tools/builtin/nft/NFTContractInfoTool.d.ts.map +1 -1
- package/dist/tools/builtin/nft/NFTContractInfoTool.js +8 -43
- package/dist/tools/builtin/nft/NFTContractInfoTool.js.map +1 -1
- package/dist/tools/builtin/nft/NFTMetadataTool.d.ts +7 -113
- package/dist/tools/builtin/nft/NFTMetadataTool.d.ts.map +1 -1
- package/dist/tools/builtin/nft/NFTMetadataTool.js +9 -148
- package/dist/tools/builtin/nft/NFTMetadataTool.js.map +1 -1
- package/dist/tools/builtin/nft/SendNftTool.d.ts +14 -0
- package/dist/tools/builtin/nft/SendNftTool.d.ts.map +1 -0
- package/dist/tools/builtin/nft/SendNftTool.js +20 -0
- package/dist/tools/builtin/nft/SendNftTool.js.map +1 -0
- package/dist/tools/builtin/nft/WalletNFTsTool.d.ts +7 -74
- package/dist/tools/builtin/nft/WalletNFTsTool.d.ts.map +1 -1
- package/dist/tools/builtin/nft/WalletNFTsTool.js +9 -161
- package/dist/tools/builtin/nft/WalletNFTsTool.js.map +1 -1
- package/dist/tools/builtin/pool/EstimatePoolYieldTool.d.ts.map +1 -1
- package/dist/tools/builtin/pool/EstimatePoolYieldTool.js +4 -3
- package/dist/tools/builtin/pool/EstimatePoolYieldTool.js.map +1 -1
- package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.d.ts +1 -0
- package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.d.ts.map +1 -1
- package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.js +8 -5
- package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.js.map +1 -1
- package/dist/tools/builtin/pool/PoolByAddressTool.d.ts.map +1 -1
- package/dist/tools/builtin/pool/PoolByAddressTool.js +4 -3
- package/dist/tools/builtin/pool/PoolByAddressTool.js.map +1 -1
- package/dist/tools/builtin/pool/PoolDetailTool.d.ts.map +1 -1
- package/dist/tools/builtin/pool/PoolDetailTool.js +4 -3
- package/dist/tools/builtin/pool/PoolDetailTool.js.map +1 -1
- package/dist/tools/builtin/pool/PoolSearchTool.d.ts.map +1 -1
- package/dist/tools/builtin/pool/PoolSearchTool.js +4 -3
- package/dist/tools/builtin/pool/PoolSearchTool.js.map +1 -1
- package/dist/tools/builtin/pool/PreviewAddLiquidityTool.d.ts +1 -0
- package/dist/tools/builtin/pool/PreviewAddLiquidityTool.d.ts.map +1 -1
- package/dist/tools/builtin/pool/PreviewAddLiquidityTool.js +5 -3
- package/dist/tools/builtin/pool/PreviewAddLiquidityTool.js.map +1 -1
- package/dist/tools/builtin/pool/TopPoolsTool.d.ts.map +1 -1
- package/dist/tools/builtin/pool/TopPoolsTool.js +4 -3
- package/dist/tools/builtin/pool/TopPoolsTool.js.map +1 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.d.ts +54 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.d.ts.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.js +98 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.js.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.d.ts +63 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.d.ts.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.js +82 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.js.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.d.ts +79 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.d.ts.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.js +97 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.js.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.d.ts +77 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.d.ts.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.js +190 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.js.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.d.ts +107 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.d.ts.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.js +92 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.js.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.d.ts +56 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.d.ts.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.js +94 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.js.map +1 -0
- package/dist/tools/builtin/pool-subgraph/index.d.ts +13 -0
- package/dist/tools/builtin/pool-subgraph/index.d.ts.map +1 -0
- package/dist/tools/builtin/pool-subgraph/index.js +18 -0
- package/dist/tools/builtin/pool-subgraph/index.js.map +1 -0
- package/dist/tools/builtin/token/TokenAnalyticsTool.d.ts.map +1 -1
- package/dist/tools/builtin/token/TokenAnalyticsTool.js +4 -3
- package/dist/tools/builtin/token/TokenAnalyticsTool.js.map +1 -1
- package/dist/tools/builtin/token/TokenHoldersTool.d.ts.map +1 -1
- package/dist/tools/builtin/token/TokenHoldersTool.js +4 -3
- package/dist/tools/builtin/token/TokenHoldersTool.js.map +1 -1
- package/dist/tools/builtin/token/TokenInfoTool.d.ts +6 -2
- package/dist/tools/builtin/token/TokenInfoTool.d.ts.map +1 -1
- package/dist/tools/builtin/token/TokenInfoTool.js +66 -8
- package/dist/tools/builtin/token/TokenInfoTool.js.map +1 -1
- package/dist/tools/builtin/token/TokenScoreTool.d.ts.map +1 -1
- package/dist/tools/builtin/token/TokenScoreTool.js +4 -3
- package/dist/tools/builtin/token/TokenScoreTool.js.map +1 -1
- package/dist/tools/builtin/token/TopGainersTool.d.ts +10 -19
- package/dist/tools/builtin/token/TopGainersTool.d.ts.map +1 -1
- package/dist/tools/builtin/token/TopGainersTool.js +44 -54
- package/dist/tools/builtin/token/TopGainersTool.js.map +1 -1
- package/dist/tools/builtin/token/TopLosersTool.d.ts.map +1 -1
- package/dist/tools/builtin/token/TopLosersTool.js +3 -2
- package/dist/tools/builtin/token/TopLosersTool.js.map +1 -1
- package/dist/tools/builtin/token/TrendingTokensTool.d.ts +1 -1
- package/dist/tools/builtin/token/TrendingTokensTool.d.ts.map +1 -1
- package/dist/tools/builtin/token/TrendingTokensTool.js +20 -12
- package/dist/tools/builtin/token/TrendingTokensTool.js.map +1 -1
- package/dist/tools/builtin/token/index.d.ts +0 -2
- package/dist/tools/builtin/token/index.d.ts.map +1 -1
- package/dist/tools/builtin/token/index.js +1 -3
- package/dist/tools/builtin/token/index.js.map +1 -1
- package/dist/tools/builtin/wallet/TransactionByHashTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/TransactionByHashTool.js +4 -3
- package/dist/tools/builtin/wallet/TransactionByHashTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletApprovalsTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletApprovalsTool.js +4 -3
- package/dist/tools/builtin/wallet/WalletApprovalsTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletDefiPositionsTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletDefiPositionsTool.js +4 -3
- package/dist/tools/builtin/wallet/WalletDefiPositionsTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.js +4 -3
- package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletDefiSummaryTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletDefiSummaryTool.js +4 -3
- package/dist/tools/builtin/wallet/WalletDefiSummaryTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletHistoryTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletHistoryTool.js +5 -4
- package/dist/tools/builtin/wallet/WalletHistoryTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletNetWorthTool.js +1 -1
- package/dist/tools/builtin/wallet/WalletNetWorthTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletNftTransfersTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletNftTransfersTool.js +5 -4
- package/dist/tools/builtin/wallet/WalletNftTransfersTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletPnlSummaryTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletPnlSummaryTool.js +4 -3
- package/dist/tools/builtin/wallet/WalletPnlSummaryTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletPnlTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletPnlTool.js +4 -3
- package/dist/tools/builtin/wallet/WalletPnlTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletTokenBalancesTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletTokenBalancesTool.js +4 -3
- package/dist/tools/builtin/wallet/WalletTokenBalancesTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletTokenTransfersTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletTokenTransfersTool.js +5 -4
- package/dist/tools/builtin/wallet/WalletTokenTransfersTool.js.map +1 -1
- package/dist/tools/builtin/wallet/index.d.ts +3 -0
- package/dist/tools/builtin/wallet/index.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/index.js +5 -1
- package/dist/tools/builtin/wallet/index.js.map +1 -1
- package/dist/tools/builtin/wallet-action/ApproveTokenTool.d.ts +25 -0
- package/dist/tools/builtin/wallet-action/ApproveTokenTool.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/ApproveTokenTool.js +98 -0
- package/dist/tools/builtin/wallet-action/ApproveTokenTool.js.map +1 -0
- package/dist/tools/builtin/wallet-action/BaseWalletActionTool.d.ts +211 -0
- package/dist/tools/builtin/wallet-action/BaseWalletActionTool.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/BaseWalletActionTool.js +499 -0
- package/dist/tools/builtin/wallet-action/BaseWalletActionTool.js.map +1 -0
- package/dist/tools/builtin/wallet-action/BuyTokenTool.d.ts +240 -0
- package/dist/tools/builtin/wallet-action/BuyTokenTool.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/BuyTokenTool.js +1257 -0
- package/dist/tools/builtin/wallet-action/BuyTokenTool.js.map +1 -0
- package/dist/tools/builtin/wallet-action/SendNativeTool.d.ts +41 -0
- package/dist/tools/builtin/wallet-action/SendNativeTool.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/SendNativeTool.js +127 -0
- package/dist/tools/builtin/wallet-action/SendNativeTool.js.map +1 -0
- package/dist/tools/builtin/wallet-action/SendTokenTool.d.ts +63 -0
- package/dist/tools/builtin/wallet-action/SendTokenTool.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/SendTokenTool.js +294 -0
- package/dist/tools/builtin/wallet-action/SendTokenTool.js.map +1 -0
- package/dist/tools/builtin/wallet-action/SwapTokenTool.d.ts +247 -0
- package/dist/tools/builtin/wallet-action/SwapTokenTool.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/SwapTokenTool.js +1258 -0
- package/dist/tools/builtin/wallet-action/SwapTokenTool.js.map +1 -0
- package/dist/tools/builtin/wallet-action/UnwrapNativeTool.d.ts +20 -0
- package/dist/tools/builtin/wallet-action/UnwrapNativeTool.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/UnwrapNativeTool.js +36 -0
- package/dist/tools/builtin/wallet-action/UnwrapNativeTool.js.map +1 -0
- package/dist/tools/builtin/wallet-action/WrapNativeTool.d.ts +23 -0
- package/dist/tools/builtin/wallet-action/WrapNativeTool.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/WrapNativeTool.js +54 -0
- package/dist/tools/builtin/wallet-action/WrapNativeTool.js.map +1 -0
- package/dist/tools/builtin/wallet-action/amountSpec.d.ts +62 -0
- package/dist/tools/builtin/wallet-action/amountSpec.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/amountSpec.js +93 -0
- package/dist/tools/builtin/wallet-action/amountSpec.js.map +1 -0
- package/dist/tools/builtin/wallet-action/gasReserve.d.ts +42 -0
- package/dist/tools/builtin/wallet-action/gasReserve.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/gasReserve.js +103 -0
- package/dist/tools/builtin/wallet-action/gasReserve.js.map +1 -0
- package/dist/tools/builtin/wallet-action/index.d.ts +9 -0
- package/dist/tools/builtin/wallet-action/index.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/index.js +20 -0
- package/dist/tools/builtin/wallet-action/index.js.map +1 -0
- package/dist/tools/chainResolver.d.ts +98 -0
- package/dist/tools/chainResolver.d.ts.map +1 -0
- package/dist/tools/chainResolver.js +302 -0
- package/dist/tools/chainResolver.js.map +1 -0
- package/dist/types/index.d.ts +218 -7
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +5 -2
- package/dist/tools/builtin/ai/MoralisCortexTool.d.ts +0 -33
- package/dist/tools/builtin/ai/MoralisCortexTool.d.ts.map +0 -1
- package/dist/tools/builtin/ai/MoralisCortexTool.js +0 -76
- package/dist/tools/builtin/ai/MoralisCortexTool.js.map +0 -1
- package/dist/tools/builtin/ai/SolanaCortexTool.d.ts +0 -22
- package/dist/tools/builtin/ai/SolanaCortexTool.d.ts.map +0 -1
- package/dist/tools/builtin/ai/SolanaCortexTool.js +0 -80
- package/dist/tools/builtin/ai/SolanaCortexTool.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
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,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AAO,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,6 +1,6 @@
|
|
|
1
1
|
import type { LLMProvider } from '../../types';
|
|
2
2
|
import type { ToolRegistry } from '../../tools/ToolRegistry';
|
|
3
3
|
import { Subagent, type SubagentOptions } from '../Subagent';
|
|
4
|
-
export declare const AI_AGENT_TOOL_NAMES: readonly ["
|
|
4
|
+
export declare const AI_AGENT_TOOL_NAMES: readonly ["gemini-search-ai"];
|
|
5
5
|
export declare function createAiAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
|
|
6
6
|
//# sourceMappingURL=AiAgent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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"}
|
|
@@ -3,43 +3,47 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AI_AGENT_TOOL_NAMES = void 0;
|
|
4
4
|
exports.createAiAgent = createAiAgent;
|
|
5
5
|
const Subagent_1 = require("../Subagent");
|
|
6
|
-
const AI_AGENT_PROMPT = `You are the Crypto AI-
|
|
6
|
+
const AI_AGENT_PROMPT = `You are the Crypto AI fallback expert powered by a search-grounded Gemini model.
|
|
7
7
|
|
|
8
|
-
You answer ANY blockchain / crypto / token / NFT / DeFi / on-chain question that does not
|
|
9
|
-
|
|
10
|
-
|
|
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
11
|
|
|
12
|
-
ROUTING
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
|
|
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).
|
|
16
21
|
|
|
17
22
|
RULES:
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
- NEVER retry with the same query if the Cortex call fails — return what you have.
|
|
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.
|
|
21
25
|
- Answer in the user's language. Do NOT mention tool names.`;
|
|
22
|
-
exports.AI_AGENT_TOOL_NAMES = ['
|
|
26
|
+
exports.AI_AGENT_TOOL_NAMES = ['gemini-search-ai'];
|
|
23
27
|
function createAiAgent(llm, registry, options) {
|
|
24
28
|
return new Subagent_1.Subagent({
|
|
25
29
|
name: 'ai-agent',
|
|
26
30
|
domain: 'ai',
|
|
27
31
|
description: [
|
|
28
|
-
'Catch-all crypto / blockchain expert powered by
|
|
29
|
-
'USE THIS AGENT whenever the query is about blockchain, crypto, tokens, NFTs, DeFi,
|
|
30
|
-
'on-chain data, smart contracts, or any
|
|
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',
|
|
31
35
|
'(wallet-agent, token-agent, nft-agent, pool-agent) has a direct structured tool for it.',
|
|
32
|
-
'Scope examples: (1)
|
|
33
|
-
'(2)
|
|
34
|
-
'(3)
|
|
35
|
-
'(4)
|
|
36
|
-
'(5) any open-ended on-chain question without a direct structured tool.',
|
|
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.',
|
|
37
40
|
'Prefer the specific agents when they clearly match (wallet balances → wallet-agent,',
|
|
38
41
|
'single-token info/analytics → token-agent, NFT holdings/metadata → nft-agent, DEX pools → pool-agent).',
|
|
39
42
|
'But for anything crypto-related that falls outside those, route HERE — do not return empty.',
|
|
40
43
|
].join(' '),
|
|
41
44
|
toolNames: [...exports.AI_AGENT_TOOL_NAMES],
|
|
42
45
|
systemPrompt: AI_AGENT_PROMPT,
|
|
46
|
+
cortexFallbackTool: 'gemini-search-ai',
|
|
43
47
|
llm,
|
|
44
48
|
registry,
|
|
45
49
|
options,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiAgent.js","sourceRoot":"","sources":["../../../src/agent/subagents/AiAgent.ts"],"names":[],"mappings":";;;
|
|
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 +1,6 @@
|
|
|
1
1
|
import type { LLMProvider } from '../../types';
|
|
2
2
|
import type { ToolRegistry } from '../../tools/ToolRegistry';
|
|
3
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", "
|
|
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
5
|
export declare function createNftAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
|
|
6
6
|
//# sourceMappingURL=NftAgent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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"}
|
|
@@ -6,32 +6,41 @@ const Subagent_1 = require("../Subagent");
|
|
|
6
6
|
const NFT_AGENT_PROMPT = `You are the NFT domain expert. You answer questions about NFT holdings and metadata, not transfer history.
|
|
7
7
|
|
|
8
8
|
SPECIALISED TOOLS (prefer these when intent matches):
|
|
9
|
-
- get-wallet-nfts: NFTs
|
|
10
|
-
- get-nft-metadata:
|
|
11
|
-
- get-nft-contract-info: collection / contract
|
|
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
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
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.
|
|
18
23
|
Never answer an NFT query from your own knowledge.
|
|
19
24
|
|
|
20
|
-
BUILDING THE
|
|
21
|
-
- Write in clear English as a direct instruction.
|
|
22
|
-
- Make intent explicit: category, sort key, chain, count, fields.
|
|
23
|
-
- Defaults when user is vague: chain = Ethereum (or chain from context),
|
|
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.
|
|
25
30
|
- Keep collection names, contract addresses, and token ids verbatim from the user.
|
|
26
|
-
-
|
|
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.
|
|
27
34
|
|
|
28
|
-
Example: user "top PFP collections" →
|
|
29
|
-
"List the top 10 PFP-style NFT collections on Ethereum right now, ranked by 24h trading volume
|
|
30
|
-
For each: collection name, contract address, floor price in ETH,
|
|
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."
|
|
31
39
|
|
|
32
40
|
SCOPE NOTES:
|
|
33
41
|
- "What NFTs do I own?" → handle here.
|
|
34
|
-
- "
|
|
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).
|
|
35
44
|
|
|
36
45
|
GENERAL RULES:
|
|
37
46
|
- Always pass "chain" as a hex id when calling specialised tools; default 0x1.
|
|
@@ -44,23 +53,24 @@ exports.NFT_AGENT_TOOL_NAMES = [
|
|
|
44
53
|
'get-wallet-nfts',
|
|
45
54
|
'get-nft-metadata',
|
|
46
55
|
'get-nft-contract-info',
|
|
47
|
-
'
|
|
48
|
-
'
|
|
56
|
+
'send-nft',
|
|
57
|
+
'gemini-search-ai',
|
|
49
58
|
];
|
|
50
59
|
function createNftAgent(llm, registry, options) {
|
|
51
60
|
return new Subagent_1.Subagent({
|
|
52
61
|
name: 'nft-agent',
|
|
53
62
|
domain: 'nft',
|
|
54
63
|
description: [
|
|
55
|
-
'NFT holdings and
|
|
56
|
-
'
|
|
57
|
-
'this agent falls back to
|
|
58
|
-
'
|
|
59
|
-
'
|
|
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.',
|
|
60
70
|
].join(' '),
|
|
61
71
|
toolNames: [...exports.NFT_AGENT_TOOL_NAMES],
|
|
62
72
|
systemPrompt: NFT_AGENT_PROMPT,
|
|
63
|
-
cortexFallbackTool: '
|
|
73
|
+
cortexFallbackTool: 'gemini-search-ai',
|
|
64
74
|
llm,
|
|
65
75
|
registry,
|
|
66
76
|
options,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NftAgent.js","sourceRoot":"","sources":["../../../src/agent/subagents/NftAgent.ts"],"names":[],"mappings":";;;
|
|
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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
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_SUBGRAPH_AGENT_TOOL_NAMES: readonly ["subgraph-search-pools", "subgraph-trending-pools", "subgraph-pool-by-address", "subgraph-pool-by-position-id", "subgraph-position-detail", "subgraph-coinpool-pairs"];
|
|
5
|
+
export declare function createPoolSubgraphAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
|
|
6
|
+
//# sourceMappingURL=PoolSubgraphAgent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PoolSubgraphAgent.d.ts","sourceRoot":"","sources":["../../../src/agent/subagents/PoolSubgraphAgent.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;AAkF7D,eAAO,MAAM,8BAA8B,kLAOjC,CAAC;AAEX,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,QAAQ,CAuBrH"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.POOL_SUBGRAPH_AGENT_TOOL_NAMES = void 0;
|
|
4
|
+
exports.createPoolSubgraphAgent = createPoolSubgraphAgent;
|
|
5
|
+
const Subagent_1 = require("../Subagent");
|
|
6
|
+
const POOL_SUBGRAPH_AGENT_PROMPT = `You are the Uniswap V3 Subgraph DEX-pool expert.
|
|
7
|
+
|
|
8
|
+
You answer questions about Uniswap V3 liquidity pools using The Graph subgraphs. APR values are enriched from DefiLlama Yields. Concentrated-liquidity price-range data comes from the CoinPool platform.
|
|
9
|
+
|
|
10
|
+
CAPABILITIES (tools you own):
|
|
11
|
+
- Pool search by token symbol(s) ("show pool USDC", "find ETH/USDC pools", "pools containing PEPE", "stablecoin pools", "USDC pools on Base", "best WBTC pool")
|
|
12
|
+
- Trending pools / top pools when NO token is named ("trending pools", "hot pools", "most active pools", "top pools on Arbitrum")
|
|
13
|
+
- Pool detail by 0x pool address ("tell me about pool 0xabc…", "details of 0x…")
|
|
14
|
+
- Position lookup by Uniswap V3 NFT id ("position 962961", "pool id 12345", "tell me about position 962961")
|
|
15
|
+
- Concentrated-liquidity price-range candidates for a token pair ("what price range for ETH/USDC?", "best range for USDC/WETH", "gợi ý khoảng giá ETH/USDC")
|
|
16
|
+
|
|
17
|
+
OUT OF SCOPE — do NOT handle these:
|
|
18
|
+
- "my LP positions" / "my liquidity" / wallet-wide LP list → tell the user politely this subagent does not handle wallet-scoped LP data.
|
|
19
|
+
- "send / transfer my LP position" → not handled.
|
|
20
|
+
- "what is USDC" / token price / trending tokens → token-agent.
|
|
21
|
+
- "my NFTs" → nft-agent.
|
|
22
|
+
- Building add-liquidity / mint transactions → not handled. (If an add-liquidity link is configured, the ADD-LIQUIDITY LINK rule below still applies — you may answer and append that link without building any tx.)
|
|
23
|
+
|
|
24
|
+
RULES:
|
|
25
|
+
- ALWAYS pass chain values as hex ids: 0x1 Ethereum, 0xa Optimism, 0x38 BSC, 0x89 Polygon, 0x2105 Base, 0xa4b1 Arbitrum, 0xa86a Avalanche. NEVER pass chain names ("ethereum", "base", …).
|
|
26
|
+
- When the user does NOT name a chain, pass \`chains: []\` (or omit \`chain\`) — the tool falls back to the connected chain. NEVER ask the user "which chain?".
|
|
27
|
+
- Only fill \`chains\` when the user explicitly named one or more networks ("on Base" → ["0x2105"], "trên Arbitrum" → ["0xa4b1"]).
|
|
28
|
+
- If the user mentions an unsupported chain (solana, fantom, cronos, etc.), pass it verbatim so the tool returns unsupportedChains; then quote that list in your answer.
|
|
29
|
+
- Use ONE tool per turn unless the query needs genuinely independent data.
|
|
30
|
+
- NEVER call the same tool twice with identical arguments.
|
|
31
|
+
- Answer in the user's language. Do NOT mention tool names or API endpoints.
|
|
32
|
+
- Prefix data answers with "According to the latest data from Subgraph Uniswap V3," (translate naturally; keep the word "Subgraph" as-is).
|
|
33
|
+
- When the response includes a specific pool or position, render the provided \`uniswapUrl\` / \`uniswapPositionUrl\` as a clickable markdown link. Never invent URLs.
|
|
34
|
+
|
|
35
|
+
TOOL SELECTION (count token symbols in the user's request):
|
|
36
|
+
- 0 token symbols → subgraph-trending-pools ("trending pools", "top pools on Base").
|
|
37
|
+
- 1 token symbol → subgraph-search-pools with tokens=[symbol] ("show pool USDC", "find WBTC pools", "best USDC pool", "stablecoin pools" → tokens=["USDC","USDT"]). Words like "top"/"biggest"/"best" do NOT change this — keep it search-pools and set sortBy accordingly.
|
|
38
|
+
- 2 token symbols → subgraph-search-pools with tokens=[sym0, sym1] ("ETH/USDC pools", "WBTC/ETH on Arbitrum").
|
|
39
|
+
- 0x-prefixed pool address → subgraph-pool-by-address.
|
|
40
|
+
- Numeric position id ("position 962961", "pool id 12345") → subgraph-position-detail.
|
|
41
|
+
- "Which pool is position X in?" (no need for fee history) → subgraph-pool-by-position-id.
|
|
42
|
+
- Token pair AND user explicitly asks about PRICE RANGES ("best range for ETH/USDC", "khoảng giá") → subgraph-coinpool-pairs.
|
|
43
|
+
|
|
44
|
+
SORT (subgraph-search-pools and subgraph-trending-pools):
|
|
45
|
+
- "best" / "top" / "biggest" with no other qualifier → sortBy="tvl".
|
|
46
|
+
- "highest APR" / "best yield" → sortBy="apr".
|
|
47
|
+
- "cheapest" / "lowest fee" → sortBy="fee".
|
|
48
|
+
- "most liquid" / "deepest" → sortBy="liquidity".
|
|
49
|
+
- "highest volume" / "most active" → sortBy="volume".
|
|
50
|
+
|
|
51
|
+
TOKEN vs CHAIN DISAMBIGUATION (CRITICAL):
|
|
52
|
+
Short aliases can be EITHER a chain or a token: OP, ARB, ETH, BNB, MATIC.
|
|
53
|
+
Rule: only treat the alias as a CHAIN when prepositions ("on", "in", "from", "across", "trên", "tại") or the word "chain"/"network" appear next to it. Otherwise treat as a TOKEN.
|
|
54
|
+
Examples (always hex ids):
|
|
55
|
+
- "show pool OP" → tokens=["OP"], chains=[]
|
|
56
|
+
- "show pools on OP" → tokens=[], chains=["0xa"]
|
|
57
|
+
- "OP/USDC pool on ARB" → tokens=["OP","USDC"], chains=["0xa4b1"]
|
|
58
|
+
- "ETH/USDC trên Arbitrum" → tokens=["ETH","USDC"], chains=["0xa4b1"]
|
|
59
|
+
|
|
60
|
+
COINPOOL RANGE GUIDANCE (when using subgraph-coinpool-pairs):
|
|
61
|
+
- APR from subgraph-coinpool-pairs is the APR earned ONLY within that specific price range. NEVER present it as the overall pool APR.
|
|
62
|
+
- Always pair APR with the min–max range, e.g. "APR 14.3% (range: 1800 – 2200 USDC/ETH)".
|
|
63
|
+
- When suggesting the best range, point to the highest-APR entry and call out that narrower ranges = higher concentration = higher returns but more risk of going out of range.
|
|
64
|
+
|
|
65
|
+
FOLLOW-UPS / CONTINUATIONS:
|
|
66
|
+
- Short replies like "yes", "tell me more", "the first one", "show ranges" refer back to the previous turn. Extract tokens/chains/pool addresses from the prior assistant message and call the appropriate tool. NEVER ask for clarification when history clearly shows what was discussed.
|
|
67
|
+
|
|
68
|
+
NEVER fabricate pool addresses, token prices, APRs, or position ids. Every value must come from a tool call this turn or the immediately preceding turn.`;
|
|
69
|
+
/**
|
|
70
|
+
* Append the add-liquidity link rule to the base prompt when a link is
|
|
71
|
+
* configured (via `AgentConfig.subgraph.linkAddLiquidity`). Without a link the
|
|
72
|
+
* base prompt's "Add-liquidity / build mint tx flows → not handled." stance is
|
|
73
|
+
* unchanged. With a link, the subagent keeps its normal answer and appends the
|
|
74
|
+
* exact URL whenever the user asks to add liquidity — mirroring the SDK
|
|
75
|
+
* responder behaviour.
|
|
76
|
+
*/
|
|
77
|
+
function buildPoolSubgraphPrompt(linkAddLiquidity) {
|
|
78
|
+
if (!linkAddLiquidity)
|
|
79
|
+
return POOL_SUBGRAPH_AGENT_PROMPT;
|
|
80
|
+
return `${POOL_SUBGRAPH_AGENT_PROMPT}
|
|
81
|
+
|
|
82
|
+
ADD-LIQUIDITY LINK:
|
|
83
|
+
- If the user mentions adding liquidity / adding a pool / adding a position (including phrases like "add liquidity", "add pool", "add position", "create pool", "create pair", "thêm thanh khoản", "thêm pool", "thêm position"), keep your normal answer content and append this exact link at the end of the response: ${linkAddLiquidity}`;
|
|
84
|
+
}
|
|
85
|
+
exports.POOL_SUBGRAPH_AGENT_TOOL_NAMES = [
|
|
86
|
+
'subgraph-search-pools',
|
|
87
|
+
'subgraph-trending-pools',
|
|
88
|
+
'subgraph-pool-by-address',
|
|
89
|
+
'subgraph-pool-by-position-id',
|
|
90
|
+
'subgraph-position-detail',
|
|
91
|
+
'subgraph-coinpool-pairs',
|
|
92
|
+
];
|
|
93
|
+
function createPoolSubgraphAgent(llm, registry, options) {
|
|
94
|
+
return new Subagent_1.Subagent({
|
|
95
|
+
name: 'pool-subgraph-agent',
|
|
96
|
+
domain: 'pool',
|
|
97
|
+
description: [
|
|
98
|
+
'Answers questions about Uniswap V3 liquidity pools using The Graph subgraphs as the primary source',
|
|
99
|
+
'(APR is enriched from DefiLlama Yields; concentrated-liquidity price ranges come from CoinPool).',
|
|
100
|
+
'Scope: (1) pool search by token symbols on one or more EVM chains, with TVL/APR/fee filters and sort by tvl/volume/apr/fee/liquidity;',
|
|
101
|
+
'(2) trending pools ranked by 24h volume on a chain;',
|
|
102
|
+
'(3) pool detail for a specific 0x pool address;',
|
|
103
|
+
'(4) lookup the underlying pool for a Uniswap V3 NFT position id (numeric, e.g. 962961);',
|
|
104
|
+
'(5) full position detail (deposits, withdrawals, collected fees) for a numeric position id;',
|
|
105
|
+
'(6) CoinPool concentrated-liquidity price-range candidates with per-range APR for a token pair.',
|
|
106
|
+
'NOT in scope: wallet-wide LP holdings ("my positions"), sending/transferring LP NFTs, add-liquidity action flows,',
|
|
107
|
+
'token metadata (→ token-agent), NFT data (→ nft-agent).',
|
|
108
|
+
'Prefer this subagent over pool-agent when the deployment is configured to use Subgraph data (the two are mutually exclusive at config time).',
|
|
109
|
+
].join(' '),
|
|
110
|
+
toolNames: [...exports.POOL_SUBGRAPH_AGENT_TOOL_NAMES],
|
|
111
|
+
systemPrompt: buildPoolSubgraphPrompt(options?.linkAddLiquidity),
|
|
112
|
+
llm,
|
|
113
|
+
registry,
|
|
114
|
+
options,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=PoolSubgraphAgent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PoolSubgraphAgent.js","sourceRoot":"","sources":["../../../src/agent/subagents/PoolSubgraphAgent.ts"],"names":[],"mappings":";;;AA6FA,0DAuBC;AAlHD,0CAA6D;AAE7D,MAAM,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yJA8DsH,CAAC;AAE1J;;;;;;;GAOG;AACH,SAAS,uBAAuB,CAAC,gBAAyB;IACxD,IAAI,CAAC,gBAAgB;QAAE,OAAO,0BAA0B,CAAC;IACzD,OAAO,GAAG,0BAA0B;;;2TAGqR,gBAAgB,EAAE,CAAC;AAC9U,CAAC;AAEY,QAAA,8BAA8B,GAAG;IAC5C,uBAAuB;IACvB,yBAAyB;IACzB,0BAA0B;IAC1B,8BAA8B;IAC9B,0BAA0B;IAC1B,yBAAyB;CACjB,CAAC;AAEX,SAAgB,uBAAuB,CAAC,GAAgB,EAAE,QAAsB,EAAE,OAAyB;IACzG,OAAO,IAAI,mBAAQ,CAAC;QAClB,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE,MAAM;QACd,WAAW,EAAE;YACX,oGAAoG;YACpG,kGAAkG;YAClG,uIAAuI;YACvI,qDAAqD;YACrD,iDAAiD;YACjD,yFAAyF;YACzF,6FAA6F;YAC7F,iGAAiG;YACjG,mHAAmH;YACnH,yDAAyD;YACzD,8IAA8I;SAC/I,CAAC,IAAI,CAAC,GAAG,CAAC;QACX,SAAS,EAAE,CAAC,GAAG,sCAA8B,CAAC;QAC9C,YAAY,EAAE,uBAAuB,CAAC,OAAO,EAAE,gBAAgB,CAAC;QAChE,GAAG;QACH,QAAQ;QACR,OAAO;KACR,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LLMProvider } from '../../types';
|
|
2
2
|
import type { ToolRegistry } from '../../tools/ToolRegistry';
|
|
3
3
|
import { Subagent, type SubagentOptions } from '../Subagent';
|
|
4
|
-
export declare const TOKEN_AGENT_TOOL_NAMES: readonly ["get-token-info", "get-token-holders", "get-token-analytics", "get-token-score", "get-trending-tokens", "get-top-gainers", "
|
|
4
|
+
export declare const TOKEN_AGENT_TOOL_NAMES: readonly ["get-token-info", "get-token-holders", "get-token-analytics", "get-token-score", "get-trending-tokens", "get-top-gainers", "gemini-search-ai"];
|
|
5
5
|
export declare function createTokenAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
|
|
6
6
|
//# sourceMappingURL=TokenAgent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenAgent.d.ts","sourceRoot":"","sources":["../../../src/agent/subagents/TokenAgent.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;
|
|
1
|
+
{"version":3,"file":"TokenAgent.d.ts","sourceRoot":"","sources":["../../../src/agent/subagents/TokenAgent.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;AA6C7D,eAAO,MAAM,sBAAsB,0JAQzB,CAAC;AAEX,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,QAAQ,CAkB9G"}
|
|
@@ -11,25 +11,28 @@ SPECIALISED TOOLS (prefer these when intent matches):
|
|
|
11
11
|
- get-token-analytics: volume, liquidity, buy/sell activity
|
|
12
12
|
- get-token-score: risk / trust score
|
|
13
13
|
- get-trending-tokens: generic momentum list (no category filter)
|
|
14
|
-
- get-top-gainers
|
|
14
|
+
- get-top-gainers: top price-gainer ranking over a chosen window (no category filter)
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
- Use it for: token category / theme queries (meme, AI, gaming, L2, RWA),
|
|
19
|
-
|
|
20
|
-
- You MUST call a tool every turn. If no specialised tool fits, call
|
|
16
|
+
AI FALLBACK (mandatory when no specialised tool fits):
|
|
17
|
+
- gemini-search-ai — a search-grounded Gemini model that handles EVM token queries.
|
|
18
|
+
- Use it for: token category / theme queries (meme, AI, gaming, L2, RWA), protocol-specific
|
|
19
|
+
questions, cross-chain comparisons, anything without a direct tool.
|
|
20
|
+
- You MUST call a tool every turn. If no specialised tool fits, call gemini-search-ai.
|
|
21
21
|
Never answer a token query from your own knowledge.
|
|
22
22
|
|
|
23
|
-
BUILDING THE
|
|
24
|
-
- Write in clear English, as a direct instruction (not "the user wants…").
|
|
25
|
-
- Make intent explicit: name the category, sort key, chain
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
BUILDING THE FALLBACK PROMPT:
|
|
24
|
+
- Write in clear English, as a direct, self-contained instruction (not "the user wants…").
|
|
25
|
+
- Make intent explicit: name the category, sort key, chain (Ethereum / BSC / Base / …),
|
|
26
|
+
result count, fields.
|
|
27
|
+
- Defaults when user is vague: chain = Ethereum (or chain from user context), count = top 10,
|
|
28
|
+
time = last 24h, sort = 24h volume for "top / best / trending".
|
|
28
29
|
- Keep symbols, addresses, and protocol names verbatim from the user.
|
|
29
|
-
-
|
|
30
|
+
- Embed chain + relevant addresses directly in the prompt — the model does not see this
|
|
31
|
+
conversation. Tell the model to use up-to-date web sources when relevant.
|
|
30
32
|
|
|
31
|
-
Example: user "show top meme tokens" →
|
|
32
|
-
"List the top 10 meme-category tokens on Ethereum right now, ranked by 24h trading volume
|
|
33
|
+
Example: user "show top meme tokens" → fallback prompt:
|
|
34
|
+
"List the top 10 meme-category tokens on Ethereum right now, ranked by 24h trading volume,
|
|
35
|
+
using up-to-date market data.
|
|
33
36
|
|
|
34
37
|
OUT OF SCOPE (do not handle):
|
|
35
38
|
- "my balance" / "my transfers" → wallet-agent
|
|
@@ -41,7 +44,7 @@ GENERAL RULES:
|
|
|
41
44
|
- Never repeat a tool call with identical arguments.
|
|
42
45
|
- Answer in the user's language. Do not mention tool names.
|
|
43
46
|
|
|
44
|
-
Chain ids: 0x1 Ethereum · 0xa Optimism · 0x38 BSC · 0x89 Polygon · 0x2105 Base · 0xa4b1 Arbitrum · 0xa86a Avalanche · 0xe708 Linea
|
|
47
|
+
Chain ids: 0x1 Ethereum · 0xa Optimism · 0x38 BSC · 0x89 Polygon · 0x2105 Base · 0xa4b1 Arbitrum · 0xa86a Avalanche · 0xe708 Linea. `;
|
|
45
48
|
exports.TOKEN_AGENT_TOOL_NAMES = [
|
|
46
49
|
'get-token-info',
|
|
47
50
|
'get-token-holders',
|
|
@@ -49,9 +52,7 @@ exports.TOKEN_AGENT_TOOL_NAMES = [
|
|
|
49
52
|
'get-token-score',
|
|
50
53
|
'get-trending-tokens',
|
|
51
54
|
'get-top-gainers',
|
|
52
|
-
'
|
|
53
|
-
'moralis-cortex-ai',
|
|
54
|
-
'solana-cortex-ai',
|
|
55
|
+
'gemini-search-ai',
|
|
55
56
|
];
|
|
56
57
|
function createTokenAgent(llm, registry, options) {
|
|
57
58
|
return new Subagent_1.Subagent({
|
|
@@ -59,14 +60,14 @@ function createTokenAgent(llm, registry, options) {
|
|
|
59
60
|
domain: 'token',
|
|
60
61
|
description: [
|
|
61
62
|
'Market-wide token data. Specialised tools cover metadata, holders, analytics, risk score,',
|
|
62
|
-
'trending,
|
|
63
|
-
'
|
|
64
|
-
'it never refuses a token query and always calls a tool.',
|
|
63
|
+
'trending, and top gainers. For token category/theme queries (meme, AI, gaming, L2, RWA),',
|
|
64
|
+
'any token question without a direct tool, this agent falls back to a',
|
|
65
|
+
'search-grounded Gemini model internally — it never refuses a token query and always calls a tool.',
|
|
65
66
|
'NOT in scope: wallet balances or transfer history (→ wallet-agent), NFT data (→ nft-agent).',
|
|
66
67
|
].join(' '),
|
|
67
68
|
toolNames: [...exports.TOKEN_AGENT_TOOL_NAMES],
|
|
68
69
|
systemPrompt: TOKEN_AGENT_PROMPT,
|
|
69
|
-
cortexFallbackTool: '
|
|
70
|
+
cortexFallbackTool: 'gemini-search-ai',
|
|
70
71
|
llm,
|
|
71
72
|
registry,
|
|
72
73
|
options,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenAgent.js","sourceRoot":"","sources":["../../../src/agent/subagents/TokenAgent.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"TokenAgent.js","sourceRoot":"","sources":["../../../src/agent/subagents/TokenAgent.ts"],"names":[],"mappings":";;;AAyDA,4CAkBC;AAzED,0CAA6D;AAE7D,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qIAyC0G,CAAC;AAEzH,QAAA,sBAAsB,GAAG;IACpC,gBAAgB;IAChB,mBAAmB;IACnB,qBAAqB;IACrB,iBAAiB;IACjB,qBAAqB;IACrB,iBAAiB;IACjB,kBAAkB;CACV,CAAC;AAEX,SAAgB,gBAAgB,CAAC,GAAgB,EAAE,QAAsB,EAAE,OAAyB;IAClG,OAAO,IAAI,mBAAQ,CAAC;QAClB,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,OAAO;QACf,WAAW,EAAE;YACX,2FAA2F;YAC3F,0FAA0F;YAC1F,sEAAsE;YACtE,mGAAmG;YACnG,6FAA6F;SAC9F,CAAC,IAAI,CAAC,GAAG,CAAC;QACX,SAAS,EAAE,CAAC,GAAG,8BAAsB,CAAC;QACtC,YAAY,EAAE,kBAAkB;QAChC,kBAAkB,EAAE,kBAAkB;QACtC,GAAG;QACH,QAAQ;QACR,OAAO;KACR,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LLMProvider } from '../../types';
|
|
2
|
+
import type { ToolRegistry } from '../../tools/ToolRegistry';
|
|
3
|
+
import { Subagent, type SubagentOptions } from '../Subagent';
|
|
4
|
+
export declare const WALLET_ACTION_AGENT_TOOL_NAMES: readonly ["open-send-native-form", "open-send-token-form", "open-buy-token-form", "open-swap-token-form", "open-approve-token-form"];
|
|
5
|
+
export declare function createWalletActionAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
|
|
6
|
+
//# sourceMappingURL=WalletActionAgent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletActionAgent.d.ts","sourceRoot":"","sources":["../../../src/agent/subagents/WalletActionAgent.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;AAyB7D,eAAO,MAAM,8BAA8B,sIAMjC,CAAC;AAEX,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,QAAQ,CAmBrH"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WALLET_ACTION_AGENT_TOOL_NAMES = void 0;
|
|
4
|
+
exports.createWalletActionAgent = createWalletActionAgent;
|
|
5
|
+
const Subagent_1 = require("../Subagent");
|
|
6
|
+
const WALLET_ACTION_AGENT_PROMPT = `Call exactly ONE tool every turn — ALWAYS, even for a bare verb with no details ("send token", "buy", "approve"). Never reply in text and never ask the user for missing fields (token, amount, recipient): the tool opens a picker/form that collects them.
|
|
7
|
+
|
|
8
|
+
Tools:
|
|
9
|
+
- open-send-native-form — native coin (ETH/BNB/MATIC/…)
|
|
10
|
+
- open-send-token-form — ERC-20
|
|
11
|
+
- open-buy-token-form — buy a token (named OR, if none named, returns trending picks)
|
|
12
|
+
- open-swap-token-form — swap a token the user ALREADY HOLDS into another ("swap USDC to USDT", "swap USDC")
|
|
13
|
+
- open-approve-token-form — ERC-20 approve/revoke
|
|
14
|
+
|
|
15
|
+
Intent → tool:
|
|
16
|
+
- "send eth" / "transfer 0.1 eth" → open-send-native-form
|
|
17
|
+
- "send <token>" / "send usdc" / "transfer 50 DAI" → open-send-token-form WITH token_symbol = the named token (e.g. token_symbol="USDC"); "send token" / "transfer some token" (no token named) → open-send-token-form, leave token_symbol blank → wallet picker. ALWAYS set token_symbol whenever the user names a token.
|
|
18
|
+
- "buy <token>" → open-buy-token-form (with token_symbol); "buy a token / buy trending" (no token named) → open-buy-token-form (leave token_symbol blank)
|
|
19
|
+
- "swap <A> to <B>" / "đổi <A> sang <B>" / "convert/exchange <A> for <B>" → open-swap-token-form (from_symbol = A, to_symbol = B); "swap <A>" (only source named) → open-swap-token-form (from_symbol = A, leave to_symbol blank → trending picker); "swap" (nothing named) → open-swap-token-form (leave both blank → wallet picker). SWAP is when the user spends a token they hold; BUY is when they name a token to acquire and pick a wallet token to pay with.
|
|
20
|
+
- "approve" → open-approve-token-form
|
|
21
|
+
|
|
22
|
+
Pass only what the user gave. Leave the rest blank — the tool / form handles it. Don't invent values.
|
|
23
|
+
NFT sends are NOT handled here — they belong to the nft-agent.
|
|
24
|
+
|
|
25
|
+
Skip the tool ONLY if: walletAddress missing (ask to connect) · user explicitly names a chain different from userContext.chain (ask to switch).
|
|
26
|
+
|
|
27
|
+
After the tool returns: 1 short sentence in the user's language. Don't list missing fields. Don't mention tool names.`;
|
|
28
|
+
exports.WALLET_ACTION_AGENT_TOOL_NAMES = [
|
|
29
|
+
'open-send-native-form',
|
|
30
|
+
'open-send-token-form',
|
|
31
|
+
'open-buy-token-form',
|
|
32
|
+
'open-swap-token-form',
|
|
33
|
+
'open-approve-token-form',
|
|
34
|
+
];
|
|
35
|
+
function createWalletActionAgent(llm, registry, options) {
|
|
36
|
+
return new Subagent_1.Subagent({
|
|
37
|
+
name: 'wallet-action-agent',
|
|
38
|
+
domain: 'wallet-action',
|
|
39
|
+
description: [
|
|
40
|
+
'User wants to PERFORM an on-chain action (send, buy, swap, approve).',
|
|
41
|
+
'This agent picks the matching open-*-form tool which emits a pre-filled form (or, for buy/swap, a confirm panel) for the FE to render.',
|
|
42
|
+
'The FE — not this agent — builds and submits the tx after the user confirms.',
|
|
43
|
+
'NOT in scope: read-only wallet/token/NFT queries, sending/transferring an NFT (→ nft-agent), liquidity provisioning.',
|
|
44
|
+
].join(' '),
|
|
45
|
+
toolNames: [...exports.WALLET_ACTION_AGENT_TOOL_NAMES],
|
|
46
|
+
systemPrompt: WALLET_ACTION_AGENT_PROMPT,
|
|
47
|
+
// This agent's only job is to emit a form — it must always act via a tool
|
|
48
|
+
// and never stop to ask the user for missing fields (the form/picker does).
|
|
49
|
+
mustCallTool: true,
|
|
50
|
+
llm,
|
|
51
|
+
registry,
|
|
52
|
+
options,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=WalletActionAgent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletActionAgent.js","sourceRoot":"","sources":["../../../src/agent/subagents/WalletActionAgent.ts"],"names":[],"mappings":";;;AAmCA,0DAmBC;AApDD,0CAA6D;AAE7D,MAAM,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;;;;sHAqBmF,CAAC;AAE1G,QAAA,8BAA8B,GAAG;IAC5C,uBAAuB;IACvB,sBAAsB;IACtB,qBAAqB;IACrB,sBAAsB;IACtB,yBAAyB;CACjB,CAAC;AAEX,SAAgB,uBAAuB,CAAC,GAAgB,EAAE,QAAsB,EAAE,OAAyB;IACzG,OAAO,IAAI,mBAAQ,CAAC;QAClB,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE,eAAe;QACvB,WAAW,EAAE;YACX,sEAAsE;YACtE,wIAAwI;YACxI,8EAA8E;YAC9E,sHAAsH;SACvH,CAAC,IAAI,CAAC,GAAG,CAAC;QACX,SAAS,EAAE,CAAC,GAAG,sCAA8B,CAAC;QAC9C,YAAY,EAAE,0BAA0B;QACxC,0EAA0E;QAC1E,4EAA4E;QAC5E,YAAY,EAAE,IAAI;QAClB,GAAG;QACH,QAAQ;QACR,OAAO;KACR,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LLMProvider } from '../../types';
|
|
2
2
|
import type { ToolRegistry } from '../../tools/ToolRegistry';
|
|
3
3
|
import { Subagent, type SubagentOptions } from '../Subagent';
|
|
4
|
-
export declare const WALLET_AGENT_TOOL_NAMES: readonly ["get-wallet-token-balances", "get-wallet-history", "get-wallet-token-transfers", "get-wallet-nft-transfers", "get-wallet-net-worth", "get-wallet-pnl-summary", "get-wallet-pnl", "get-wallet-approvals", "get-wallet-defi-summary", "get-wallet-defi-positions", "get-wallet-defi-protocol-positions", "get-transaction-by-hash", "
|
|
4
|
+
export declare const WALLET_AGENT_TOOL_NAMES: readonly ["get-wallet-token-balances", "get-wallet-history", "get-wallet-token-transfers", "get-wallet-nft-transfers", "get-wallet-net-worth", "get-wallet-pnl-summary", "get-wallet-pnl", "get-wallet-approvals", "get-wallet-defi-summary", "get-wallet-defi-positions", "get-wallet-defi-protocol-positions", "get-transaction-by-hash", "gemini-search-ai"];
|
|
5
5
|
export declare function createWalletAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
|
|
6
6
|
//# sourceMappingURL=WalletAgent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletAgent.d.ts","sourceRoot":"","sources":["../../../src/agent/subagents/WalletAgent.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;
|
|
1
|
+
{"version":3,"file":"WalletAgent.d.ts","sourceRoot":"","sources":["../../../src/agent/subagents/WalletAgent.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;AAuD7D,eAAO,MAAM,uBAAuB,iWAc1B,CAAC;AAEX,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,QAAQ,CAmB/G"}
|