chatom 0.2.1__tar.gz → 0.2.3__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.
- {chatom-0.2.1 → chatom-0.2.3}/PKG-INFO +26 -9
- {chatom-0.2.1 → chatom-0.2.3}/README.md +12 -7
- {chatom-0.2.1 → chatom-0.2.3}/chatom/__init__.py +13 -1
- chatom-0.2.3/chatom/agent/files.py +185 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/agent/toolset.py +161 -11
- {chatom-0.2.1 → chatom-0.2.3}/chatom/backend/backend.py +1 -1
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/__init__.py +6 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/capabilities.py +57 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/message.py +1 -1
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/testing.py +4 -4
- {chatom-0.2.1 → chatom-0.2.3}/chatom/csp/__init__.py +2 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/csp/adapter.py +9 -4
- {chatom-0.2.1 → chatom-0.2.3}/chatom/csp/interactions.py +8 -11
- {chatom-0.2.1 → chatom-0.2.3}/chatom/csp/nodes.py +117 -166
- chatom-0.2.3/chatom/csp/runner.py +104 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/discord/backend.py +79 -9
- {chatom-0.2.1 → chatom-0.2.3}/chatom/enums.py +13 -10
- chatom-0.2.3/chatom/examples/_backends.py +296 -0
- chatom-0.2.3/chatom/examples/basic_connection.py +59 -0
- chatom-0.2.3/chatom/examples/cross_platform_bot.py +141 -0
- chatom-0.2.3/chatom/examples/direct_messages.py +84 -0
- chatom-0.2.3/chatom/examples/formatted_messages.py +137 -0
- chatom-0.2.3/chatom/examples/listen_for_messages.py +111 -0
- chatom-0.2.3/chatom/examples/mentions_and_reactions.py +109 -0
- chatom-0.2.3/chatom/examples/message_history.py +86 -0
- chatom-0.2.3/chatom/examples/send_message.py +65 -0
- chatom-0.2.3/chatom/examples/threads_and_replies.py +106 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/examples/unified_frontend.py +1 -1
- {chatom-0.2.1 → chatom-0.2.3}/chatom/format/message.py +3 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/format/text.py +6 -5
- chatom-0.2.3/chatom/irc/__init__.py +23 -0
- chatom-0.2.3/chatom/irc/backend.py +514 -0
- chatom-0.2.3/chatom/irc/channel.py +28 -0
- chatom-0.2.3/chatom/irc/config.py +40 -0
- chatom-0.2.3/chatom/irc/mention.py +17 -0
- chatom-0.2.3/chatom/irc/message.py +24 -0
- chatom-0.2.3/chatom/irc/presence.py +11 -0
- chatom-0.2.3/chatom/irc/testing.py +99 -0
- chatom-0.2.3/chatom/irc/user.py +38 -0
- chatom-0.2.3/chatom/matrix/__init__.py +26 -0
- chatom-0.2.3/chatom/matrix/backend.py +598 -0
- chatom-0.2.3/chatom/matrix/channel.py +25 -0
- chatom-0.2.3/chatom/matrix/config.py +49 -0
- chatom-0.2.3/chatom/matrix/e2ee.py +505 -0
- chatom-0.2.3/chatom/matrix/mention.py +30 -0
- chatom-0.2.3/chatom/matrix/message.py +27 -0
- chatom-0.2.3/chatom/matrix/presence.py +36 -0
- chatom-0.2.3/chatom/matrix/testing.py +302 -0
- chatom-0.2.3/chatom/matrix/user.py +27 -0
- chatom-0.2.3/chatom/mcp/config/gateway/irc.yaml +9 -0
- chatom-0.2.3/chatom/mcp/config/gateway/matrix.yaml +10 -0
- chatom-0.2.3/chatom/mcp/config/gateway/zulip.yaml +9 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/slack/message.py +8 -4
- {chatom-0.2.1 → chatom-0.2.3}/chatom/symphony/backend.py +52 -4
- {chatom-0.2.1 → chatom-0.2.3}/chatom/symphony/config.py +1 -1
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/conversion/test_message_conversion_slack.py +26 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_agent.py +93 -4
- chatom-0.2.3/chatom/tests/test_attachment_files.py +92 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_csp.py +54 -3
- chatom-0.2.3/chatom/tests/test_csp_runner.py +285 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_discord_channel_conversion.py +18 -1
- chatom-0.2.3/chatom/tests/test_discord_threads.py +118 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_enums.py +4 -3
- chatom-0.2.3/chatom/tests/test_example_backends.py +60 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_format.py +7 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_incoming_attachments.py +69 -4
- chatom-0.2.3/chatom/tests/test_irc_backend.py +952 -0
- chatom-0.2.3/chatom/tests/test_matrix_backend.py +1316 -0
- chatom-0.2.3/chatom/tests/test_matrix_e2ee.py +371 -0
- chatom-0.2.3/chatom/tests/test_mcp_gateway_presets.py +48 -0
- chatom-0.2.3/chatom/tests/test_zulip_backend.py +1242 -0
- chatom-0.2.3/chatom/zulip/__init__.py +30 -0
- chatom-0.2.3/chatom/zulip/backend.py +539 -0
- chatom-0.2.3/chatom/zulip/channel.py +30 -0
- chatom-0.2.3/chatom/zulip/config.py +40 -0
- chatom-0.2.3/chatom/zulip/mention.py +18 -0
- chatom-0.2.3/chatom/zulip/message.py +23 -0
- chatom-0.2.3/chatom/zulip/presence.py +36 -0
- chatom-0.2.3/chatom/zulip/testing.py +249 -0
- chatom-0.2.3/chatom/zulip/user.py +19 -0
- {chatom-0.2.1 → chatom-0.2.3}/pyproject.toml +24 -4
- chatom-0.2.1/chatom/examples/basic_connection.py +0 -161
- chatom-0.2.1/chatom/examples/cross_platform_bot.py +0 -243
- chatom-0.2.1/chatom/examples/direct_messages.py +0 -230
- chatom-0.2.1/chatom/examples/formatted_messages.py +0 -283
- chatom-0.2.1/chatom/examples/listen_for_messages.py +0 -224
- chatom-0.2.1/chatom/examples/mentions_and_reactions.py +0 -293
- chatom-0.2.1/chatom/examples/message_history.py +0 -245
- chatom-0.2.1/chatom/examples/send_message.py +0 -209
- chatom-0.2.1/chatom/examples/threads_and_replies.py +0 -275
- {chatom-0.2.1 → chatom-0.2.3}/.gitignore +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/LICENSE +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/agent/__init__.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/agent/context.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/backend/__init__.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/backend/backend_config.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/backend/backend_registry.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/attachment.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/authorization.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/base.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/channel.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/connection.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/conversion.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/embed.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/interaction.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/mention.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/organization.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/presence.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/reaction.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/thread.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/base/user.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/bridge/__init__.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/bridge/identity.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/bridge/relay.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/discord/__init__.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/discord/channel.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/discord/config.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/discord/guild.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/discord/mention.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/discord/message.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/discord/presence.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/discord/testing.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/discord/user.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/examples/__init__.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/format/__init__.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/format/attachment.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/format/components.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/format/embed.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/format/parse.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/format/spec/__init__.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/format/spec/symphony.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/format/table.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/format/telegram.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/format/variant.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/handlers.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/mcp/__init__.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/mcp/cli.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/mcp/config/__init__.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/mcp/config/config.yaml +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/mcp/config/gateway/__init__.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/mcp/config/gateway/discord.yaml +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/mcp/config/gateway/slack.yaml +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/mcp/config/gateway/symphony.yaml +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/mcp/config/gateway/symphony_dev.yaml +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/mcp/config/gateway/telegram.yaml +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/mcp/server.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/slack/__init__.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/slack/backend.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/slack/channel.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/slack/config.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/slack/mention.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/slack/presence.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/slack/testing.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/slack/user.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/symphony/__init__.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/symphony/channel.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/symphony/mention.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/symphony/message.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/symphony/presence.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/symphony/testing.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/symphony/user.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/telegram/__init__.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/telegram/backend.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/telegram/channel.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/telegram/config.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/telegram/mention.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/telegram/message.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/telegram/presence.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/telegram/testing.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/telegram/user.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/combined_e2e.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/conversion/test_message_conversion.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/conversion/test_message_conversion_cross.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/conversion/test_message_conversion_discord.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/conversion/test_message_conversion_symphony.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/conversion/test_symphony_messageml_compliance.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/conversion/test_telegram_html.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/integration/__init__.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/integration/test_discord_integration.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/integration/test_slack_integration.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/integration/test_symphony_integration.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/integration/test_telegram_integration.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_access_policy.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_all.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_backend.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_backend_registry.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_backends.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_base_models.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_bot_features.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_bridge.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_config.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_connection.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_conversion.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_interactions.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_mcp.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_mention.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_mock_backends.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_symphony_fetch_messages.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_testing.py +0 -0
- {chatom-0.2.1 → chatom-0.2.3}/chatom/tests/test_threads.py +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: chatom
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Minimum viable chat components
|
|
5
5
|
Project-URL: Repository, https://github.com/1kbgz/chatom
|
|
6
6
|
Project-URL: Homepage, https://github.com/1kbgz/chatom
|
|
7
7
|
Author-email: the chatom authors <dev@1kbgz.com>
|
|
8
8
|
License: Apache-2.0
|
|
9
9
|
License-File: LICENSE
|
|
10
|
-
Keywords: agent,chat,chatbot,discord,llm,mcp,messenger,model-context-protocol,slack,symphony,telegram
|
|
10
|
+
Keywords: agent,chat,chatbot,discord,irc,llm,matrix,mcp,messenger,model-context-protocol,slack,symphony,telegram,zulip
|
|
11
11
|
Classifier: Development Status :: 3 - Alpha
|
|
12
12
|
Classifier: Programming Language :: Python
|
|
13
13
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -22,7 +22,11 @@ Requires-Dist: mistune>=3
|
|
|
22
22
|
Requires-Dist: pydantic>=2
|
|
23
23
|
Requires-Dist: singledispatch
|
|
24
24
|
Provides-Extra: agent
|
|
25
|
+
Requires-Dist: openpyxl<4,>=3.1; extra == 'agent'
|
|
25
26
|
Requires-Dist: pydantic-ai>=0.4; extra == 'agent'
|
|
27
|
+
Requires-Dist: pypdf<7,>=6; extra == 'agent'
|
|
28
|
+
Requires-Dist: python-docx<2,>=1; extra == 'agent'
|
|
29
|
+
Requires-Dist: reportlab<6,>=4; extra == 'agent'
|
|
26
30
|
Provides-Extra: develop
|
|
27
31
|
Requires-Dist: build; extra == 'develop'
|
|
28
32
|
Requires-Dist: bump-my-version; extra == 'develop'
|
|
@@ -33,14 +37,21 @@ Requires-Dist: discord-py; extra == 'develop'
|
|
|
33
37
|
Requires-Dist: fastmcp>=2; extra == 'develop'
|
|
34
38
|
Requires-Dist: hatchling; extra == 'develop'
|
|
35
39
|
Requires-Dist: hydra-core>=1.3; extra == 'develop'
|
|
40
|
+
Requires-Dist: matrix-nio>=0.25; extra == 'develop'
|
|
41
|
+
Requires-Dist: matrix-sdk-python>=0.18; extra == 'develop'
|
|
36
42
|
Requires-Dist: mdformat; extra == 'develop'
|
|
43
|
+
Requires-Dist: mdformat-myst; extra == 'develop'
|
|
37
44
|
Requires-Dist: mdformat-tables>=1; extra == 'develop'
|
|
45
|
+
Requires-Dist: openpyxl<4,>=3.1; extra == 'develop'
|
|
38
46
|
Requires-Dist: pydantic-ai>=0.4; extra == 'develop'
|
|
47
|
+
Requires-Dist: pypdf<7,>=6; extra == 'develop'
|
|
39
48
|
Requires-Dist: pytest; extra == 'develop'
|
|
40
49
|
Requires-Dist: pytest-asyncio; extra == 'develop'
|
|
41
50
|
Requires-Dist: pytest-cov; extra == 'develop'
|
|
42
51
|
Requires-Dist: pytest-mock; extra == 'develop'
|
|
52
|
+
Requires-Dist: python-docx<2,>=1; extra == 'develop'
|
|
43
53
|
Requires-Dist: python-telegram-bot; extra == 'develop'
|
|
54
|
+
Requires-Dist: reportlab<6,>=4; extra == 'develop'
|
|
44
55
|
Requires-Dist: ruff; extra == 'develop'
|
|
45
56
|
Requires-Dist: slack-sdk; extra == 'develop'
|
|
46
57
|
Requires-Dist: symphony-bdk-python; extra == 'develop'
|
|
@@ -49,26 +60,27 @@ Requires-Dist: ty; extra == 'develop'
|
|
|
49
60
|
Requires-Dist: uv; extra == 'develop'
|
|
50
61
|
Requires-Dist: whatsapp-python; extra == 'develop'
|
|
51
62
|
Requires-Dist: wheel; extra == 'develop'
|
|
63
|
+
Requires-Dist: zulip; extra == 'develop'
|
|
52
64
|
Provides-Extra: mcp
|
|
53
65
|
Requires-Dist: fastmcp>=2; extra == 'mcp'
|
|
54
66
|
Requires-Dist: hydra-core>=1.3; extra == 'mcp'
|
|
55
67
|
Description-Content-Type: text/markdown
|
|
56
68
|
|
|
57
69
|
<p>
|
|
58
|
-
<img src="https://github.com/1kbgz/chatom/raw/main/docs/img/logo-light.png?raw=true#gh-light-mode-only" alt="chatom" width="150">
|
|
59
|
-
<img src="https://github.com/1kbgz/chatom/raw/main/docs/img/logo-dark.png?raw=true#gh-dark-mode-only" alt="chatom" width="150">
|
|
70
|
+
<img class="logo-light" src="https://github.com/1kbgz/chatom/raw/main/docs/img/logo-light.png?raw=true#gh-light-mode-only" alt="chatom" width="150">
|
|
71
|
+
<img class="logo-dark" src="https://github.com/1kbgz/chatom/raw/main/docs/img/logo-dark.png?raw=true#gh-dark-mode-only" alt="chatom" width="150">
|
|
60
72
|
</p>
|
|
61
73
|
|
|
62
74
|
# Chatom
|
|
63
75
|
|
|
64
|
-
A unified Python frontend for Discord, Slack, Symphony, Telegram, and
|
|
76
|
+
A unified Python frontend for Discord, IRC, Matrix, Slack, Symphony, Telegram, and Zulip.
|
|
65
77
|
|
|
66
78
|
[](https://github.com/1kbgz/chatom/actions/workflows/build.yaml)
|
|
67
79
|
[](https://codecov.io/gh/1kbgz/chatom)
|
|
68
80
|
[](https://github.com/1kbgz/chatom)
|
|
69
81
|
[](https://pypi.python.org/pypi/chatom)
|
|
70
82
|
|
|
71
|
-
Chatom lets application code use one set of users, channels, messages, formatting nodes, interactions, and backend operations. Platform adapters translate that frontend to Discord, Slack, Symphony, or
|
|
83
|
+
Chatom lets application code use one set of users, channels, messages, formatting nodes, interactions, and backend operations. Platform adapters translate that frontend to Discord, IRC, Matrix, Slack, Symphony, Telegram, or Zulip at the edge. The same models also feed cross-platform bridges, pydantic-ai tools, MCP servers, and CSP graphs.
|
|
72
84
|
|
|
73
85
|
## Install
|
|
74
86
|
|
|
@@ -81,12 +93,12 @@ pip install chatom
|
|
|
81
93
|
Install the SDKs for the backends you use:
|
|
82
94
|
|
|
83
95
|
```bash
|
|
84
|
-
pip install slack-sdk discord.py symphony-bdk-python python-telegram-bot
|
|
96
|
+
pip install slack-sdk discord.py matrix-nio symphony-bdk-python python-telegram-bot zulip
|
|
85
97
|
```
|
|
86
98
|
|
|
87
99
|
Optional integrations are available with `chatom[agent]` and `chatom[mcp]`.
|
|
88
100
|
|
|
89
|
-
## One message,
|
|
101
|
+
## One message, every backend
|
|
90
102
|
|
|
91
103
|
```python
|
|
92
104
|
from chatom import MessageBuilder
|
|
@@ -108,8 +120,13 @@ slack_content = message.render_for("slack")
|
|
|
108
120
|
discord_content = message.render_for("discord")
|
|
109
121
|
symphony_content = message.render_for("symphony")
|
|
110
122
|
telegram_content = message.render_for("telegram")
|
|
123
|
+
matrix_content = message.render_for("matrix")
|
|
124
|
+
zulip_content = message.render_for("zulip")
|
|
125
|
+
irc_content = message.render_for("irc")
|
|
111
126
|
```
|
|
112
127
|
|
|
128
|
+
Each backend receives its own dialect: mrkdwn for Slack, Markdown for Discord and Zulip, HTML for Symphony and Matrix, Telegram's HTML subset, and plain text for IRC.
|
|
129
|
+
|
|
113
130
|
Message construction stays unchanged. Only rendering and backend configuration know which platform receives it.
|
|
114
131
|
|
|
115
132
|
Connected backends share the same lifecycle and operation shape:
|
|
@@ -132,7 +149,7 @@ finally:
|
|
|
132
149
|
- Model promotion and demotion between common and backend-specific types
|
|
133
150
|
- Identity mapping and message forwarding between platforms
|
|
134
151
|
- Agent, MCP, and CSP integrations built on the same backend contract
|
|
135
|
-
- In-memory
|
|
152
|
+
- In-memory backends for all supported platforms
|
|
136
153
|
|
|
137
154
|
## Documentation
|
|
138
155
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<p>
|
|
2
|
-
<img src="https://github.com/1kbgz/chatom/raw/main/docs/img/logo-light.png?raw=true#gh-light-mode-only" alt="chatom" width="150">
|
|
3
|
-
<img src="https://github.com/1kbgz/chatom/raw/main/docs/img/logo-dark.png?raw=true#gh-dark-mode-only" alt="chatom" width="150">
|
|
2
|
+
<img class="logo-light" src="https://github.com/1kbgz/chatom/raw/main/docs/img/logo-light.png?raw=true#gh-light-mode-only" alt="chatom" width="150">
|
|
3
|
+
<img class="logo-dark" src="https://github.com/1kbgz/chatom/raw/main/docs/img/logo-dark.png?raw=true#gh-dark-mode-only" alt="chatom" width="150">
|
|
4
4
|
</p>
|
|
5
5
|
|
|
6
6
|
# Chatom
|
|
7
7
|
|
|
8
|
-
A unified Python frontend for Discord, Slack, Symphony, Telegram, and
|
|
8
|
+
A unified Python frontend for Discord, IRC, Matrix, Slack, Symphony, Telegram, and Zulip.
|
|
9
9
|
|
|
10
10
|
[](https://github.com/1kbgz/chatom/actions/workflows/build.yaml)
|
|
11
11
|
[](https://codecov.io/gh/1kbgz/chatom)
|
|
12
12
|
[](https://github.com/1kbgz/chatom)
|
|
13
13
|
[](https://pypi.python.org/pypi/chatom)
|
|
14
14
|
|
|
15
|
-
Chatom lets application code use one set of users, channels, messages, formatting nodes, interactions, and backend operations. Platform adapters translate that frontend to Discord, Slack, Symphony, or
|
|
15
|
+
Chatom lets application code use one set of users, channels, messages, formatting nodes, interactions, and backend operations. Platform adapters translate that frontend to Discord, IRC, Matrix, Slack, Symphony, Telegram, or Zulip at the edge. The same models also feed cross-platform bridges, pydantic-ai tools, MCP servers, and CSP graphs.
|
|
16
16
|
|
|
17
17
|
## Install
|
|
18
18
|
|
|
@@ -25,12 +25,12 @@ pip install chatom
|
|
|
25
25
|
Install the SDKs for the backends you use:
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
pip install slack-sdk discord.py symphony-bdk-python python-telegram-bot
|
|
28
|
+
pip install slack-sdk discord.py matrix-nio symphony-bdk-python python-telegram-bot zulip
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
Optional integrations are available with `chatom[agent]` and `chatom[mcp]`.
|
|
32
32
|
|
|
33
|
-
## One message,
|
|
33
|
+
## One message, every backend
|
|
34
34
|
|
|
35
35
|
```python
|
|
36
36
|
from chatom import MessageBuilder
|
|
@@ -52,8 +52,13 @@ slack_content = message.render_for("slack")
|
|
|
52
52
|
discord_content = message.render_for("discord")
|
|
53
53
|
symphony_content = message.render_for("symphony")
|
|
54
54
|
telegram_content = message.render_for("telegram")
|
|
55
|
+
matrix_content = message.render_for("matrix")
|
|
56
|
+
zulip_content = message.render_for("zulip")
|
|
57
|
+
irc_content = message.render_for("irc")
|
|
55
58
|
```
|
|
56
59
|
|
|
60
|
+
Each backend receives its own dialect: mrkdwn for Slack, Markdown for Discord and Zulip, HTML for Symphony and Matrix, Telegram's HTML subset, and plain text for IRC.
|
|
61
|
+
|
|
57
62
|
Message construction stays unchanged. Only rendering and backend configuration know which platform receives it.
|
|
58
63
|
|
|
59
64
|
Connected backends share the same lifecycle and operation shape:
|
|
@@ -76,7 +81,7 @@ finally:
|
|
|
76
81
|
- Model promotion and demotion between common and backend-specific types
|
|
77
82
|
- Identity mapping and message forwarding between platforms
|
|
78
83
|
- Agent, MCP, and CSP integrations built on the same backend contract
|
|
79
|
-
- In-memory
|
|
84
|
+
- In-memory backends for all supported platforms
|
|
80
85
|
|
|
81
86
|
## Documentation
|
|
82
87
|
|
|
@@ -31,9 +31,12 @@ from .backend import (
|
|
|
31
31
|
)
|
|
32
32
|
from .base import (
|
|
33
33
|
DISCORD_CAPABILITIES,
|
|
34
|
+
IRC_CAPABILITIES,
|
|
35
|
+
MATRIX_CAPABILITIES,
|
|
34
36
|
SLACK_CAPABILITIES,
|
|
35
37
|
SYMPHONY_CAPABILITIES,
|
|
36
38
|
TELEGRAM_CAPABILITIES,
|
|
39
|
+
ZULIP_CAPABILITIES,
|
|
37
40
|
# Presence
|
|
38
41
|
Activity,
|
|
39
42
|
ActivityType,
|
|
@@ -104,9 +107,12 @@ from .enums import (
|
|
|
104
107
|
ALL_BACKENDS,
|
|
105
108
|
BACKEND,
|
|
106
109
|
DISCORD,
|
|
110
|
+
IRC,
|
|
111
|
+
MATRIX,
|
|
107
112
|
SLACK,
|
|
108
113
|
SYMPHONY,
|
|
109
114
|
TELEGRAM,
|
|
115
|
+
ZULIP,
|
|
110
116
|
)
|
|
111
117
|
from .format import (
|
|
112
118
|
BACKEND_FORMAT_MAP,
|
|
@@ -166,7 +172,7 @@ from .format import (
|
|
|
166
172
|
)
|
|
167
173
|
from .handlers import InteractionHandler, InteractionRegistry
|
|
168
174
|
|
|
169
|
-
__version__ = "0.2.
|
|
175
|
+
__version__ = "0.2.3"
|
|
170
176
|
|
|
171
177
|
__all__ = (
|
|
172
178
|
"ALL_BACKENDS",
|
|
@@ -178,7 +184,11 @@ __all__ = (
|
|
|
178
184
|
"DISCORD_MARKDOWN",
|
|
179
185
|
"FORMAT",
|
|
180
186
|
"HTML",
|
|
187
|
+
"IRC",
|
|
188
|
+
"IRC_CAPABILITIES",
|
|
181
189
|
"MARKDOWN",
|
|
190
|
+
"MATRIX",
|
|
191
|
+
"MATRIX_CAPABILITIES",
|
|
182
192
|
"PLAINTEXT",
|
|
183
193
|
"SLACK",
|
|
184
194
|
"SLACK_CAPABILITIES",
|
|
@@ -189,6 +199,8 @@ __all__ = (
|
|
|
189
199
|
"TELEGRAM",
|
|
190
200
|
"TELEGRAM_CAPABILITIES",
|
|
191
201
|
"TELEGRAM_HTML",
|
|
202
|
+
"ZULIP",
|
|
203
|
+
"ZULIP_CAPABILITIES",
|
|
192
204
|
# Presence
|
|
193
205
|
"Activity",
|
|
194
206
|
"ActivityType",
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import csv
|
|
4
|
+
import io
|
|
5
|
+
import mimetypes
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Any
|
|
8
|
+
from xml.sax.saxutils import escape
|
|
9
|
+
from zipfile import ZipFile
|
|
10
|
+
|
|
11
|
+
MAX_BYTES = 5_000_000
|
|
12
|
+
MAX_CHARS = 50_000
|
|
13
|
+
MAX_CELLS = 10_000
|
|
14
|
+
MAX_PAGES = 100
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _format(filename: str) -> str:
|
|
18
|
+
extension = Path(filename).suffix.lower()
|
|
19
|
+
if extension not in {".txt", ".csv", ".xlsx", ".pdf", ".docx"}:
|
|
20
|
+
raise ValueError("Unsupported document format. Use TXT, CSV, XLSX, PDF, or DOCX.")
|
|
21
|
+
return extension
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _check_table(columns: list[str], rows: list[list[Any]]) -> None:
|
|
25
|
+
if len(columns) + sum(len(row) for row in rows) > MAX_CELLS:
|
|
26
|
+
raise ValueError("Document exceeds the cell limit.")
|
|
27
|
+
if columns and any(len(row) != len(columns) for row in rows):
|
|
28
|
+
raise ValueError("Every row must match the number of columns.")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def create_document(
|
|
32
|
+
filename: str,
|
|
33
|
+
*,
|
|
34
|
+
text: str = "",
|
|
35
|
+
columns: list[str] | None = None,
|
|
36
|
+
rows: list[list[Any]] | None = None,
|
|
37
|
+
sheet_name: str = "Data",
|
|
38
|
+
) -> tuple[bytes, str]:
|
|
39
|
+
extension = _format(filename)
|
|
40
|
+
columns, rows = columns or [], rows or []
|
|
41
|
+
_check_table(columns, rows)
|
|
42
|
+
if len(text) + sum(len(str(value)) for row in [columns, *rows] for value in row) > MAX_CHARS:
|
|
43
|
+
raise ValueError("Document exceeds the text limit.")
|
|
44
|
+
output = io.BytesIO()
|
|
45
|
+
if extension == ".txt":
|
|
46
|
+
data = text.encode("utf-8")
|
|
47
|
+
elif extension == ".csv":
|
|
48
|
+
stream = io.StringIO(newline="")
|
|
49
|
+
writer = csv.writer(stream)
|
|
50
|
+
for row in ([columns] if columns else []) + rows:
|
|
51
|
+
writer.writerow(["'" + value if isinstance(value, str) and value.startswith(("=", "+", "-", "@")) else value for value in row])
|
|
52
|
+
data = stream.getvalue().encode("utf-8")
|
|
53
|
+
elif extension == ".xlsx":
|
|
54
|
+
from openpyxl import Workbook
|
|
55
|
+
|
|
56
|
+
workbook = Workbook()
|
|
57
|
+
worksheet = workbook.active
|
|
58
|
+
worksheet.title = sheet_name
|
|
59
|
+
for row in ([columns] if columns else []) + rows:
|
|
60
|
+
worksheet.append(row)
|
|
61
|
+
for cell in worksheet[worksheet.max_row]:
|
|
62
|
+
if isinstance(cell.value, str):
|
|
63
|
+
cell.data_type = "s"
|
|
64
|
+
workbook.save(output)
|
|
65
|
+
workbook.close()
|
|
66
|
+
data = output.getvalue()
|
|
67
|
+
elif extension == ".docx":
|
|
68
|
+
from docx import Document
|
|
69
|
+
|
|
70
|
+
document = Document()
|
|
71
|
+
document.add_paragraph(text)
|
|
72
|
+
table_rows = ([columns] if columns else []) + rows
|
|
73
|
+
if table_rows:
|
|
74
|
+
table = document.add_table(rows=0, cols=max(len(row) for row in table_rows))
|
|
75
|
+
for row in table_rows:
|
|
76
|
+
cells = table.add_row().cells
|
|
77
|
+
for index, value in enumerate(row):
|
|
78
|
+
cells[index].text = str(value)
|
|
79
|
+
document.save(output)
|
|
80
|
+
data = output.getvalue()
|
|
81
|
+
else:
|
|
82
|
+
from reportlab.lib.styles import getSampleStyleSheet
|
|
83
|
+
from reportlab.platypus import Paragraph, SimpleDocTemplate, Table
|
|
84
|
+
|
|
85
|
+
styles = getSampleStyleSheet()
|
|
86
|
+
items = [Paragraph(escape(text).replace("\n", "<br/>"), styles["BodyText"])]
|
|
87
|
+
table_rows = ([columns] if columns else []) + rows
|
|
88
|
+
if table_rows:
|
|
89
|
+
items.append(Table([[Paragraph(escape(str(value)), styles["BodyText"]) for value in row] for row in table_rows]))
|
|
90
|
+
SimpleDocTemplate(output).build(items)
|
|
91
|
+
data = output.getvalue()
|
|
92
|
+
if len(data) > MAX_BYTES:
|
|
93
|
+
raise ValueError("Document exceeds the byte limit.")
|
|
94
|
+
office_types = {
|
|
95
|
+
".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
96
|
+
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
97
|
+
}
|
|
98
|
+
return data, office_types.get(extension) or mimetypes.guess_type(filename)[0] or "application/octet-stream"
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def read_document(
|
|
102
|
+
data: bytes,
|
|
103
|
+
filename: str,
|
|
104
|
+
content_type: str = "",
|
|
105
|
+
*,
|
|
106
|
+
max_bytes: int = MAX_BYTES,
|
|
107
|
+
max_chars: int = MAX_CHARS,
|
|
108
|
+
) -> dict[str, Any]:
|
|
109
|
+
extension = _format(filename)
|
|
110
|
+
if len(data) > max_bytes or max_bytes < 1 or max_chars < 1:
|
|
111
|
+
raise ValueError("Document exceeds the byte limit or has invalid limits.")
|
|
112
|
+
if extension in {".xlsx", ".docx"}:
|
|
113
|
+
with ZipFile(io.BytesIO(data)) as archive:
|
|
114
|
+
if len(archive.infolist()) > 2_000 or sum(item.file_size for item in archive.infolist()) > max_bytes:
|
|
115
|
+
raise ValueError("Document expanded archive exceeds the byte limit.")
|
|
116
|
+
result: dict[str, Any] = {"filename": filename, "content_type": content_type or mimetypes.guess_type(filename)[0], "truncated": False}
|
|
117
|
+
text = ""
|
|
118
|
+
if extension == ".txt":
|
|
119
|
+
text = data.decode("utf-8-sig")
|
|
120
|
+
elif extension == ".csv":
|
|
121
|
+
table = []
|
|
122
|
+
cells = 0
|
|
123
|
+
for row in csv.reader(io.StringIO(data.decode("utf-8-sig"))):
|
|
124
|
+
cells += len(row)
|
|
125
|
+
if cells > MAX_CELLS or sum(len(str(value)) for value in row) + len(text) > max_chars:
|
|
126
|
+
result["truncated"] = True
|
|
127
|
+
break
|
|
128
|
+
table.append(row)
|
|
129
|
+
text += "\t".join(row) + "\n"
|
|
130
|
+
result["rows"] = table
|
|
131
|
+
elif extension == ".xlsx":
|
|
132
|
+
from openpyxl import load_workbook
|
|
133
|
+
|
|
134
|
+
workbook = load_workbook(io.BytesIO(data), read_only=True, data_only=False, keep_links=False)
|
|
135
|
+
sheets: dict[str, list[list[Any]]] = {}
|
|
136
|
+
cells = 0
|
|
137
|
+
try:
|
|
138
|
+
for sheet in workbook:
|
|
139
|
+
values = []
|
|
140
|
+
for row in sheet.iter_rows(values_only=True):
|
|
141
|
+
cells += len(row)
|
|
142
|
+
row_text = "\t".join(str(value) if value is not None else "" for value in row) + "\n"
|
|
143
|
+
if cells > MAX_CELLS or len(text) + len(row_text) > max_chars:
|
|
144
|
+
result["truncated"] = True
|
|
145
|
+
break
|
|
146
|
+
values.append([value.isoformat() if hasattr(value, "isoformat") else value for value in row])
|
|
147
|
+
text += row_text
|
|
148
|
+
sheets[sheet.title] = values
|
|
149
|
+
if result["truncated"]:
|
|
150
|
+
break
|
|
151
|
+
finally:
|
|
152
|
+
workbook.close()
|
|
153
|
+
result["sheets"] = sheets
|
|
154
|
+
elif extension == ".docx":
|
|
155
|
+
from docx import Document
|
|
156
|
+
|
|
157
|
+
document = Document(io.BytesIO(data))
|
|
158
|
+
text = "\n".join(paragraph.text for paragraph in document.paragraphs)
|
|
159
|
+
for table in document.tables:
|
|
160
|
+
for row in table.rows:
|
|
161
|
+
text += "\n" + "\t".join(cell.text for cell in row.cells)
|
|
162
|
+
if len(text) > max_chars:
|
|
163
|
+
break
|
|
164
|
+
if len(text) > max_chars:
|
|
165
|
+
break
|
|
166
|
+
else:
|
|
167
|
+
from pypdf import PdfReader
|
|
168
|
+
|
|
169
|
+
document = PdfReader(io.BytesIO(data))
|
|
170
|
+
if document.is_encrypted:
|
|
171
|
+
raise ValueError("Encrypted PDF documents are unsupported.")
|
|
172
|
+
result["pages"] = len(document.pages)
|
|
173
|
+
image_pages = []
|
|
174
|
+
for index, page in enumerate(document.pages[:MAX_PAGES]):
|
|
175
|
+
page_text = page.extract_text() or ""
|
|
176
|
+
if not page_text.strip():
|
|
177
|
+
image_pages.append(index + 1)
|
|
178
|
+
text += page_text + "\n"
|
|
179
|
+
if len(text) > max_chars:
|
|
180
|
+
break
|
|
181
|
+
result["needs_ocr_pages"] = image_pages
|
|
182
|
+
result["truncated"] = len(document.pages) > MAX_PAGES
|
|
183
|
+
result["text"] = text[:max_chars]
|
|
184
|
+
result["truncated"] = result["truncated"] or len(text) > max_chars
|
|
185
|
+
return result
|