@t2000/engine 1.23.1 → 1.24.0
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 +38 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -5273,6 +5273,43 @@ var pendingRewardsTool = buildTool({
|
|
|
5273
5273
|
return { data, displayText };
|
|
5274
5274
|
}
|
|
5275
5275
|
});
|
|
5276
|
+
var harvestRewardsTool = buildTool({
|
|
5277
|
+
name: "harvest_rewards",
|
|
5278
|
+
description: 'Compound write: claim all NAVI rewards, swap each non-USDC reward to USDC inline, deposit the merged USDC into NAVI savings. ONE confirm card, atomic settlement (every leg lands or none of them do). Use when the user wants their rewards to keep earning yield (the common case). Prefer `claim_rewards` instead when the user explicitly wants to RECEIVE the reward token (e.g. "I want my NAVX in my wallet"). Untradeable rewards get transferred back to wallet automatically \u2014 they don\'t block the harvest. Dust rewards (< $0.01) likewise. Returns a plan: claimed[], swaps[] (with expected USDC out per leg), skipped[] (with reason), expectedUsdcDeposited, plus the on-chain tx hash. Permission: always `confirm` \u2014 never auto-executes regardless of preset, because the bundle includes a swap + deposit and the user should see the breakdown.',
|
|
5279
|
+
inputSchema: z.object({
|
|
5280
|
+
slippage: z.number().min(1e-3).max(0.05).optional().describe("Per-swap slippage tolerance (0.001\u20130.05). Defaults to 0.01 (1%)."),
|
|
5281
|
+
minRewardUsd: z.number().min(0).optional().describe(
|
|
5282
|
+
'USD floor for "is this worth swapping?". Rewards below this transfer to wallet instead of being swapped. Default $0.01. Pass 0 to disable.'
|
|
5283
|
+
)
|
|
5284
|
+
}),
|
|
5285
|
+
jsonSchema: {
|
|
5286
|
+
type: "object",
|
|
5287
|
+
properties: {
|
|
5288
|
+
slippage: { type: "number", minimum: 1e-3, maximum: 0.05 },
|
|
5289
|
+
minRewardUsd: { type: "number", minimum: 0 }
|
|
5290
|
+
},
|
|
5291
|
+
required: []
|
|
5292
|
+
},
|
|
5293
|
+
isReadOnly: false,
|
|
5294
|
+
permissionLevel: "confirm",
|
|
5295
|
+
flags: { mutating: true },
|
|
5296
|
+
async call(input, context) {
|
|
5297
|
+
const data = {
|
|
5298
|
+
success: false,
|
|
5299
|
+
tx: null,
|
|
5300
|
+
claimed: [],
|
|
5301
|
+
swaps: [],
|
|
5302
|
+
skipped: [],
|
|
5303
|
+
expectedUsdcDeposited: 0,
|
|
5304
|
+
totalClaimedValueUsd: 0,
|
|
5305
|
+
gasCost: 0,
|
|
5306
|
+
degraded: false,
|
|
5307
|
+
degradationReason: null
|
|
5308
|
+
};
|
|
5309
|
+
const displayText = "Ready to harvest your NAVI rewards: I will claim everything that's pending, swap any non-USDC rewards into USDC, and deposit the total back into your NAVI savings \u2014 all in one transaction. Untradeable or tiny rewards transfer to your wallet so nothing is lost.";
|
|
5310
|
+
return { data, displayText };
|
|
5311
|
+
}
|
|
5312
|
+
});
|
|
5276
5313
|
var todoStatusSchema = z.enum(["pending", "in_progress", "completed"]);
|
|
5277
5314
|
var todoItemSchema = z.object({
|
|
5278
5315
|
id: z.string().min(1, "id must be a non-empty string").max(40, "id must be \u226440 chars (use a slug, not a sentence)"),
|
|
@@ -5564,6 +5601,7 @@ var WRITE_TOOLS = [
|
|
|
5564
5601
|
borrowTool,
|
|
5565
5602
|
repayDebtTool,
|
|
5566
5603
|
claimRewardsTool,
|
|
5604
|
+
harvestRewardsTool,
|
|
5567
5605
|
payApiTool,
|
|
5568
5606
|
swapExecuteTool,
|
|
5569
5607
|
voloStakeTool,
|