Metadata-Version: 2.4
Name: xagentauth
Version: 0.1.0
Summary: AgentAuth client SDK for Python — authenticate AI agents
License-Expression: MIT
Keywords: agent,ai,authentication,jwt
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2
Requires-Dist: pyjwt>=2.9
Provides-Extra: all
Requires-Dist: crewai-tools>=0.14; extra == 'all'
Requires-Dist: langchain-core>=0.3; extra == 'all'
Provides-Extra: crewai
Requires-Dist: crewai-tools>=0.14; extra == 'crewai'
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest-httpx>=0.34; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.3; extra == 'langchain'
Description-Content-Type: text/markdown

# xagentauth

**AgentAuth client SDK for Python** — authenticate AI agents against any AgentAuth-compatible server.

## Installation

```bash
pip install xagentauth
```

With LangChain integration:
```bash
pip install xagentauth[langchain]
```

With CrewAI integration:
```bash
pip install xagentauth[crewai]
```

## Quickstart

```python
import asyncio
from xagentauth import AgentAuthClient

async def main():
    client = AgentAuthClient(
        base_url="https://api.example.com",
        api_key="ak_...",
    )

    # One-call flow: init → get → solve
    result = await client.authenticate(
        difficulty="medium",
        solver=my_solver,
    )

    print(f"Token: {result.token}")
    print(f"Score: {result.score}")

asyncio.run(main())
```

### Step-by-step API

```python
init = await client.init_challenge(difficulty="hard")
challenge = await client.get_challenge(init.id, init.session_token)

# Solve the challenge with your agent
answer = await compute_answer(challenge.payload)

result = await client.solve(init.id, answer, init.session_token)
print(f"Token: {result.token}")
```

## Features

- Async-first with `httpx`
- Full challenge flow: init → get → solve → verify
- Auto-HMAC computation on solve requests
- AgentAuth response header parsing
- Pydantic models for type safety
- LangChain and CrewAI tool integrations

## License

MIT
