shll-skills 5.3.0 → 5.3.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/mcp.js CHANGED
@@ -709,7 +709,7 @@ function policyRejectionHelp(reason, tokenId) {
709
709
  }
710
710
  var server = new import_mcp.McpServer({
711
711
  name: "shll-defi",
712
- version: "5.2.0"
712
+ version: "5.3.0"
713
713
  });
714
714
  server.tool(
715
715
  "portfolio",
@@ -987,7 +987,7 @@ server.tool(
987
987
  const data = (0, import_viem2.encodeFunctionData)({ abi: VTOKEN_ABI, functionName: "redeemUnderlying", args: [amt] });
988
988
  const action = { target: vTokenAddr, value: 0n, data };
989
989
  const sim = await policyClient.validate(tokenId, action);
990
- if (!sim.ok) return { content: [{ type: "text", text: JSON.stringify({ status: "rejected", reason: sim.reason }) }] };
990
+ if (!sim.ok) return { content: [{ type: "text", text: JSON.stringify({ status: "rejected", reason: sim.reason, ...policyRejectionHelp(sim.reason, token_id) }) }] };
991
991
  const result = await policyClient.execute(tokenId, action, true);
992
992
  return { content: [{ type: "text", text: JSON.stringify({ status: "success", hash: result.hash, protocol: "venus", action: "redeem", token: symbol, amount }) }] };
993
993
  }
@@ -1052,7 +1052,7 @@ server.tool(
1052
1052
  action = { target: tokenInfo.address, value: 0n, data };
1053
1053
  }
1054
1054
  const sim = await policyClient.validate(tokenId, action);
1055
- if (!sim.ok) return { content: [{ type: "text", text: JSON.stringify({ status: "rejected", reason: sim.reason }) }] };
1055
+ if (!sim.ok) return { content: [{ type: "text", text: JSON.stringify({ status: "rejected", reason: sim.reason, ...policyRejectionHelp(sim.reason, token_id) }) }] };
1056
1056
  const result = await policyClient.execute(tokenId, action, true);
1057
1057
  return { content: [{ type: "text", text: JSON.stringify({ status: "success", hash: result.hash, token, amount, to: recipient }) }] };
1058
1058
  }
@@ -1139,7 +1139,7 @@ server.tool(
1139
1139
  const data = (0, import_viem2.encodeFunctionData)({ abi: WBNB_ABI, functionName: "deposit" });
1140
1140
  const action = { target: WBNB, value: amt, data };
1141
1141
  const sim = await policyClient.validate(tokenId, action);
1142
- if (!sim.ok) return { content: [{ type: "text", text: JSON.stringify({ status: "rejected", reason: sim.reason }) }] };
1142
+ if (!sim.ok) return { content: [{ type: "text", text: JSON.stringify({ status: "rejected", reason: sim.reason, ...policyRejectionHelp(sim.reason, token_id) }) }] };
1143
1143
  const result = await policyClient.execute(tokenId, action, true);
1144
1144
  return { content: [{ type: "text", text: JSON.stringify({ status: "success", hash: result.hash, message: `Wrapped ${amount} BNB \u2192 WBNB` }) }] };
1145
1145
  }
@@ -1160,7 +1160,7 @@ server.tool(
1160
1160
  const data = (0, import_viem2.encodeFunctionData)({ abi: WBNB_ABI, functionName: "withdraw", args: [amt] });
1161
1161
  const action = { target: WBNB, value: 0n, data };
1162
1162
  const sim = await policyClient.validate(tokenId, action);
1163
- if (!sim.ok) return { content: [{ type: "text", text: JSON.stringify({ status: "rejected", reason: sim.reason }) }] };
1163
+ if (!sim.ok) return { content: [{ type: "text", text: JSON.stringify({ status: "rejected", reason: sim.reason, ...policyRejectionHelp(sim.reason, token_id) }) }] };
1164
1164
  const result = await policyClient.execute(tokenId, action, true);
1165
1165
  return { content: [{ type: "text", text: JSON.stringify({ status: "success", hash: result.hash, message: `Unwrapped ${amount} WBNB \u2192 BNB` }) }] };
1166
1166
  }
package/dist/mcp.mjs CHANGED
@@ -220,7 +220,7 @@ function policyRejectionHelp(reason, tokenId) {
220
220
  }
221
221
  var server = new McpServer({
222
222
  name: "shll-defi",
223
- version: "5.2.0"
223
+ version: "5.3.0"
224
224
  });
225
225
  server.tool(
226
226
  "portfolio",
@@ -498,7 +498,7 @@ server.tool(
498
498
  const data = encodeFunctionData({ abi: VTOKEN_ABI, functionName: "redeemUnderlying", args: [amt] });
499
499
  const action = { target: vTokenAddr, value: 0n, data };
500
500
  const sim = await policyClient.validate(tokenId, action);
501
- if (!sim.ok) return { content: [{ type: "text", text: JSON.stringify({ status: "rejected", reason: sim.reason }) }] };
501
+ if (!sim.ok) return { content: [{ type: "text", text: JSON.stringify({ status: "rejected", reason: sim.reason, ...policyRejectionHelp(sim.reason, token_id) }) }] };
502
502
  const result = await policyClient.execute(tokenId, action, true);
503
503
  return { content: [{ type: "text", text: JSON.stringify({ status: "success", hash: result.hash, protocol: "venus", action: "redeem", token: symbol, amount }) }] };
504
504
  }
@@ -563,7 +563,7 @@ server.tool(
563
563
  action = { target: tokenInfo.address, value: 0n, data };
564
564
  }
565
565
  const sim = await policyClient.validate(tokenId, action);
566
- if (!sim.ok) return { content: [{ type: "text", text: JSON.stringify({ status: "rejected", reason: sim.reason }) }] };
566
+ if (!sim.ok) return { content: [{ type: "text", text: JSON.stringify({ status: "rejected", reason: sim.reason, ...policyRejectionHelp(sim.reason, token_id) }) }] };
567
567
  const result = await policyClient.execute(tokenId, action, true);
568
568
  return { content: [{ type: "text", text: JSON.stringify({ status: "success", hash: result.hash, token, amount, to: recipient }) }] };
569
569
  }
@@ -650,7 +650,7 @@ server.tool(
650
650
  const data = encodeFunctionData({ abi: WBNB_ABI, functionName: "deposit" });
651
651
  const action = { target: WBNB, value: amt, data };
652
652
  const sim = await policyClient.validate(tokenId, action);
653
- if (!sim.ok) return { content: [{ type: "text", text: JSON.stringify({ status: "rejected", reason: sim.reason }) }] };
653
+ if (!sim.ok) return { content: [{ type: "text", text: JSON.stringify({ status: "rejected", reason: sim.reason, ...policyRejectionHelp(sim.reason, token_id) }) }] };
654
654
  const result = await policyClient.execute(tokenId, action, true);
655
655
  return { content: [{ type: "text", text: JSON.stringify({ status: "success", hash: result.hash, message: `Wrapped ${amount} BNB \u2192 WBNB` }) }] };
656
656
  }
@@ -671,7 +671,7 @@ server.tool(
671
671
  const data = encodeFunctionData({ abi: WBNB_ABI, functionName: "withdraw", args: [amt] });
672
672
  const action = { target: WBNB, value: 0n, data };
673
673
  const sim = await policyClient.validate(tokenId, action);
674
- if (!sim.ok) return { content: [{ type: "text", text: JSON.stringify({ status: "rejected", reason: sim.reason }) }] };
674
+ if (!sim.ok) return { content: [{ type: "text", text: JSON.stringify({ status: "rejected", reason: sim.reason, ...policyRejectionHelp(sim.reason, token_id) }) }] };
675
675
  const result = await policyClient.execute(tokenId, action, true);
676
676
  return { content: [{ type: "text", text: JSON.stringify({ status: "success", hash: result.hash, message: `Unwrapped ${amount} WBNB \u2192 BNB` }) }] };
677
677
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shll-skills",
3
- "version": "5.3.0",
3
+ "version": "5.3.1",
4
4
  "description": "SHLL DeFi Agent — CLI + MCP Server for BSC",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -24,4 +24,4 @@
24
24
  "tsup": "^8.0.2",
25
25
  "typescript": "^5.4.5"
26
26
  }
27
- }
27
+ }
package/src/mcp.ts CHANGED
@@ -266,7 +266,7 @@ function policyRejectionHelp(reason: string | undefined, tokenId: string): Recor
266
266
 
267
267
  const server = new McpServer({
268
268
  name: "shll-defi",
269
- version: "5.2.0",
269
+ version: "5.3.0",
270
270
  });
271
271
 
272
272
  // ── Tool: portfolio ─────────────────────────────────────
@@ -575,7 +575,7 @@ server.tool(
575
575
  const action: Action = { target: vTokenAddr, value: 0n, data };
576
576
 
577
577
  const sim = await policyClient.validate(tokenId, action);
578
- if (!sim.ok) return { content: [{ type: "text" as const, text: JSON.stringify({ status: "rejected", reason: sim.reason }) }] };
578
+ if (!sim.ok) return { content: [{ type: "text" as const, text: JSON.stringify({ status: "rejected", reason: sim.reason, ...policyRejectionHelp(sim.reason, token_id) }) }] };
579
579
 
580
580
  const result = await policyClient.execute(tokenId, action, true);
581
581
  return { content: [{ type: "text" as const, text: JSON.stringify({ status: "success", hash: result.hash, protocol: "venus", action: "redeem", token: symbol, amount }) }] };
@@ -649,7 +649,7 @@ server.tool(
649
649
  }
650
650
 
651
651
  const sim = await policyClient.validate(tokenId, action);
652
- if (!sim.ok) return { content: [{ type: "text" as const, text: JSON.stringify({ status: "rejected", reason: sim.reason }) }] };
652
+ if (!sim.ok) return { content: [{ type: "text" as const, text: JSON.stringify({ status: "rejected", reason: sim.reason, ...policyRejectionHelp(sim.reason, token_id) }) }] };
653
653
 
654
654
  const result = await policyClient.execute(tokenId, action, true);
655
655
  return { content: [{ type: "text" as const, text: JSON.stringify({ status: "success", hash: result.hash, token, amount, to: recipient }) }] };
@@ -742,7 +742,7 @@ server.tool(
742
742
  const action: Action = { target: WBNB as Address, value: amt, data };
743
743
 
744
744
  const sim = await policyClient.validate(tokenId, action);
745
- if (!sim.ok) return { content: [{ type: "text" as const, text: JSON.stringify({ status: "rejected", reason: sim.reason }) }] };
745
+ if (!sim.ok) return { content: [{ type: "text" as const, text: JSON.stringify({ status: "rejected", reason: sim.reason, ...policyRejectionHelp(sim.reason, token_id) }) }] };
746
746
 
747
747
  const result = await policyClient.execute(tokenId, action, true);
748
748
  return { content: [{ type: "text" as const, text: JSON.stringify({ status: "success", hash: result.hash, message: `Wrapped ${amount} BNB → WBNB` }) }] };
@@ -766,7 +766,7 @@ server.tool(
766
766
  const action: Action = { target: WBNB as Address, value: 0n, data };
767
767
 
768
768
  const sim = await policyClient.validate(tokenId, action);
769
- if (!sim.ok) return { content: [{ type: "text" as const, text: JSON.stringify({ status: "rejected", reason: sim.reason }) }] };
769
+ if (!sim.ok) return { content: [{ type: "text" as const, text: JSON.stringify({ status: "rejected", reason: sim.reason, ...policyRejectionHelp(sim.reason, token_id) }) }] };
770
770
 
771
771
  const result = await policyClient.execute(tokenId, action, true);
772
772
  return { content: [{ type: "text" as const, text: JSON.stringify({ status: "success", hash: result.hash, message: `Unwrapped ${amount} WBNB → BNB` }) }] };