update on the agents and registry side

This commit is contained in:
2026-09-30 12:03:13 +05:30
parent 92e8da2842
commit 53199127ba
73 changed files with 7268 additions and 1134 deletions

View File

@@ -0,0 +1,37 @@
import { HighValueCodSkill } from '@/lib/assistant/skills/definitions/HighValueCodSkill';
describe('HighValueCodSkill', () => {
it('detects high value COD consignments at or above threshold', () => {
const rows = [
{
bookingid: 1,
bookingno: 'BK-COD-1',
orderstatus: 'active',
paymenttype: 'COD',
orderamount: 4500,
},
{
bookingid: 2,
bookingno: 'BK-COD-2',
orderstatus: 'active',
paymenttype: 'COD',
orderamount: 1500,
},
];
const findings = HighValueCodSkill.evaluate(rows, '2026-08-31 12:00:00', { codRiskThresholdAmount: 3000 });
expect(findings.length).toBe(1);
expect(findings[0].id).toBe('high_value_cod_alert');
expect(findings[0].count).toBe(1);
expect(findings[0].rows[0].bookingid).toBe(1);
});
it('executes enforce_otp_verification tool handler', async () => {
const tool = HighValueCodSkill.tools.find((t) => t.name === 'enforce_otp_verification');
expect(tool).toBeDefined();
const result = await tool.handler({ bookingId: 1 });
expect(result.success).toBe(true);
expect(result.proposal.action).toBe('require_otp');
});
});