Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,26 @@ Single-package Python library published to PyPI.

- **uv** — package manager. Use `uv sync`, `uv run`.
- **ruff** — linting + formatting. `uv run ruff check .` and `uv run ruff format --check .`.
- **ty** — type checker (Astral). `uv run ty check agentscore/`.
- **vulture** — dead code detection.
- **pytest** — tests. `uv run pytest tests/`.
- **Lefthook** — git hooks. Pre-commit: ruff. Pre-push: vulture.
- **Lefthook** — git hooks. Pre-commit: ruff. Pre-push: ty + vulture (parallel).

## Key Commands

```bash
uv sync --all-extras
uv run ruff check .
uv run ruff format .
uv run ty check agentscore/
uv run pytest tests/
```

## Workflow

1. Create a branch
2. Make changes
3. Lefthook runs ruff on commit, vulture on push
3. Lefthook runs ruff on commit, ty + vulture on push
4. Open a PR — CI runs automatically
5. Merge (squash)

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
steps:
- uses: useblacksmith/checkout@v1
- uses: astral-sh/setup-uv@v7
- run: uv python install 3.12
- uses: actions/cache@v4
with:
path: |
Expand All @@ -30,5 +31,6 @@ jobs:
- run: uv sync --frozen --all-extras
- run: uv run ruff check .
- run: uv run ruff format --check .
- run: uv run ty check agentscore/
- run: uv run vulture . vulture_whitelist.py --min-confidence 80 --exclude .venv
- run: uv run pytest tests/ --cov=agentscore --cov-report=term-missing
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Bootstrap identity for first-time agents:

```python
session = client.create_session()
print(session["verify_url"], session["poll_secret"])
print(session["verify_url"], session["poll_url"], session["poll_secret"])

status = client.poll_session(session["session_id"], session["poll_secret"])
if status["status"] == "verified":
Expand Down
2 changes: 1 addition & 1 deletion agentscore/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _get_async_client(self) -> httpx.AsyncClient:
)
return self._async_client

def _handle_response(self, response: httpx.Response) -> dict:
def _handle_response(self, response: httpx.Response) -> Any:
if response.status_code == 429:
retry_after = response.headers.get("retry-after", "1")
raise AgentScoreError(
Expand Down
13 changes: 12 additions & 1 deletion agentscore/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,17 @@ class SessionCreateResponse(TypedDict):
expires_at: str


class SessionPollNextSteps(TypedDict, total=False):
action: str
user_message: str
header_name: str
poll_interval_seconds: int
eta_message: str
# Present when action == "contact_support" (e.g. sanctions "flagged" status).
support_email: str
support_subject: str


class _SessionPollResponseRequired(TypedDict):
session_id: str
status: str
Expand All @@ -215,7 +226,7 @@ class _SessionPollResponseRequired(TypedDict):
class SessionPollResponse(_SessionPollResponseRequired, total=False):
operator_token: str
completed_at: str
next_steps: NotRequired[dict]
next_steps: NotRequired[SessionPollNextSteps]
retry_after_seconds: NotRequired[int]
token_ttl_seconds: NotRequired[int]

Expand Down
3 changes: 3 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ pre-commit:
run: uv run ruff format --check {staged_files}

pre-push:
parallel: true
commands:
ty:
run: uv run ty check agentscore/
vulture:
run: uv run vulture . vulture_whitelist.py --min-confidence 80 --exclude .venv
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ build-backend = "hatchling.build"

[project]
name = "agentscore-py"
version = "1.7.0"
version = "1.8.0"
description = "Python client for the AgentScore trust and reputation API"
readme = "README.md"
license = "MIT"
requires-python = ">=3.9"
requires-python = ">=3.11"
keywords = ["agentscore", "x402", "erc-8004", "agent", "trust", "reputation", "wallet", "blockchain", "ai-agent", "agentic-payments"]
dependencies = [
"httpx>=0.25.0,<1.0.0",
Expand Down Expand Up @@ -42,9 +42,13 @@ packages = ["agentscore"]
[dependency-groups]
dev = [
"ruff>=0.11.0",
"ty>=0.0.32",
"vulture>=2.15",
"pytest-cov>=6.0",
"respx>=0.22.0",
"pytest-asyncio>=1.2.0",
"python-dotenv>=1.2.1",
]

[tool.ty.src]
include = ["agentscore"]
345 changes: 51 additions & 294 deletions uv.lock

Large diffs are not rendered by default.

Loading