| Crates.io | reputation-types |
| lib.rs | reputation-types |
| version | 0.1.0 |
| created_at | 2025-07-15 19:56:43.772971+00 |
| updated_at | 2025-07-15 19:56:43.772971+00 |
| description | Core types and data structures for the KnowThat Reputation Engine |
| homepage | https://github.com/Know-That-Ai/reputation-engine |
| repository | https://github.com/Know-That-Ai/reputation-engine |
| max_upload_size | |
| id | 1753885 |
| size | 51,102 |
Core data types and structures for the KnowThat Reputation Engine.
This crate provides the fundamental data structures used throughout the KnowThat reputation system, including agent data, reputation scores, and builders for constructing agent instances. It serves as the foundation for all reputation calculations and interactions.
#![forbid(unsafe_code)] for memory safety guaranteesAgentDataRepresents an MCP agent with all reputation-relevant data including:
ReputationScoreThe calculated reputation score containing:
AgentDataBuilderFluent builder for constructing AgentData instances with validation.
Add this to your Cargo.toml:
[dependencies]
reputation-types = "0.1.0"
use reputation_types::{AgentData, AgentDataBuilder, ReputationScore};
// Create agent data using the builder
let agent = AgentDataBuilder::new("did:example:123")
.total_interactions(150)
.with_reviews(100, 4.5)
.mcp_level(2)
.identity_verified(true)
.build()
.unwrap();
println!("Agent: {}", agent.agent_id);
println!("Reviews: {} (avg: {})", agent.review_count, agent.average_rating);
use reputation_types::AgentData;
let agent = AgentData::builder("did:example:456")
.total_interactions(60)
.with_reviews(50, 3.8)
.mcp_level(1)
.identity_verified(false)
.build()
.unwrap();
use reputation_types::ReputationScore;
let score = ReputationScore {
score: 0.85,
confidence: 0.92,
// ... other fields
};
println!("Score: {:.2} ({}% confident)", score.score, (score.confidence * 100.0) as u8);
serde - Serialization supportwasm - WebAssembly compatibility (enables chrono/wasmbind)Licensed under either of:
at your option.
This is part of the KnowThat Reputation Engine project. Please see the main repository for contribution guidelines.