Metadata-Version: 2.4
Name: concinno-skills-chat
Version: 0.1.0
Summary: Chat platform agent skills (Slack/Discord/Telegram/LINE) for Concinno — native Python API, MCP fallback optional. MIT-licensed SDKs only.
Project-URL: Homepage, https://github.com/aiking931931/concinno
Project-URL: Issues, https://github.com/aiking931931/concinno/issues
Project-URL: Changelog, https://github.com/aiking931931/concinno/blob/main/projects/concinno-skills-chat/CHANGELOG.md
Author-email: "AI King (Chen-Xuan Wang)" <me@ai-king.dev>
License-Expression: Apache-2.0
Keywords: agent,chat,concinno,discord,line,messaging,skills,slack,telegram
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software 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 :: Communications :: Chat
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: aiogram>=3.13
Requires-Dist: concinno>=2.15.1
Requires-Dist: discord-py>=2.4
Requires-Dist: line-bot-sdk>=3.12
Requires-Dist: slack-sdk>=3.27
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-cov>=5; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.7; extra == 'dev'
Description-Content-Type: text/markdown

# concinno-skills-chat

Chat-platform agent skills for [Concinno](https://pypi.org/project/concinno/).
Native Python API, MCP fallback optional. **MIT / Apache-2.0 licensed SDKs only**
— we deliberately skip `python-telegram-bot` (GPL-3.0) to avoid copy-left
contamination of the Concinno ecosystem.

## Status

MVP (0.1.0) — four one-shot tools:

| Tool class      | Platform | Underlying SDK           | SDK licence  |
|-----------------|----------|--------------------------|--------------|
| `SlackPost`     | Slack    | `slack-sdk`              | MIT          |
| `DiscordPost`   | Discord  | `discord.py`             | MIT          |
| `TelegramSend`  | Telegram | `aiogram`                | MIT          |
| `LineSend`      | LINE     | `line-bot-sdk` (v3)      | Apache-2.0   |

WhatsApp / Microsoft Teams are intentionally deferred until a
maintained Python SDK with a permissive licence exists (as of 2026-04
the ecosystem is either unofficial or AGPL-adjacent).

## Install

```bash
pip install concinno-skills-chat
```

All four SDKs are hard dependencies and pulled in automatically.

## Credentials

Each platform's bot token lives under a well-known key in the Concinno
`CredentialStore`, which reads (in order):

1. Process runtime overrides via `CredentialStore.set(...)`.
2. Env var `CONCINNO_CRED_<UPPER_KEY>`.
3. `~/.concinno/credentials.json`.

| Key                           | Env var                                    |
|-------------------------------|--------------------------------------------|
| `slack_bot_token`             | `CONCINNO_CRED_SLACK_BOT_TOKEN`            |
| `discord_bot_token`           | `CONCINNO_CRED_DISCORD_BOT_TOKEN`          |
| `telegram_bot_token`          | `CONCINNO_CRED_TELEGRAM_BOT_TOKEN`         |
| `line_channel_access_token`   | `CONCINNO_CRED_LINE_CHANNEL_ACCESS_TOKEN`  |

Example `~/.concinno/credentials.json`:

```jsonc
{
  "slack_bot_token": "xoxb-...",
  "discord_bot_token": "...",
  "telegram_bot_token": "123456:AAA...",
  "line_channel_access_token": "..."
}
```

If a token is missing the tool returns
`{"error": "no <service> credentials — set via CredentialStore or env ..."}`
rather than crashing.

## Usage via Concinno `ToolRegistry`

When the consumer sets `CONCINNO_LOAD_PLUGINS=1`, the default registry
auto-mounts every chat tool:

```python
import os
os.environ["CONCINNO_LOAD_PLUGINS"] = "1"

from concinno.tools.registry import get_default_registry

reg = get_default_registry()
assert {"SlackPost", "DiscordPost", "TelegramSend", "LineSend"} <= set(
    reg.list_deferred()
)

slack = reg.get("SlackPost")
slack.call(action="send", channel="#general", text="hi from concinno")
```

## Direct Python usage

```python
from concinno_skills_chat import (
    SlackPost,
    DiscordPost,
    TelegramSend,
    LineSend,
)

SlackPost().call(action="send", channel="C12345", text="hi")
DiscordPost().call(action="send", channel_id=12345, content="hi")
TelegramSend().call(action="send", chat_id=12345, text="hi")
LineSend().call(action="push", user_id="U1234", text="hi")
```

All tools return `{"ok": True, ...}` on success or `{"error": "..."}`
on failure — same shape as the other Concinno built-in tools. No
exceptions escape the `call()` surface.

## Concurrency

All four tools set `is_concurrency_safe = False`. Chat platform rate
limits make serial calls the sane default; the Concinno scheduler will
honour this automatically.

## License

Apache-2.0. See `LICENSE` in the Concinno monorepo.
