chat-sdk 0.0.1a4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. chat_sdk-0.0.1a4/.coverage +0 -0
  2. chat_sdk-0.0.1a4/.github/CODEOWNERS +2 -0
  3. chat_sdk-0.0.1a4/.github/ISSUE_TEMPLATE/bug_report.md +18 -0
  4. chat_sdk-0.0.1a4/.github/ISSUE_TEMPLATE/feature_request.md +9 -0
  5. chat_sdk-0.0.1a4/.github/workflows/publish.yml +20 -0
  6. chat_sdk-0.0.1a4/.github/workflows/test-publish.yml +21 -0
  7. chat_sdk-0.0.1a4/.github/workflows/test.yml +27 -0
  8. chat_sdk-0.0.1a4/.gitignore +17 -0
  9. chat_sdk-0.0.1a4/CHANGELOG.md +11 -0
  10. chat_sdk-0.0.1a4/CONTRIBUTING.md +55 -0
  11. chat_sdk-0.0.1a4/LICENSE +21 -0
  12. chat_sdk-0.0.1a4/PKG-INFO +141 -0
  13. chat_sdk-0.0.1a4/README.md +85 -0
  14. chat_sdk-0.0.1a4/pyproject.toml +74 -0
  15. chat_sdk-0.0.1a4/src/chat_sdk/__init__.py +344 -0
  16. chat_sdk-0.0.1a4/src/chat_sdk/adapters/__init__.py +29 -0
  17. chat_sdk-0.0.1a4/src/chat_sdk/adapters/discord/__init__.py +5 -0
  18. chat_sdk-0.0.1a4/src/chat_sdk/adapters/discord/adapter.py +1344 -0
  19. chat_sdk-0.0.1a4/src/chat_sdk/adapters/discord/cards.py +280 -0
  20. chat_sdk-0.0.1a4/src/chat_sdk/adapters/discord/format_converter.py +130 -0
  21. chat_sdk-0.0.1a4/src/chat_sdk/adapters/discord/types.py +313 -0
  22. chat_sdk-0.0.1a4/src/chat_sdk/adapters/github/__init__.py +5 -0
  23. chat_sdk-0.0.1a4/src/chat_sdk/adapters/github/adapter.py +1006 -0
  24. chat_sdk-0.0.1a4/src/chat_sdk/adapters/github/cards.py +246 -0
  25. chat_sdk-0.0.1a4/src/chat_sdk/adapters/github/format_converter.py +42 -0
  26. chat_sdk-0.0.1a4/src/chat_sdk/adapters/github/types.py +296 -0
  27. chat_sdk-0.0.1a4/src/chat_sdk/adapters/google_chat/__init__.py +5 -0
  28. chat_sdk-0.0.1a4/src/chat_sdk/adapters/google_chat/adapter.py +2693 -0
  29. chat_sdk-0.0.1a4/src/chat_sdk/adapters/google_chat/cards.py +317 -0
  30. chat_sdk-0.0.1a4/src/chat_sdk/adapters/google_chat/format_converter.py +147 -0
  31. chat_sdk-0.0.1a4/src/chat_sdk/adapters/google_chat/thread_utils.py +77 -0
  32. chat_sdk-0.0.1a4/src/chat_sdk/adapters/google_chat/types.py +317 -0
  33. chat_sdk-0.0.1a4/src/chat_sdk/adapters/google_chat/user_info.py +137 -0
  34. chat_sdk-0.0.1a4/src/chat_sdk/adapters/google_chat/workspace_events.py +414 -0
  35. chat_sdk-0.0.1a4/src/chat_sdk/adapters/linear/__init__.py +5 -0
  36. chat_sdk-0.0.1a4/src/chat_sdk/adapters/linear/adapter.py +990 -0
  37. chat_sdk-0.0.1a4/src/chat_sdk/adapters/linear/cards.py +198 -0
  38. chat_sdk-0.0.1a4/src/chat_sdk/adapters/linear/format_converter.py +51 -0
  39. chat_sdk-0.0.1a4/src/chat_sdk/adapters/linear/types.py +191 -0
  40. chat_sdk-0.0.1a4/src/chat_sdk/adapters/slack/__init__.py +5 -0
  41. chat_sdk-0.0.1a4/src/chat_sdk/adapters/slack/adapter.py +2837 -0
  42. chat_sdk-0.0.1a4/src/chat_sdk/adapters/slack/cards.py +388 -0
  43. chat_sdk-0.0.1a4/src/chat_sdk/adapters/slack/crypto.py +112 -0
  44. chat_sdk-0.0.1a4/src/chat_sdk/adapters/slack/format_converter.py +301 -0
  45. chat_sdk-0.0.1a4/src/chat_sdk/adapters/slack/modals.py +214 -0
  46. chat_sdk-0.0.1a4/src/chat_sdk/adapters/slack/types.py +391 -0
  47. chat_sdk-0.0.1a4/src/chat_sdk/adapters/teams/__init__.py +5 -0
  48. chat_sdk-0.0.1a4/src/chat_sdk/adapters/teams/adapter.py +1774 -0
  49. chat_sdk-0.0.1a4/src/chat_sdk/adapters/teams/cards.py +320 -0
  50. chat_sdk-0.0.1a4/src/chat_sdk/adapters/teams/format_converter.py +189 -0
  51. chat_sdk-0.0.1a4/src/chat_sdk/adapters/teams/types.py +123 -0
  52. chat_sdk-0.0.1a4/src/chat_sdk/adapters/telegram/__init__.py +5 -0
  53. chat_sdk-0.0.1a4/src/chat_sdk/adapters/telegram/adapter.py +1930 -0
  54. chat_sdk-0.0.1a4/src/chat_sdk/adapters/telegram/cards.py +138 -0
  55. chat_sdk-0.0.1a4/src/chat_sdk/adapters/telegram/format_converter.py +55 -0
  56. chat_sdk-0.0.1a4/src/chat_sdk/adapters/telegram/types.py +357 -0
  57. chat_sdk-0.0.1a4/src/chat_sdk/adapters/whatsapp/__init__.py +5 -0
  58. chat_sdk-0.0.1a4/src/chat_sdk/adapters/whatsapp/adapter.py +1109 -0
  59. chat_sdk-0.0.1a4/src/chat_sdk/adapters/whatsapp/cards.py +347 -0
  60. chat_sdk-0.0.1a4/src/chat_sdk/adapters/whatsapp/format_converter.py +116 -0
  61. chat_sdk-0.0.1a4/src/chat_sdk/adapters/whatsapp/types.py +261 -0
  62. chat_sdk-0.0.1a4/src/chat_sdk/ai.py +250 -0
  63. chat_sdk-0.0.1a4/src/chat_sdk/cards.py +430 -0
  64. chat_sdk-0.0.1a4/src/chat_sdk/channel.py +447 -0
  65. chat_sdk-0.0.1a4/src/chat_sdk/chat.py +1933 -0
  66. chat_sdk-0.0.1a4/src/chat_sdk/emoji.py +345 -0
  67. chat_sdk-0.0.1a4/src/chat_sdk/errors.py +38 -0
  68. chat_sdk-0.0.1a4/src/chat_sdk/from_full_stream.py +69 -0
  69. chat_sdk-0.0.1a4/src/chat_sdk/logger.py +52 -0
  70. chat_sdk-0.0.1a4/src/chat_sdk/message_history.py +86 -0
  71. chat_sdk-0.0.1a4/src/chat_sdk/modals.py +231 -0
  72. chat_sdk-0.0.1a4/src/chat_sdk/py.typed +0 -0
  73. chat_sdk-0.0.1a4/src/chat_sdk/shared/__init__.py +78 -0
  74. chat_sdk-0.0.1a4/src/chat_sdk/shared/adapter_utils.py +28 -0
  75. chat_sdk-0.0.1a4/src/chat_sdk/shared/base_format_converter.py +203 -0
  76. chat_sdk-0.0.1a4/src/chat_sdk/shared/buffer_utils.py +39 -0
  77. chat_sdk-0.0.1a4/src/chat_sdk/shared/card_utils.py +98 -0
  78. chat_sdk-0.0.1a4/src/chat_sdk/shared/errors.py +81 -0
  79. chat_sdk-0.0.1a4/src/chat_sdk/shared/markdown_parser.py +877 -0
  80. chat_sdk-0.0.1a4/src/chat_sdk/shared/mock_adapter.py +349 -0
  81. chat_sdk-0.0.1a4/src/chat_sdk/shared/streaming_markdown.py +378 -0
  82. chat_sdk-0.0.1a4/src/chat_sdk/state/__init__.py +14 -0
  83. chat_sdk-0.0.1a4/src/chat_sdk/state/memory.py +292 -0
  84. chat_sdk-0.0.1a4/src/chat_sdk/state/postgres.py +613 -0
  85. chat_sdk-0.0.1a4/src/chat_sdk/state/redis.py +352 -0
  86. chat_sdk-0.0.1a4/src/chat_sdk/testing/__init__.py +25 -0
  87. chat_sdk-0.0.1a4/src/chat_sdk/thread.py +867 -0
  88. chat_sdk-0.0.1a4/src/chat_sdk/types.py +1440 -0
  89. chat_sdk-0.0.1a4/tests/__init__.py +0 -0
  90. chat_sdk-0.0.1a4/tests/conftest.py +86 -0
  91. chat_sdk-0.0.1a4/tests/integration/__init__.py +7 -0
  92. chat_sdk-0.0.1a4/tests/integration/conftest.py +204 -0
  93. chat_sdk-0.0.1a4/tests/integration/test_action_flow.py +226 -0
  94. chat_sdk-0.0.1a4/tests/integration/test_assistant_threads.py +400 -0
  95. chat_sdk-0.0.1a4/tests/integration/test_channel_ops.py +434 -0
  96. chat_sdk-0.0.1a4/tests/integration/test_concurrency.py +218 -0
  97. chat_sdk-0.0.1a4/tests/integration/test_dedup.py +157 -0
  98. chat_sdk-0.0.1a4/tests/integration/test_dm_flow.py +185 -0
  99. chat_sdk-0.0.1a4/tests/integration/test_mention_flow.py +221 -0
  100. chat_sdk-0.0.1a4/tests/integration/test_reaction_flow.py +214 -0
  101. chat_sdk-0.0.1a4/tests/integration/test_replay_actions_reactions.py +340 -0
  102. chat_sdk-0.0.1a4/tests/integration/test_replay_dm.py +334 -0
  103. chat_sdk-0.0.1a4/tests/integration/test_replay_events.py +428 -0
  104. chat_sdk-0.0.1a4/tests/integration/test_replay_fetch_messages.py +440 -0
  105. chat_sdk-0.0.1a4/tests/integration/test_replay_mention.py +209 -0
  106. chat_sdk-0.0.1a4/tests/integration/test_replay_modal.py +279 -0
  107. chat_sdk-0.0.1a4/tests/integration/test_replay_modals_extended.py +522 -0
  108. chat_sdk-0.0.1a4/tests/integration/test_replay_multi_workspace.py +279 -0
  109. chat_sdk-0.0.1a4/tests/integration/test_replay_platforms.py +889 -0
  110. chat_sdk-0.0.1a4/tests/integration/test_replay_reactions.py +296 -0
  111. chat_sdk-0.0.1a4/tests/integration/test_replay_slash_command.py +280 -0
  112. chat_sdk-0.0.1a4/tests/integration/test_replay_streaming.py +346 -0
  113. chat_sdk-0.0.1a4/tests/integration/test_slash_command_flow.py +221 -0
  114. chat_sdk-0.0.1a4/tests/integration/test_subscription_flow.py +225 -0
  115. chat_sdk-0.0.1a4/tests/test_ai.py +615 -0
  116. chat_sdk-0.0.1a4/tests/test_cards.py +161 -0
  117. chat_sdk-0.0.1a4/tests/test_channel.py +494 -0
  118. chat_sdk-0.0.1a4/tests/test_chat.py +903 -0
  119. chat_sdk-0.0.1a4/tests/test_coverage_gaps.py +483 -0
  120. chat_sdk-0.0.1a4/tests/test_critical_fixes.py +568 -0
  121. chat_sdk-0.0.1a4/tests/test_discord_adapter.py +690 -0
  122. chat_sdk-0.0.1a4/tests/test_discord_cards.py +277 -0
  123. chat_sdk-0.0.1a4/tests/test_discord_extended.py +1782 -0
  124. chat_sdk-0.0.1a4/tests/test_discord_final.py +829 -0
  125. chat_sdk-0.0.1a4/tests/test_discord_format.py +246 -0
  126. chat_sdk-0.0.1a4/tests/test_dispatch_key_validation.py +711 -0
  127. chat_sdk-0.0.1a4/tests/test_emoji.py +170 -0
  128. chat_sdk-0.0.1a4/tests/test_from_full_stream.py +302 -0
  129. chat_sdk-0.0.1a4/tests/test_gchat_api.py +1174 -0
  130. chat_sdk-0.0.1a4/tests/test_gchat_cards.py +351 -0
  131. chat_sdk-0.0.1a4/tests/test_gchat_comprehensive.py +1879 -0
  132. chat_sdk-0.0.1a4/tests/test_gchat_verification.py +228 -0
  133. chat_sdk-0.0.1a4/tests/test_gchat_webhook.py +654 -0
  134. chat_sdk-0.0.1a4/tests/test_gchat_webhook_extended.py +649 -0
  135. chat_sdk-0.0.1a4/tests/test_github_adapter.py +266 -0
  136. chat_sdk-0.0.1a4/tests/test_github_cards.py +212 -0
  137. chat_sdk-0.0.1a4/tests/test_github_dispatch.py +285 -0
  138. chat_sdk-0.0.1a4/tests/test_github_extended.py +756 -0
  139. chat_sdk-0.0.1a4/tests/test_github_format.py +186 -0
  140. chat_sdk-0.0.1a4/tests/test_github_webhook.py +708 -0
  141. chat_sdk-0.0.1a4/tests/test_google_chat_adapter.py +205 -0
  142. chat_sdk-0.0.1a4/tests/test_linear_adapter.py +661 -0
  143. chat_sdk-0.0.1a4/tests/test_linear_cards.py +174 -0
  144. chat_sdk-0.0.1a4/tests/test_linear_extended.py +1458 -0
  145. chat_sdk-0.0.1a4/tests/test_linear_format.py +93 -0
  146. chat_sdk-0.0.1a4/tests/test_markdown_parser.py +556 -0
  147. chat_sdk-0.0.1a4/tests/test_memory_state.py +458 -0
  148. chat_sdk-0.0.1a4/tests/test_message_history.py +327 -0
  149. chat_sdk-0.0.1a4/tests/test_modals.py +377 -0
  150. chat_sdk-0.0.1a4/tests/test_serialization.py +486 -0
  151. chat_sdk-0.0.1a4/tests/test_shared_errors.py +162 -0
  152. chat_sdk-0.0.1a4/tests/test_slack_adapter.py +222 -0
  153. chat_sdk-0.0.1a4/tests/test_slack_api.py +1273 -0
  154. chat_sdk-0.0.1a4/tests/test_slack_cards.py +615 -0
  155. chat_sdk-0.0.1a4/tests/test_slack_client_cache.py +195 -0
  156. chat_sdk-0.0.1a4/tests/test_slack_crypto.py +111 -0
  157. chat_sdk-0.0.1a4/tests/test_slack_extended.py +880 -0
  158. chat_sdk-0.0.1a4/tests/test_slack_format.py +258 -0
  159. chat_sdk-0.0.1a4/tests/test_slack_modals.py +478 -0
  160. chat_sdk-0.0.1a4/tests/test_slack_webhook.py +693 -0
  161. chat_sdk-0.0.1a4/tests/test_slack_webhook_extended.py +799 -0
  162. chat_sdk-0.0.1a4/tests/test_state_postgres.py +921 -0
  163. chat_sdk-0.0.1a4/tests/test_state_redis.py +746 -0
  164. chat_sdk-0.0.1a4/tests/test_streaming_markdown.py +846 -0
  165. chat_sdk-0.0.1a4/tests/test_teams_adapter.py +614 -0
  166. chat_sdk-0.0.1a4/tests/test_teams_cards.py +254 -0
  167. chat_sdk-0.0.1a4/tests/test_teams_extended.py +598 -0
  168. chat_sdk-0.0.1a4/tests/test_teams_format.py +241 -0
  169. chat_sdk-0.0.1a4/tests/test_telegram_adapter.py +371 -0
  170. chat_sdk-0.0.1a4/tests/test_telegram_api.py +469 -0
  171. chat_sdk-0.0.1a4/tests/test_telegram_cards.py +143 -0
  172. chat_sdk-0.0.1a4/tests/test_telegram_format.py +216 -0
  173. chat_sdk-0.0.1a4/tests/test_telegram_webhook.py +406 -0
  174. chat_sdk-0.0.1a4/tests/test_thread.py +823 -0
  175. chat_sdk-0.0.1a4/tests/test_types.py +239 -0
  176. chat_sdk-0.0.1a4/tests/test_whatsapp_adapter.py +366 -0
  177. chat_sdk-0.0.1a4/tests/test_whatsapp_api.py +247 -0
  178. chat_sdk-0.0.1a4/tests/test_whatsapp_cards.py +342 -0
  179. chat_sdk-0.0.1a4/tests/test_whatsapp_format.py +186 -0
  180. chat_sdk-0.0.1a4/tests/test_whatsapp_webhook.py +688 -0
Binary file
@@ -0,0 +1,2 @@
1
+ # Default owners for everything
2
+ * @patrick-chinchill
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Report a bug
4
+ labels: bug
5
+ ---
6
+
7
+ **Adapter**: (e.g., Slack, Discord, Teams)
8
+ **Version**: (e.g., 0.0.1a3)
9
+ **Python version**: (e.g., 3.12)
10
+
11
+ **What happened?**
12
+
13
+ **What did you expect?**
14
+
15
+ **Minimal reproduction**:
16
+ ```python
17
+ # paste code here
18
+ ```
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest a feature
4
+ labels: enhancement
5
+ ---
6
+
7
+ **What problem does this solve?**
8
+
9
+ **Proposed solution**:
@@ -0,0 +1,20 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ environment: pypi
11
+ permissions:
12
+ contents: read # checkout private repo
13
+ id-token: write # trusted publishing
14
+ steps:
15
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.2.2
16
+ - uses: astral-sh/setup-uv@e4db8464a088ece1b920f60402e813ea4de65b8f # v4
17
+ - name: Build
18
+ run: uv build
19
+ - name: Publish to PyPI
20
+ uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
@@ -0,0 +1,21 @@
1
+ name: Publish to TestPyPI
2
+
3
+ on:
4
+ workflow_dispatch: # manual trigger only
5
+
6
+ jobs:
7
+ test-publish:
8
+ runs-on: ubuntu-latest
9
+ environment: testpypi
10
+ permissions:
11
+ contents: read # checkout private repo
12
+ id-token: write # trusted publishing
13
+ steps:
14
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.2.2
15
+ - uses: astral-sh/setup-uv@e4db8464a088ece1b920f60402e813ea4de65b8f # v4
16
+ - name: Build
17
+ run: uv build
18
+ - name: Publish to TestPyPI
19
+ uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
20
+ with:
21
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,27 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.11", "3.12", "3.13"]
15
+ steps:
16
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.2.2
17
+ - uses: astral-sh/setup-uv@e4db8464a088ece1b920f60402e813ea4de65b8f # v4
18
+ - name: Set up Python ${{ matrix.python-version }}
19
+ run: uv python install ${{ matrix.python-version }}
20
+ - name: Install dependencies
21
+ run: uv sync --group dev
22
+ - name: Lint
23
+ run: uv run ruff check src/
24
+ - name: Format check
25
+ run: uv run ruff format --check src/
26
+ - name: Run tests
27
+ run: uv run pytest tests/ -q --tb=short --cov=chat_sdk --cov-fail-under=70
@@ -0,0 +1,17 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .eggs/
8
+ *.egg
9
+ .venv/
10
+ .env
11
+ .env.*
12
+ *.pem
13
+ *.key
14
+ .ruff_cache/
15
+ .pytest_cache/
16
+ .mypy_cache/
17
+ uv.lock
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ ## 0.0.1a4 (2026-04-06)
4
+
5
+ Initial alpha release.
6
+
7
+ - Core SDK: Chat orchestrator, Thread, Channel, Message, Cards, Modals, Emoji
8
+ - 8 adapters: Slack, Discord, Teams, Telegram, WhatsApp, Google Chat, GitHub, Linear
9
+ - 3 state backends: Memory, Redis, PostgreSQL
10
+ - 2,477 tests passing, 79% coverage
11
+ - Security hardened: JWT verification, SSRF protection, timing-safe comparisons
@@ -0,0 +1,55 @@
1
+ # Contributing to chat-sdk-python
2
+
3
+ Thanks for your interest in contributing! This guide covers the essentials.
4
+
5
+ ## Dev Environment Setup
6
+
7
+ ```bash
8
+ # Clone and install (requires Python 3.11+ and uv)
9
+ git clone https://github.com/Chinchill-AI/chat-sdk-python.git
10
+ cd chat-sdk-python
11
+ uv sync --group dev
12
+ ```
13
+
14
+ ## Running Tests
15
+
16
+ ```bash
17
+ uv run pytest tests/ # all tests
18
+ uv run pytest tests/ -x # stop on first failure
19
+ uv run pytest tests/unit/ # unit tests only
20
+ ```
21
+
22
+ ## Code Quality
23
+
24
+ ```bash
25
+ uv run ruff check src/ tests/ # lint
26
+ uv run ruff format src/ tests/ # auto-format
27
+ ```
28
+
29
+ All PRs must pass `ruff check` with zero errors.
30
+
31
+ ## Adding a New Adapter
32
+
33
+ 1. Create `src/chat_sdk/adapters/<platform>/` with at minimum:
34
+ - `adapter.py` -- the adapter class implementing the Adapter protocol
35
+ - `__init__.py` -- public exports and a `create_<platform>_adapter()` factory
36
+ 2. Follow the patterns in existing adapters (Slack and Teams are good references).
37
+ 3. Add an optional-dependency group in `pyproject.toml`.
38
+ 4. Add tests under `tests/unit/adapters/<platform>/`.
39
+
40
+ ## Pull Request Expectations
41
+
42
+ - **Tests required.** Every bugfix or feature needs at least one test.
43
+ - **Ruff clean.** `uv run ruff check src/ tests/` must pass with no errors.
44
+ - **Small, focused PRs** are easier to review than large ones.
45
+ - **Descriptive commit messages.** Explain *why*, not just *what*.
46
+
47
+ ## Issues and PRs
48
+
49
+ - Check existing issues before opening a new one.
50
+ - Reference the issue number in your PR description (e.g., `Fixes #42`).
51
+ - For large changes, open an issue first to discuss the approach.
52
+
53
+ ## License
54
+
55
+ By contributing you agree that your contributions will be licensed under the MIT License.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Chinchill AI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,141 @@
1
+ Metadata-Version: 2.4
2
+ Name: chat-sdk
3
+ Version: 0.0.1a4
4
+ Summary: Multi-platform async chat SDK for Python — port of Vercel Chat
5
+ Project-URL: Homepage, https://github.com/Chinchill-AI/chat-sdk-python
6
+ Project-URL: Repository, https://github.com/Chinchill-AI/chat-sdk-python
7
+ Project-URL: Issues, https://github.com/Chinchill-AI/chat-sdk-python/issues
8
+ License: MIT
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Framework :: AsyncIO
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Communications :: Chat
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.11
21
+ Provides-Extra: all
22
+ Requires-Dist: aiohttp>=3.9; extra == 'all'
23
+ Requires-Dist: asyncpg>=0.29; extra == 'all'
24
+ Requires-Dist: cryptography>=42.0; extra == 'all'
25
+ Requires-Dist: google-auth>=2.0; extra == 'all'
26
+ Requires-Dist: pyjwt[crypto]>=2.8; extra == 'all'
27
+ Requires-Dist: pynacl>=1.5; extra == 'all'
28
+ Requires-Dist: redis>=5.0; extra == 'all'
29
+ Requires-Dist: slack-sdk>=3.27.0; extra == 'all'
30
+ Provides-Extra: crypto
31
+ Requires-Dist: cryptography>=42.0; extra == 'crypto'
32
+ Provides-Extra: discord
33
+ Requires-Dist: aiohttp>=3.9; extra == 'discord'
34
+ Requires-Dist: pynacl>=1.5; extra == 'discord'
35
+ Provides-Extra: github
36
+ Requires-Dist: pyjwt[crypto]>=2.8; extra == 'github'
37
+ Provides-Extra: google-chat
38
+ Requires-Dist: aiohttp>=3.9; extra == 'google-chat'
39
+ Requires-Dist: google-auth>=2.0; extra == 'google-chat'
40
+ Requires-Dist: pyjwt>=2.8; extra == 'google-chat'
41
+ Provides-Extra: linear
42
+ Requires-Dist: aiohttp>=3.9; extra == 'linear'
43
+ Provides-Extra: postgres
44
+ Requires-Dist: asyncpg>=0.29; extra == 'postgres'
45
+ Provides-Extra: redis
46
+ Requires-Dist: redis>=5.0; extra == 'redis'
47
+ Provides-Extra: slack
48
+ Requires-Dist: slack-sdk>=3.27.0; extra == 'slack'
49
+ Provides-Extra: teams
50
+ Requires-Dist: aiohttp>=3.9; extra == 'teams'
51
+ Provides-Extra: telegram
52
+ Requires-Dist: aiohttp>=3.9; extra == 'telegram'
53
+ Provides-Extra: whatsapp
54
+ Requires-Dist: aiohttp>=3.9; extra == 'whatsapp'
55
+ Description-Content-Type: text/markdown
56
+
57
+ # chat-sdk-python
58
+
59
+ Multi-platform async chat SDK for Python. Port of [Vercel Chat](https://github.com/vercel/chat).
60
+
61
+ > **Status: Alpha (0.0.1a4)** — API may change. Not yet tested in production.
62
+
63
+ ## Why chat-sdk?
64
+
65
+ - **Write once, deploy to 8 platforms.** One handler runs on Slack, Discord, Teams, Telegram, WhatsApp, Google Chat, GitHub, and Linear.
66
+ - **Built-in concurrency primitives.** Deduplication, thread locking, and message queuing are handled for you.
67
+ - **Cross-platform cards.** Author a `Card` once and it renders as Block Kit (Slack), Adaptive Cards (Teams), embeds (Discord), and more.
68
+ - **Not a replacement for platform SDKs.** chat-sdk is built *on top of* them. You can always drop down to the native SDK when you need to.
69
+
70
+ ## Install
71
+
72
+ ```bash
73
+ pip install chat-sdk # core only
74
+ pip install chat-sdk[slack] # + Slack adapter
75
+ pip install chat-sdk[all] # all adapters + state backends
76
+ ```
77
+
78
+ ## Quick Start
79
+
80
+ ```python
81
+ from chat_sdk import Chat, Card, Button, Actions, MemoryStateAdapter
82
+ from chat_sdk.adapters.slack import create_slack_adapter
83
+
84
+ chat = Chat(
85
+ adapters={"slack": create_slack_adapter()},
86
+ state=MemoryStateAdapter(),
87
+ user_name="my-bot",
88
+ )
89
+
90
+ @chat.on_mention
91
+ async def handle_mention(thread, message):
92
+ await thread.post(
93
+ Card(title="Hello!", children=[
94
+ Actions([Button(id="hi", label="Say Hi")])
95
+ ])
96
+ )
97
+ ```
98
+
99
+ ## Adapters
100
+
101
+ | Platform | Install Extra | Status |
102
+ |----------|--------------|--------|
103
+ | Slack | `chat-sdk[slack]` | Alpha |
104
+ | Discord | `chat-sdk[discord]` | Alpha |
105
+ | Teams | `chat-sdk[teams]` | Alpha |
106
+ | Telegram | `chat-sdk[telegram]` | Alpha |
107
+ | WhatsApp | `chat-sdk[whatsapp]` | Alpha |
108
+ | Google Chat | `chat-sdk[google-chat]` | Alpha |
109
+ | GitHub | `chat-sdk[github]` | Alpha |
110
+ | Linear | `chat-sdk[linear]` | Alpha |
111
+
112
+ ## State Backends
113
+
114
+ | Backend | Install Extra |
115
+ |---------|--------------|
116
+ | In-Memory | Built-in |
117
+ | Redis | `chat-sdk[redis]` |
118
+ | PostgreSQL | `chat-sdk[postgres]` |
119
+
120
+ ## Compared to Alternatives
121
+
122
+ | Feature | chat-sdk | Raw platform SDKs | BotFramework SDK |
123
+ |---------|----------|--------------------|------------------|
124
+ | Multi-platform from one codebase | 8 platforms | 1 per SDK | Teams + limited |
125
+ | Async-native (Python 3.11+) | Yes | Varies | No |
126
+ | Cross-platform cards | Card model | Platform-specific | Adaptive Cards only |
127
+ | Thread locking / dedup | Built-in | DIY | DIY |
128
+ | State abstraction (mem/redis/pg) | Built-in | DIY | DIY |
129
+ | Drop down to native SDK | Yes | N/A | Partially |
130
+
131
+ ## Development
132
+
133
+ ```bash
134
+ uv sync --group dev
135
+ uv run pytest tests/
136
+ uv run ruff check src/
137
+ ```
138
+
139
+ ## License
140
+
141
+ MIT
@@ -0,0 +1,85 @@
1
+ # chat-sdk-python
2
+
3
+ Multi-platform async chat SDK for Python. Port of [Vercel Chat](https://github.com/vercel/chat).
4
+
5
+ > **Status: Alpha (0.0.1a4)** — API may change. Not yet tested in production.
6
+
7
+ ## Why chat-sdk?
8
+
9
+ - **Write once, deploy to 8 platforms.** One handler runs on Slack, Discord, Teams, Telegram, WhatsApp, Google Chat, GitHub, and Linear.
10
+ - **Built-in concurrency primitives.** Deduplication, thread locking, and message queuing are handled for you.
11
+ - **Cross-platform cards.** Author a `Card` once and it renders as Block Kit (Slack), Adaptive Cards (Teams), embeds (Discord), and more.
12
+ - **Not a replacement for platform SDKs.** chat-sdk is built *on top of* them. You can always drop down to the native SDK when you need to.
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ pip install chat-sdk # core only
18
+ pip install chat-sdk[slack] # + Slack adapter
19
+ pip install chat-sdk[all] # all adapters + state backends
20
+ ```
21
+
22
+ ## Quick Start
23
+
24
+ ```python
25
+ from chat_sdk import Chat, Card, Button, Actions, MemoryStateAdapter
26
+ from chat_sdk.adapters.slack import create_slack_adapter
27
+
28
+ chat = Chat(
29
+ adapters={"slack": create_slack_adapter()},
30
+ state=MemoryStateAdapter(),
31
+ user_name="my-bot",
32
+ )
33
+
34
+ @chat.on_mention
35
+ async def handle_mention(thread, message):
36
+ await thread.post(
37
+ Card(title="Hello!", children=[
38
+ Actions([Button(id="hi", label="Say Hi")])
39
+ ])
40
+ )
41
+ ```
42
+
43
+ ## Adapters
44
+
45
+ | Platform | Install Extra | Status |
46
+ |----------|--------------|--------|
47
+ | Slack | `chat-sdk[slack]` | Alpha |
48
+ | Discord | `chat-sdk[discord]` | Alpha |
49
+ | Teams | `chat-sdk[teams]` | Alpha |
50
+ | Telegram | `chat-sdk[telegram]` | Alpha |
51
+ | WhatsApp | `chat-sdk[whatsapp]` | Alpha |
52
+ | Google Chat | `chat-sdk[google-chat]` | Alpha |
53
+ | GitHub | `chat-sdk[github]` | Alpha |
54
+ | Linear | `chat-sdk[linear]` | Alpha |
55
+
56
+ ## State Backends
57
+
58
+ | Backend | Install Extra |
59
+ |---------|--------------|
60
+ | In-Memory | Built-in |
61
+ | Redis | `chat-sdk[redis]` |
62
+ | PostgreSQL | `chat-sdk[postgres]` |
63
+
64
+ ## Compared to Alternatives
65
+
66
+ | Feature | chat-sdk | Raw platform SDKs | BotFramework SDK |
67
+ |---------|----------|--------------------|------------------|
68
+ | Multi-platform from one codebase | 8 platforms | 1 per SDK | Teams + limited |
69
+ | Async-native (Python 3.11+) | Yes | Varies | No |
70
+ | Cross-platform cards | Card model | Platform-specific | Adaptive Cards only |
71
+ | Thread locking / dedup | Built-in | DIY | DIY |
72
+ | State abstraction (mem/redis/pg) | Built-in | DIY | DIY |
73
+ | Drop down to native SDK | Yes | N/A | Partially |
74
+
75
+ ## Development
76
+
77
+ ```bash
78
+ uv sync --group dev
79
+ uv run pytest tests/
80
+ uv run ruff check src/
81
+ ```
82
+
83
+ ## License
84
+
85
+ MIT
@@ -0,0 +1,74 @@
1
+ [project]
2
+ name = "chat-sdk"
3
+ version = "0.0.1a4"
4
+ description = "Multi-platform async chat SDK for Python — port of Vercel Chat"
5
+ readme = "README.md"
6
+ license = {text = "MIT"}
7
+ requires-python = ">=3.11"
8
+ dependencies = []
9
+ classifiers = [
10
+ "Development Status :: 3 - Alpha",
11
+ "Framework :: AsyncIO",
12
+ "Intended Audience :: Developers",
13
+ "License :: OSI Approved :: MIT License",
14
+ "Programming Language :: Python :: 3",
15
+ "Programming Language :: Python :: 3.11",
16
+ "Programming Language :: Python :: 3.12",
17
+ "Programming Language :: Python :: 3.13",
18
+ "Topic :: Communications :: Chat",
19
+ "Typing :: Typed",
20
+ ]
21
+
22
+ [project.urls]
23
+ Homepage = "https://github.com/Chinchill-AI/chat-sdk-python"
24
+ Repository = "https://github.com/Chinchill-AI/chat-sdk-python"
25
+ Issues = "https://github.com/Chinchill-AI/chat-sdk-python/issues"
26
+
27
+ [project.optional-dependencies]
28
+ slack = ["slack-sdk>=3.27.0"]
29
+ github = ["pyjwt[crypto]>=2.8"]
30
+ redis = ["redis>=5.0"]
31
+ postgres = ["asyncpg>=0.29"]
32
+ crypto = ["cryptography>=42.0"]
33
+ discord = ["pynacl>=1.5", "aiohttp>=3.9"]
34
+ teams = ["aiohttp>=3.9"]
35
+ telegram = ["aiohttp>=3.9"]
36
+ whatsapp = ["aiohttp>=3.9"]
37
+ google-chat = ["aiohttp>=3.9", "google-auth>=2.0", "pyjwt>=2.8"]
38
+ linear = ["aiohttp>=3.9"]
39
+ all = [
40
+ "slack-sdk>=3.27.0",
41
+ "pyjwt[crypto]>=2.8",
42
+ "redis>=5.0",
43
+ "asyncpg>=0.29",
44
+ "cryptography>=42.0",
45
+ "pynacl>=1.5",
46
+ "aiohttp>=3.9",
47
+ "google-auth>=2.0",
48
+ ]
49
+
50
+ [build-system]
51
+ requires = ["hatchling"]
52
+ build-backend = "hatchling.build"
53
+
54
+ [tool.hatch.build.targets.wheel]
55
+ packages = ["src/chat_sdk"]
56
+
57
+ [tool.pytest.ini_options]
58
+ asyncio_mode = "auto"
59
+
60
+ [tool.ruff]
61
+ target-version = "py311"
62
+ line-length = 120
63
+
64
+ [tool.ruff.lint]
65
+ select = ["E", "F", "I", "B", "SIM", "UP"]
66
+
67
+ [dependency-groups]
68
+ dev = [
69
+ "cryptography>=42.0",
70
+ "pytest>=8.0",
71
+ "pytest-asyncio>=0.23.0",
72
+ "pytest-cov>=5.0",
73
+ "ruff>=0.4.0",
74
+ ]