@t2000/engine 0.7.3 → 0.7.5

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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { resolveSymbol, getDecimalsForCoinType, getSwapQuote, SUI_TYPE } from '@t2000/sdk';
2
+ import { resolveSymbol, getDecimalsForCoinType, assertAllowedAsset, getSwapQuote, SUI_TYPE } from '@t2000/sdk';
3
3
  import { Client } from '@modelcontextprotocol/sdk/client/index.js';
4
4
  import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
5
5
  import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
@@ -1043,7 +1043,7 @@ var transactionHistoryTool = buildTool({
1043
1043
  });
1044
1044
  var saveDepositTool = buildTool({
1045
1045
  name: "save_deposit",
1046
- description: "Deposit USDC into NAVI savings to earn yield. ONLY USDC is accepted \u2014 if the user asks to save any other token (USDT, SUI, USDe, etc.), do NOT call this tool. Instead tell them to swap to USDC first, then deposit.",
1046
+ description: "Deposit USDC into NAVI savings to earn yield. ONLY USDC is accepted. If the user asks to save/deposit any other token (USDT, SUI, USDe, etc.), do NOT call this tool and do NOT automatically swap their tokens and deposit. Instead, tell the user that only USDC deposits are supported and ask if they would like to swap to USDC first. Let the user decide \u2014 never auto-chain swap + deposit.",
1047
1047
  inputSchema: z.object({
1048
1048
  amount: z.number().positive(),
1049
1049
  asset: z.string().optional().describe("Must be USDC or omitted. Any other asset is rejected.")
@@ -1064,9 +1064,7 @@ var saveDepositTool = buildTool({
1064
1064
  isReadOnly: false,
1065
1065
  permissionLevel: "confirm",
1066
1066
  async call(input, context) {
1067
- if (input.asset && input.asset.toUpperCase() !== "USDC") {
1068
- throw new Error(`Only USDC deposits are supported. Cannot deposit ${input.asset}. Swap to USDC first, then deposit.`);
1069
- }
1067
+ assertAllowedAsset("save", input.asset);
1070
1068
  const agent = requireAgent(context);
1071
1069
  const result = await agent.save({ amount: input.amount });
1072
1070
  return {
@@ -1190,9 +1188,7 @@ var borrowTool = buildTool({
1190
1188
  isReadOnly: false,
1191
1189
  permissionLevel: "confirm",
1192
1190
  async call(input, context) {
1193
- if (input.asset && input.asset.toUpperCase() !== "USDC") {
1194
- throw new Error(`Only USDC borrows are supported. Cannot borrow ${input.asset}.`);
1195
- }
1191
+ assertAllowedAsset("borrow", input.asset);
1196
1192
  const agent = requireAgent(context);
1197
1193
  const result = await agent.borrow({ amount: input.amount });
1198
1194
  return {