@t2000/engine 0.7.2 → 0.7.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.
package/dist/index.d.ts CHANGED
@@ -823,6 +823,7 @@ declare const transactionHistoryTool: Tool<{
823
823
 
824
824
  declare const saveDepositTool: Tool<{
825
825
  amount: number;
826
+ asset?: string | undefined;
826
827
  }, {
827
828
  success: boolean;
828
829
  tx: string;
@@ -861,6 +862,7 @@ declare const sendTransferTool: Tool<{
861
862
 
862
863
  declare const borrowTool: Tool<{
863
864
  amount: number;
865
+ asset?: string | undefined;
864
866
  }, {
865
867
  success: boolean;
866
868
  tx: string;
package/dist/index.js CHANGED
@@ -1043,15 +1043,20 @@ var transactionHistoryTool = buildTool({
1043
1043
  });
1044
1044
  var saveDepositTool = buildTool({
1045
1045
  name: "save_deposit",
1046
- description: "Deposit USDC into NAVI lending to earn yield. Amount is in USDC.",
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.",
1047
1047
  inputSchema: z.object({
1048
- amount: z.number().positive()
1048
+ amount: z.number().positive(),
1049
+ asset: z.string().optional().describe("Must be USDC or omitted. Any other asset is rejected.")
1049
1050
  }),
1050
1051
  jsonSchema: {
1051
1052
  type: "object",
1052
1053
  properties: {
1053
1054
  amount: {
1054
1055
  description: "Exact amount of USDC to deposit"
1056
+ },
1057
+ asset: {
1058
+ type: "string",
1059
+ description: "Must be USDC or omitted. Any other asset is rejected."
1055
1060
  }
1056
1061
  },
1057
1062
  required: ["amount"]
@@ -1059,6 +1064,9 @@ var saveDepositTool = buildTool({
1059
1064
  isReadOnly: false,
1060
1065
  permissionLevel: "confirm",
1061
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
+ }
1062
1070
  const agent = requireAgent(context);
1063
1071
  const result = await agent.save({ amount: input.amount });
1064
1072
  return {
@@ -1160,16 +1168,21 @@ var sendTransferTool = buildTool({
1160
1168
  });
1161
1169
  var borrowTool = buildTool({
1162
1170
  name: "borrow",
1163
- description: "Borrow USDC against savings collateral. Requires existing savings deposits. Checks max safe borrow and health factor. Returns tx hash, fee, and post-borrow health factor.",
1171
+ description: "Borrow USDC against savings collateral. ONLY USDC borrows are supported. Requires existing savings deposits. Checks max safe borrow and health factor. Returns tx hash, fee, and post-borrow health factor.",
1164
1172
  inputSchema: z.object({
1165
- amount: z.number().positive()
1173
+ amount: z.number().positive(),
1174
+ asset: z.string().optional().describe("Must be USDC or omitted. Any other asset is rejected.")
1166
1175
  }),
1167
1176
  jsonSchema: {
1168
1177
  type: "object",
1169
1178
  properties: {
1170
1179
  amount: {
1171
1180
  type: "number",
1172
- description: "Amount in USD to borrow"
1181
+ description: "Amount in USDC to borrow"
1182
+ },
1183
+ asset: {
1184
+ type: "string",
1185
+ description: "Must be USDC or omitted. Any other asset is rejected."
1173
1186
  }
1174
1187
  },
1175
1188
  required: ["amount"]
@@ -1177,6 +1190,9 @@ var borrowTool = buildTool({
1177
1190
  isReadOnly: false,
1178
1191
  permissionLevel: "confirm",
1179
1192
  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
+ }
1180
1196
  const agent = requireAgent(context);
1181
1197
  const result = await agent.borrow({ amount: input.amount });
1182
1198
  return {