Metadata-Version: 2.4
Name: tailbus
Version: 0.1.0
Summary: Python SDK for tailbus — agent communication mesh
Project-URL: Homepage, https://tailbus.co
Project-URL: Repository, https://github.com/alexanderfrey/tailbus
Project-URL: Documentation, https://tailbus.co/getting-started
Project-URL: Issues, https://github.com/alexanderfrey/tailbus/issues
Project-URL: Changelog, https://github.com/alexanderfrey/tailbus/releases
Author-email: Alex Frey <alex@tailbus.co>
License-Expression: MIT
Keywords: a2a,agents,mcp,mesh,messaging,tailbus
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: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Networking
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: test
Requires-Dist: pytest>=7; extra == 'test'
Description-Content-Type: text/markdown

# tailbus Python SDK

Python SDK for [tailbus](https://github.com/alexanderfrey/tailbus) — an agent communication mesh.

## Install

```bash
pip install tailbus
```

Requires Python 3.10+ and the `tailbus` CLI on your PATH.

## Quick start

### Async

```python
from tailbus import AsyncAgent, Manifest

async with AsyncAgent("my-agent") as agent:
    await agent.register(manifest=Manifest(description="My agent"))

    @agent.on_message
    async def handle(msg):
        await agent.send(msg.session, f"echo: {msg.body}")

    await agent.run_forever()
```

### Sync

```python
from tailbus import SyncAgent

with SyncAgent("my-agent") as agent:
    agent.register()
    opened = agent.open_session("other-agent", "hello")
    agent.send(opened.session, "follow-up")
    agent.resolve(opened.session, "done")
```

## API

- **`AsyncAgent(handle, binary="tailbus")`** — async/await agent with `@on_message` decorator and `run_forever()`
- **`SyncAgent(handle, binary="tailbus")`** — threading-based synchronous wrapper
- **`Manifest(description, commands)`** — service manifest with optional command specs
- **`CommandSpec(name, description, schema)`** — typed command with JSON Schema

Both agents support: `register()`, `open_session()`, `send()`, `resolve()`, `list_handles()`, `list_sessions()`, `introspect()`.

## License

MIT
