Metadata-Version: 2.4
Name: 3tears-channels
Version: 0.14.1
Summary: Unified message protocol for channel adapters in the 3tears platform
Project-URL: Repository, https://github.com/pacepace/3tears
Author: pace
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.14
Requires-Dist: 3tears
Requires-Dist: 3tears-agent-acl
Requires-Dist: 3tears-nats
Requires-Dist: 3tears-observe
Provides-Extra: discord
Requires-Dist: discord-py>=2.7; extra == 'discord'
Provides-Extra: slack
Requires-Dist: aiohttp>=3.9; extra == 'slack'
Requires-Dist: slack-bolt>=1.28; extra == 'slack'
Requires-Dist: slack-sdk>=3.41; extra == 'slack'
Provides-Extra: webhook
Requires-Dist: 3tears-agent-wake>=0.9.0; extra == 'webhook'
Requires-Dist: fastapi>=0.110; extra == 'webhook'
Provides-Extra: websocket
Requires-Dist: starlette>=0.36; extra == 'websocket'
Description-Content-Type: text/markdown

# 3tears-channels

A unified message protocol for the 3tears framework, with adapters for Slack, Discord, and WebSocket clients. Write your agent logic once and deliver it across channels.

```bash
pip install 3tears-channels
```

## What you get

- **One message model** -- `ChannelMessage`, `ChannelResponse`, `ChannelDeliveryMessage`, and `Attachment` carry a request and its reply regardless of channel.
- **Routing** -- `ChannelRouter` and `StreamingChannelRouter` dispatch inbound messages and stream responses back.
- **Slack and Discord** -- payload and rich-formatting builders (`build_slack_blocks`, `build_slack_payload`, `build_discord_embed`, `build_discord_payload`) plus a `should_use_rich_formatting` helper.
- **WebSocket** -- `WebSocketHandler`, `WebSocketProtocol`, a `ConnectionRegistry`, and frame primitives for real-time clients.
- **Rooms and presence** -- `RoomFanout`, `RoomState`, `RoomIndexCollection`, and a three-tier-backed `PresenceCollection` with a `PresenceSweeper` for connection liveness.

## Quickstart

```python
from threetears.channels import ChannelRouter, ChannelMessage, build_slack_blocks

router = ChannelRouter(...)
response = await router.dispatch(ChannelMessage(text="hello", channel="slack", ...))

blocks = build_slack_blocks(response)
```

## License

MIT. See [LICENSE](LICENSE).
