Metadata-Version: 2.4
Name: mailio-receipt
Version: 0.0.2
Summary: Cryptographically verifiable, append-only event records for human-agent and agent-agent workflows
Project-URL: Homepage, https://github.com/mailio/mailio-receipts-python
Project-URL: Documentation, https://github.com/mailio/mailio-receipts-python#readme
Project-URL: Repository, https://github.com/mailio/mailio-receipts-python
Author-email: Mailio <hello@mail.io>
License-Expression: MIT
Keywords: audit,cryptography,did,mailio,receipt,workflow
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.10
Requires-Dist: canonicaljson>=2.0
Requires-Dist: cryptography>=41.0
Requires-Dist: httpx>=0.25
Provides-Extra: dev
Requires-Dist: mypy>=1.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: respx>=0.20; extra == 'dev'
Requires-Dist: ruff>=0.1; extra == 'dev'
Description-Content-Type: text/markdown

# MailioReceipt v1

Cryptographically verifiable, append-only event records for human-agent and agent-agent workflows.

## Installation

```bash
pip install mailio-receipt
```

## Quick Start

```python
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.backends import default_backend

from mailio_receipt import (
    create_receipt,
    create_event,
    Actors,
    Intent,
    IntentKind,
)

# Generate a signing key (P-256 or Ed25519)
private_key = ec.generate_private_key(ec.SECP256R1(), default_backend())

# Create an event
event = create_event(
    flow_id="660f9400-f39c-51e5-b827-557766551111",
    actors=Actors(
        issuer="did:web:agent.example.com",
        subject="did:web:user.example.com",
    ),
    intent=Intent(
        kind=IntentKind.ACTION_PLANNED,
        action="invoice.send",
        category="financial",
        scope={"invoiceId": "INV-2026-001"},
    ),
)

# Sign and create receipt
receipt = create_receipt(
    event=event,
    private_key=private_key,
    signer_did="did:web:agent.example.com",
)

print(f"Receipt created: {receipt.digest[:16]}...")
```

## License

MIT
