Connector-System fuer externe Kommunikation (Telegram, Discord, HomeAssistant). Bidirektionales Messaging mit zuverlaessiger Zustellung via Queue, Retry/Backoff und Circuit Breaker.
Bidirektionale Kommunikation mit externen Services. 3 Runtime-Adapter verfuegbar, Queue-Processor fuer zuverlaessige Zustellung.
| Typ | Status | Features | |-----|--------|----------| | Telegram | Beta | Polling, Owner-Filter, Send, Poll-Loop | | Discord | Beta | Webhook-Send, Incremental Polling, Bot-Filter | | HomeAssistant | Beta | States, Services, History, Events | | Signal | Geplant | signal-cli Integration | | WhatsApp | Geplant | Baileys Integration |
| Channel | Status | Dispatch | |---------|--------|----------| | Telegram | Aktiv | Bot API via secrets.json | | Discord | Aktiv | Webhook | | Slack | Aktiv | Webhook | | Webhook | Aktiv | Generischer HTTP POST | | Email | Aktiv | SMTP_SSL |
Neue Channels: siehe connectors/templates/README.md
Keys gehoeren in user/secrets/secrets.json (dist_type=0), NICHT in bach.db!
In der DB steht nur auth_type='secrets_file' als Verweis.
CLI / REST-API / Daemon
|
┌──────┴──────────────────────┐
| |
hub/connector.py (bidir.) hub/notify.py (nur Senden)
| |
queue_processor.py _load_secrets()
| |
connectors/ (Adapter) user/secrets/secrets.json
├── base.py (ABC)
├── telegram_connector.py
├── discord_connector.py
└── homeassistant_connector.py
# Connector registrieren
bach connector add telegram mein_bot
# Einmalig pollen
bach connector poll mein_bot
# Queue verwalten
bach connector queue-status
bach connector retry all
# Automatisch (Daemon)
bach connector setup-daemon
bach daemon start --bg
POST /api/v1/messages/send Queue Nachricht
GET /api/v1/messages/queue Queue-Status
GET /api/v1/messages/inbox Inbox (paginiert)
POST /api/v1/messages/route Routing ausloesen
connectors/
├── SKILL.md # Diese Datei
├── base.py # BaseConnector ABC
├── telegram_connector.py # Telegram Bot API (bidirektional)
├── discord_connector.py # Discord REST + Webhook
├── homeassistant_connector.py # Home Assistant API
├── signal_connector.py # Signal (geplant)
├── whatsapp_connector.py # WhatsApp (Beispiel)
└── templates/
├── README.md # Anleitung: Neue Connectors + Channels
├── connector_template.py # Code-Template (volle Connectors)
├── notification_template.yaml # Anleitung: Notification-Channels
├── setup_wizard.py # Interaktiver Setup-Wizard
├── telegram_template.yaml # Telegram-Konfiguration
└── whatsapp_template.yaml # WhatsApp-Konfiguration
hub/connector.py # CLI-Handler (bidirektionale Connectors)
hub/notify.py # CLI-Handler (Notification-Channels)
hub/_services/connector/
├── __init__.py
└── queue_processor.py # Queue-Processor (Kern)
user/secrets/secrets.json # API-Keys (dist_type=0, PRIVAT!)
gui/api/messages_api.py # REST-API Router
db/migrations/001_*.sql # Schema-Migration
BACH Skill-Architektur v2.0
Category:other