Metadata-Version: 2.4
Name: sente-sdk
Version: 0.2.0
Summary: Managed email identities for AI agents — the Python client for Sente (import sente).
Author: Sente Labs
License: UNLICENSED
Project-URL: Homepage, https://sente.run
Project-URL: Documentation, https://sente.run/skill.md
Keywords: sente,ai-agents,email,identity,agentaccount
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# sente-sdk

Managed email identities for AI agents — the Python client for [Sente](https://sente.run).
Give your agent a real, reusable email address it owns: send, receive, and react to mail.

Dependency-free (stdlib only). The PyPI distribution is `sente-sdk`; the import is `sente`.

```bash
pip install sente-sdk
```

```python
from sente import Sente

sente = Sente(api_key="sk_sente_...")              # get a key with the `sente` CLI: `sente login`

idt = sente.identities.create(name="support-bot")  # -> support-bot@agents.sente.run
sente.messages.send(idt.id, to="user@example.com", subject="hi", text="from your agent")

# React to inbound mail (a long-running consumer; for production prefer a webhook):
for msg in sente.messages.stream(idt.id):
    if msg.direction != "outbound":
        body = (msg.parsed or {}).get("text", "")
        # ... handle msg.from_addr / msg.subject / body
```

Waiting for a verification email (the agent signed up somewhere with `idt.email`)? Stamp `since`
**before** triggering the action, then block for the extracted code or link:

```python
from datetime import datetime, timezone

since = datetime.now(timezone.utc).isoformat()
# ... trigger the app's "send code" action ...
r = sente.messages.wait_for_otp(idt.id, since=since, timeout=60)  # -> OtpResult(code, message) | None
if r:
    print(r.code)  # magic links: wait_for_magic_link(...) -> MagicLinkResult(link, message) | None
```

Webhook handlers receive a thin event `{ "type": "message.received", "message": { "id": ... } }` with
an `x-sente-secret` header; fetch the full message with `sente.messages.get(message_id)`.

Full onboarding playbook (CLI + framework templates): <https://sente.run/skill.md>.
