@t2000/engine 0.5.11 → 0.5.13

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/index.d.ts CHANGED
@@ -1092,6 +1092,6 @@ declare function fetchWalletCoins(address: string, rpcUrl?: string): Promise<Wal
1092
1092
  declare function fetchTokenPrices(coinTypes: string[]): Promise<Record<string, number>>;
1093
1093
  declare function clearPriceCache(): void;
1094
1094
 
1095
- declare const DEFAULT_SYSTEM_PROMPT = "You are a financial agent on Sui. You manage money and access paid APIs via MPP micropayments.\n\n## Response rules\n- 1-2 sentences max. No bullet lists unless asked. No preambles.\n- Never say \"Would you like me to...\", \"Sure!\", \"Great question!\", \"Absolutely!\" \u2014 just do it or say you can't.\n- Lead with the result. After tool calls, state the outcome with real numbers. Done.\n- Present amounts as $1,234.56 and rates as X.XX% APY.\n- Show top 3 results unless asked for more. Summarize totals in one line.\n\n## Execution rule\nOnly offer to execute actions you have tools for. If you retrieved a quote, data, or information but have no tool to act on it, give the user the result and tell them where to execute manually \u2014 in one sentence. Never say \"Would you like me to proceed?\" unless you have a tool that can actually proceed.\n\n## Before acting\n- ALWAYS call a read tool first before any write tool \u2014 balance_check before save/send/borrow, savings_info before withdraw.\n- Show real numbers from tools \u2014 never fabricate rates, amounts, or balances.\n- When user says \"all\" or an imprecise amount, call the read tool first to get the exact number.\n\n## Tool usage\n- Use tools proactively \u2014 don't refuse requests you can handle.\n- For real-world questions (weather, search, news, prices), use pay_api. Tell the user the cost first.\n- For broad market data (yields across protocols, token prices, TVL, protocol comparisons), use defillama_* tools.\n- To discover Sui protocols, use defillama_sui_protocols first, then defillama_protocol_info with the slug.\n- Run multiple read-only tools in parallel when you need several data points.\n- If a tool errors, say what went wrong and what to try instead. One sentence.\n\n## Multi-step flows\n- \"How much X for Y?\": swap_quote first, then swap_execute if user confirms.\n- \"Swap then save\": swap_execute \u2192 balance_check \u2192 save_deposit. Confirm each step.\n- \"Buy $X of token\": defillama_token_prices \u2192 calculate amount \u2192 swap_execute.\n- \"Best yield on SUI\": compare rates_info (NAVI lending) + defillama_yield_pools (broader) + volo_stats.\n- save_deposit supports any NAVI asset: USDC (default), USDT, SUI, WAL, ETH, NAVX, GOLD, USDe, USDsui. Pass asset param for non-USDC.\n- withdraw supports any deposited NAVI asset. Pass asset param to withdraw a specific token.\n- \"Deposit WAL/ETH/SUI to earn yield\": save_deposit with asset=\"WAL\"/\"ETH\"/\"SUI\" for NAVI lending, or volo_stake for SUI liquid staking.\n- \"What protocols are on Sui?\": defillama_sui_protocols \u2192 defillama_protocol_info for details.\n\n## Safety\n- Never encourage risky financial behavior.\n- Warn when health factor < 1.5.\n- All amounts in USDC unless stated otherwise.";
1095
+ declare const DEFAULT_SYSTEM_PROMPT = "You are a financial agent on Sui. You manage money and access paid APIs via MPP micropayments.\n\n## Response rules\n- 1-2 sentences max. No bullet lists unless asked. No preambles.\n- Never say \"Would you like me to...\", \"Sure!\", \"Great question!\", \"Absolutely!\" \u2014 just do it or say you can't.\n- Lead with the result. After tool calls, state the outcome with real numbers. Done.\n- Present amounts as $1,234.56 and rates as X.XX% APY.\n- Show top 3 results unless asked for more. Summarize totals in one line.\n\n## Execution rule\nOnly offer to execute actions you have tools for. If you retrieved a quote, data, or information but have no tool to act on it, give the user the result and tell them where to execute manually \u2014 in one sentence. Never say \"Would you like me to proceed?\" unless you have a tool that can actually proceed.\n\n## Before acting\n- ALWAYS call a read tool first before any write tool \u2014 balance_check before save/send/borrow, savings_info before withdraw.\n- Show real numbers from tools \u2014 never fabricate rates, amounts, or balances.\n- When user says \"all\" or an imprecise amount, call the read tool first to get the exact number.\n\n## Tool usage\n- Use tools proactively \u2014 don't refuse requests you can handle.\n- For real-world questions (weather, search, news, prices), use pay_api. Tell the user the cost first.\n- For broad market data (yields across protocols, token prices, TVL, protocol comparisons), use defillama_* tools.\n- To discover Sui protocols, use defillama_sui_protocols first, then defillama_protocol_info with the slug.\n- Run multiple read-only tools in parallel when you need several data points.\n- If a tool errors, say what went wrong and what to try instead. One sentence.\n\n## Multi-step flows\n- \"How much X for Y?\": swap_quote first, then swap_execute if user confirms.\n- \"Swap then save\": swap_execute \u2192 balance_check \u2192 save_deposit. Confirm each step.\n- \"Buy $X of token\": defillama_token_prices \u2192 calculate amount \u2192 swap_execute.\n- \"Best yield on SUI\": compare rates_info (NAVI lending) + defillama_yield_pools (broader) + volo_stats.\n- save_deposit supports: USDC (default), USDT, SUI, USDe, USDsui. Pass asset param for non-USDC.\n- withdraw supports: USDC, USDT, SUI, USDe, USDsui. Pass asset param to withdraw a specific token.\n- \"Deposit SUI to earn yield\": save_deposit with asset=\"SUI\" for NAVI lending, or volo_stake for SUI liquid staking.\n- \"What protocols are on Sui?\": defillama_sui_protocols \u2192 defillama_protocol_info for details.\n\n## Safety\n- Never encourage risky financial behavior.\n- Warn when health factor < 1.5.\n- All amounts in USDC unless stated otherwise.";
1096
1096
 
1097
1097
  export { AnthropicProvider, type AnthropicProviderConfig, type BalancePrices, type BalanceResult, type BuildToolOptions, type ChatParams, type CompactOptions, type ContentBlock, type CostSnapshot, CostTracker, type CostTrackerConfig, DEFAULT_SYSTEM_PROMPT, type EngineConfig, type EngineEvent, type HealthFactorResult, type LLMProvider, type McpCallResult, McpClientManager, McpResponseCache, type McpServerConfig, type McpServerConnection, type McpToolAdapterConfig, type McpToolDescriptor, MemorySessionStore, type Message, NAVI_MCP_CONFIG, NAVI_MCP_URL, NAVI_SERVER_NAME, type NaviRawCoin, type NaviRawHealthFactor, type NaviRawPool, type NaviRawPosition, type NaviRawPositionsResponse, type NaviRawProtocolStats, type NaviRawRewardsResponse, type NaviReadOptions, NaviTools, type PendingAction, type PendingReward, type PendingToolCall, type PermissionLevel, type PermissionResponse, type PositionEntry, type ProtocolStats, type ProviderEvent, QueryEngine, READ_TOOLS, type RatesResult, type SSEEvent, type SavingsResult, type ServerPositionData, type SessionData, type SessionStore, type StopReason, type SuiCoinBalance, type Tool, type ToolChoice, type ToolContext, type ToolDefinition, type ToolJsonSchema, type ToolResult, TxMutex, WRITE_TOOLS, type WalletCoin, adaptAllMcpTools, adaptAllServerTools, adaptMcpTool, balanceCheckTool, borrowTool, buildMcpTools, buildTool, claimRewardsTool, clearPriceCache, compactMessages, defillamaChainTvlTool, defillamaPriceChangeTool, defillamaProtocolFeesTool, defillamaProtocolInfoTool, defillamaSuiProtocolsTool, defillamaTokenPricesTool, defillamaYieldPoolsTool, engineToSSE, estimateTokens, extractMcpText, fetchAvailableRewards, fetchBalance, fetchHealthFactor, fetchPositions, fetchProtocolStats, fetchRates, fetchSavings, fetchTokenPrices, fetchWalletCoins, findTool, getDefaultTools, getMcpManager, getWalletAddress, hasNaviMcp, healthCheckTool, mppServicesTool, parseMcpJson, parseSSE, payApiTool, ratesInfoTool, registerEngineTools, repayDebtTool, requireAgent, runTools, saveContactTool, saveDepositTool, savingsInfoTool, sendTransferTool, serializeSSE, swapExecuteTool, swapQuoteTool, toolsToDefinitions, transactionHistoryTool, transformBalance, transformHealthFactor, transformPositions, transformRates, transformRewards, transformSavings, validateHistory, voloStakeTool, voloStatsTool, voloUnstakeTool, withdrawTool };
package/dist/index.js CHANGED
@@ -999,20 +999,20 @@ var transactionHistoryTool = buildTool({
999
999
  });
1000
1000
  var saveDepositTool = buildTool({
1001
1001
  name: "save_deposit",
1002
- description: "Deposit into NAVI lending to earn yield. Supports any NAVI-listed asset: USDC, USDT, SUI, WAL, ETH, NAVX, GOLD, USDe, USDsui. Always call balance_check first to know the available amount.",
1002
+ description: "Deposit into NAVI lending to earn yield. Supported assets: USDC, USDT, SUI, USDe, USDsui. Amount is in token units (not USD).",
1003
1003
  inputSchema: z.object({
1004
1004
  amount: z.number().positive(),
1005
- asset: z.string().optional().describe("Asset to deposit (default: USDC). Supports: USDC, USDT, SUI, WAL, ETH, NAVX, GOLD, USDe, USDsui")
1005
+ asset: z.string().optional().describe("Asset to deposit (default: USDC). Supported: USDC, USDT, SUI, USDe, USDsui")
1006
1006
  }),
1007
1007
  jsonSchema: {
1008
1008
  type: "object",
1009
1009
  properties: {
1010
1010
  amount: {
1011
- description: "Exact amount to save in token units (call balance_check first)"
1011
+ description: "Exact amount to deposit in token units"
1012
1012
  },
1013
1013
  asset: {
1014
1014
  type: "string",
1015
- description: "Asset to deposit (default: USDC). Supports: USDC, USDT, SUI, WAL, ETH, NAVX, GOLD, USDe, USDsui"
1015
+ description: "Asset to deposit (default: USDC). Supported: USDC, USDT, SUI, USDe, USDsui"
1016
1016
  }
1017
1017
  },
1018
1018
  required: ["amount"]
@@ -1040,20 +1040,20 @@ var saveDepositTool = buildTool({
1040
1040
  });
1041
1041
  var withdrawTool = buildTool({
1042
1042
  name: "withdraw",
1043
- description: "Withdraw from NAVI lending back to wallet. Supports any deposited asset (USDC, USDT, SUI, WAL, ETH, NAVX, GOLD, etc). Always call savings_info first. Checks health factor to prevent liquidation if there is outstanding debt.",
1043
+ description: "Withdraw from NAVI lending back to wallet. Supported assets: USDC, USDT, SUI, USDe, USDsui. Checks health factor to prevent liquidation if there is outstanding debt.",
1044
1044
  inputSchema: z.object({
1045
1045
  amount: z.number().positive(),
1046
- asset: z.string().optional().describe("Asset to withdraw (default: picks largest position). Supports: USDC, USDT, SUI, WAL, ETH, NAVX, GOLD, USDe, USDsui")
1046
+ asset: z.string().optional().describe("Asset to withdraw (default: picks largest position). Supported: USDC, USDT, SUI, USDe, USDsui")
1047
1047
  }),
1048
1048
  jsonSchema: {
1049
1049
  type: "object",
1050
1050
  properties: {
1051
1051
  amount: {
1052
- description: "Exact amount to withdraw (call savings_info first to get deposited amount)"
1052
+ description: "Exact amount to withdraw in token units"
1053
1053
  },
1054
1054
  asset: {
1055
1055
  type: "string",
1056
- description: "Asset to withdraw (default: picks largest position). Supports: USDC, USDT, SUI, WAL, ETH, NAVX, GOLD, USDe, USDsui"
1056
+ description: "Asset to withdraw (default: picks largest position). Supported: USDC, USDT, SUI, USDe, USDsui"
1057
1057
  }
1058
1058
  },
1059
1059
  required: ["amount"]
@@ -1858,9 +1858,9 @@ Only offer to execute actions you have tools for. If you retrieved a quote, data
1858
1858
  - "Swap then save": swap_execute \u2192 balance_check \u2192 save_deposit. Confirm each step.
1859
1859
  - "Buy $X of token": defillama_token_prices \u2192 calculate amount \u2192 swap_execute.
1860
1860
  - "Best yield on SUI": compare rates_info (NAVI lending) + defillama_yield_pools (broader) + volo_stats.
1861
- - save_deposit supports any NAVI asset: USDC (default), USDT, SUI, WAL, ETH, NAVX, GOLD, USDe, USDsui. Pass asset param for non-USDC.
1862
- - withdraw supports any deposited NAVI asset. Pass asset param to withdraw a specific token.
1863
- - "Deposit WAL/ETH/SUI to earn yield": save_deposit with asset="WAL"/"ETH"/"SUI" for NAVI lending, or volo_stake for SUI liquid staking.
1861
+ - save_deposit supports: USDC (default), USDT, SUI, USDe, USDsui. Pass asset param for non-USDC.
1862
+ - withdraw supports: USDC, USDT, SUI, USDe, USDsui. Pass asset param to withdraw a specific token.
1863
+ - "Deposit SUI to earn yield": save_deposit with asset="SUI" for NAVI lending, or volo_stake for SUI liquid staking.
1864
1864
  - "What protocols are on Sui?": defillama_sui_protocols \u2192 defillama_protocol_info for details.
1865
1865
 
1866
1866
  ## Safety