@aspect-warden/mcp-server 0.4.0 → 0.4.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/index.js +24 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -322,6 +322,7 @@ server.tool('warden_transfer', 'Send ERC-20 tokens with policy enforcement. Eval
|
|
|
322
322
|
const decision = policyEngine.evaluate(recipient, valueMicro, tokenAddress, 'ethereum');
|
|
323
323
|
auditLogger.log(decision);
|
|
324
324
|
if (!decision.approved) {
|
|
325
|
+
const currentPolicy = policyEngine.getPolicy();
|
|
325
326
|
return {
|
|
326
327
|
content: [{
|
|
327
328
|
type: 'text',
|
|
@@ -331,6 +332,10 @@ server.tool('warden_transfer', 'Send ERC-20 tokens with policy enforcement. Eval
|
|
|
331
332
|
reason: decision.reason,
|
|
332
333
|
ruleTriggered: decision.ruleTriggered,
|
|
333
334
|
riskScore: decision.riskScore,
|
|
335
|
+
currentLimits: {
|
|
336
|
+
maxPerTx: `${Number(currentPolicy.maxPerTx) / 1e6} USDT`,
|
|
337
|
+
dailyLimit: `${Number(currentPolicy.dailyLimit) / 1e6} USDT`,
|
|
338
|
+
},
|
|
334
339
|
}),
|
|
335
340
|
}],
|
|
336
341
|
};
|
|
@@ -486,6 +491,25 @@ server.tool('warden_update_policy', 'Modify policy rules at runtime. Can update
|
|
|
486
491
|
updatedFields.push('cooldownMs');
|
|
487
492
|
}
|
|
488
493
|
policyEngine.updatePolicy(updates);
|
|
494
|
+
// Persist updated policy so it survives restarts
|
|
495
|
+
if (storedPrivateKey) {
|
|
496
|
+
const p = policyEngine.getPolicy();
|
|
497
|
+
saveState({
|
|
498
|
+
privateKey: storedPrivateKey,
|
|
499
|
+
agentId: p.agentId,
|
|
500
|
+
policy: {
|
|
501
|
+
maxPerTx: p.maxPerTx.toString(),
|
|
502
|
+
dailyLimit: p.dailyLimit.toString(),
|
|
503
|
+
requireApprovalAbove: p.requireApprovalAbove.toString(),
|
|
504
|
+
cooldownMs: p.cooldownMs,
|
|
505
|
+
allowedTokens: p.allowedTokens,
|
|
506
|
+
blockedTokens: p.blockedTokens,
|
|
507
|
+
allowedRecipients: p.allowedRecipients,
|
|
508
|
+
blockedRecipients: p.blockedRecipients,
|
|
509
|
+
allowedChains: p.allowedChains,
|
|
510
|
+
},
|
|
511
|
+
});
|
|
512
|
+
}
|
|
489
513
|
return {
|
|
490
514
|
content: [{
|
|
491
515
|
type: 'text',
|