@aimf/reputation
v0.1.1
Published
AIMF Reputation System - Trust scores and history tracking for NeuralConnect marketplace
Maintainers
Readme
@aimf/reputation
AIMF Reputation System - Trust scores and history tracking for the AI-MCP Framework.
Installation
npm install @aimf/reputation
# or
pnpm add @aimf/reputationFeatures
- Trust Scores: Calculate and manage user reputation scores
- History Tracking: Complete history of reputation changes
- Dispute Resolution: Handle disputes between users
- Trust Levels: Automatic trust level progression (NEW → BUILDING → ESTABLISHED → TRUSTED → PREMIUM)
Usage
import { createReputationSystem, EntityType, TrustLevel } from '@aimf/reputation';
// Create reputation system with custom thresholds
const { scores, history, disputes } = createReputationSystem({
establishedThreshold: 20,
trustedThreshold: 50,
premiumThreshold: 100,
});
// Get a user's reputation score
const score = scores.getScore('user-123', EntityType.SELLER);
console.log(`Trust Level: ${score.trustLevel}`);
console.log(`Overall Score: ${score.overallScore}`);
// Record a successful transaction
scores.recordTransaction('user-123', EntityType.SELLER, true);
// Record a review
scores.recordReview('user-123', EntityType.SELLER, 5, new Map([
['quality', 5],
['communication', 4],
]));
// Check if user is trusted
if (score.trustLevel === TrustLevel.TRUSTED) {
console.log('User is trusted!');
}Trust Levels
| Level | Description |
|-------|-------------|
| NEW | Just getting started |
| BUILDING | Building reputation |
| ESTABLISHED | Good track record |
| TRUSTED | Highly trusted |
| PREMIUM | Elite status |
| SUSPENDED | Account suspended |
API Reference
createReputationSystem(config)
Returns an object with:
scores: Reputation scoring servicehistory: Reputation history servicedisputes: Dispute management service
License
MIT
