diff --git a/agentscore/__init__.py b/agentscore/__init__.py index 4347471..346a821 100644 --- a/agentscore/__init__.py +++ b/agentscore/__init__.py @@ -9,6 +9,7 @@ DecisionPolicy, EntityType, Grade, + Reputation, ReputationResponse, ReputationResponseFull, ReputationStatus, @@ -29,6 +30,7 @@ "DecisionPolicy", "EntityType", "Grade", + "Reputation", "ReputationResponse", "ReputationResponseFull", "ReputationStatus", diff --git a/agentscore/types.py b/agentscore/types.py index 4f87472..670555f 100644 --- a/agentscore/types.py +++ b/agentscore/types.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Any, Literal, TypedDict +from typing import Literal, TypedDict Grade = Literal["A", "B", "C", "D", "F"] EntityType = Literal["agent", "service", "hybrid", "wallet", "bot", "unknown"] @@ -54,6 +54,42 @@ class Activity(TypedDict): last_verified_tx_at: str | None +class Reputation(TypedDict): + feedback_count: int + client_count: int + trust_avg: float | None + uptime_avg: float | None + activity_avg: float | None + last_feedback_at: str | None + + +class EvidenceSummary(TypedDict, total=False): + candidate_tx_count: int + confirmed_or_likely_tx: int + endpoint_count: int + github_stars: int + github_url: str | None + has_a2a_agent_card: bool + has_ens: bool + has_github: bool + has_website: bool + healthy_endpoints: int + is_erc8004: bool + metadata_kind: str | None + metadata_quality: str | None + multi_chain_count: int + reputation_feedback_count: int + reputation_trust_avg: float | None + reputation_uptime_avg: float | None + reputation_activity_avg: float | None + reputation_client_count: int + verified_tx_count: int + website_mentions_mcp: bool + website_mentions_x402: bool + website_reachable: bool + website_url: str | None + + class OperatorScore(TypedDict): score: int grade: Grade @@ -75,7 +111,7 @@ class ReputationResponse(TypedDict): score: Score identity: Identity | None activity: Activity | None - evidence_summary: dict[str, Any] | None + evidence_summary: EvidenceSummary | None data_semantics: str caveats: list[str] updated_at: str | None @@ -84,6 +120,7 @@ class ReputationResponse(TypedDict): class ReputationResponseFull(ReputationResponse, total=False): operator_score: OperatorScore agents: list[AgentSummary] + reputation: Reputation class DecisionPolicy(TypedDict, total=False): @@ -98,7 +135,7 @@ class AssessResponse(TypedDict): score: Score identity: Identity | None activity: Activity | None - evidence_summary: dict[str, Any] | None + evidence_summary: EvidenceSummary | None data_semantics: str caveats: list[str] updated_at: str | None diff --git a/pyproject.toml b/pyproject.toml index 7673f55..e310a0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "agentscore-py" -version = "1.1.0" +version = "1.2.0" description = "Python client for the AgentScore trust and reputation API" readme = "README.md" license = "MIT" diff --git a/uv.lock b/uv.lock index 28800db..c6de32f 100644 --- a/uv.lock +++ b/uv.lock @@ -8,7 +8,7 @@ resolution-markers = [ [[package]] name = "agentscore-py" -version = "1.1.0" +version = "1.2.0" source = { editable = "." } dependencies = [ { name = "httpx" }, @@ -208,11 +208,11 @@ wheels = [ [[package]] name = "pygments" -version = "2.19.2" +version = "2.20.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" } +sdist = { url = "https://files.pythonhosted.org/packages/c3/b2/bc9c9196916376152d655522fdcebac55e66de6603a76a02bca1b6414f6c/pygments-2.20.0.tar.gz", hash = "sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f", size = 4955991, upload-time = "2026-03-29T13:29:33.898Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" }, + { url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176", size = 1231151, upload-time = "2026-03-29T13:29:30.038Z" }, ] [[package]]