Crate reputation_types

Source
Expand description

§Reputation Types

Core data types for the MCP agent reputation system.

This crate provides the fundamental data structures used throughout the reputation system, including agent data, reputation scores, and a builder for constructing agent instances.

§Key Types

§Examples

§Creating Agent Data

use reputation_types::{AgentData, AgentDataBuilder};
 
// Using the builder (recommended)
let agent = AgentDataBuilder::new("did:example:123")
    .total_interactions(150)
    .with_reviews(100, 4.5)
    .mcp_level(2)
    .identity_verified(true)
    .build()
    .unwrap();
 
// Or use the convenience method
let agent = AgentData::builder("did:example:456")
    .total_interactions(60)
    .with_reviews(50, 3.8)
    .build()
    .unwrap();

Structs§

AgentData
Represents an MCP agent with all reputation-relevant data
AgentDataBuilder
Builder for constructing AgentData instances with a fluent API.
PriorBreakdown
Breakdown of prior score components
ReputationScore
The calculated reputation score for an agent
ScoreComponents
Detailed breakdown of score components

Enums§

BuilderError
Errors that can occur when building AgentData
ConfidenceLevel
Confidence level categorization based on confidence value