Quellcode durchsuchen

Refactor: Replace manual protobuf with chattolib

- Add chattolib[realtime] as dependency for Chatto API client
- Remove ~734 lines of manual protobuf encoding/decoding
- Remove ~225 lines of manual WebSocket implementation
- Replace REST RPC calls with ChattoClient methods
- Use stream_events() for realtime instead of manual WebSocket
- Remove all fallback logic to manual implementation
- Simplify imports and remove unused dependencies

Key changes:
- Auth via ChattoClient.login() instead of manual /auth/login
- User info via client.me() and client.get_user()
- Rooms via client.list_rooms() and client.join_room()
- Messages via client.post_message()
- Realtime via stream_events() with proper event handling
- Presence via client.update_presence()
- Notifications via client.dismiss_all_notifications()

This reduces adapter.py from 2933 to 2204 lines while adding
proper type safety and maintainability through chattolib.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Liv Klumpp vor 1 Woche
Ursprung
Commit
43cda8570b
2 geänderte Dateien mit 118 neuen und 886 gelöschten Zeilen
  1. 92 886
      adapter.py
  2. 26 0
      pyproject.toml

Datei-Diff unterdrückt, da er zu groß ist
+ 92 - 886
adapter.py


+ 26 - 0
pyproject.toml

@@ -0,0 +1,26 @@
+[build-system]
+requires = ["setuptools>=68.0"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "hermes-chatto-plugin"
+version = "1.0.0"
+description = "Chatto platform adapter for Hermes Agent"
+requires-python = ">=3.11"
+license = {text = "MIT"}
+authors = [
+    {name = "liv", email = ""},
+]
+dependencies = [
+    "chattolib[realtime]>=0.4.19",
+    "websockets>=13.0",
+]
+
+[project.optional-dependencies]
+dev = [
+    "pytest>=8.0",
+    "pytest-asyncio>=0.24",
+]
+
+[tool.setuptools.packages.find]
+where = ["."]

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.