Metadata-Version: 2.4
Name: nano-empire-tollbooth
Version: 0.1.0
Summary: Paper-mode protocol tollbooth for A2A agent swarms
Author: Nano Empire
License: MIT
Keywords: a2a,agent,tollbooth,metering,paper-mode,settlement
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
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Dynamic: license-file

# nano-empire-tollbooth

Paper-mode protocol tollbooth for A2A agent swarms.

The package meters routed agent messages, writes a JSONL settlement ledger, and exposes a fail-closed live-mode verifier hook. It is designed as a developer-facing wedge for A2A Gateway pilots, not as autonomous payment capture.

## Install

```bash
pip install nano-empire-tollbooth
```

## Quick Start

```python
import asyncio
from nano_empire_tollbooth import Tollbooth, TollboothConfig

booth = Tollbooth(TollboothConfig(paper_mode=True))

async def main() -> None:
    record = await booth.charge(
        task_id="task-123",
        source_agent="agent-alpha",
        target_agent="agent-beta",
    )
    print(record.status.value, record.amount_usd)

asyncio.run(main())
```

## Safety Defaults

- `paper_mode=True` by default.
- `TOLLBOOTH_PAPER_MODE=true` forces paper mode.
- Live mode with `require_payment_before_route=True` returns `pending` unless wallet, signature, and verifier are present.
- Live mode with an invalid verifier result returns `failed`.
- Ledger records are append-only JSONL entries.

## Revenue Path

Use the SDK as a proof asset for:

- `$299` Diagram-to-Agent Workflow Audit
- `$999` A2A Gateway Pilot
- enterprise private mesh integration

Publishing, live payment activation, and external outreach remain human-approved actions.
