This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: re-architect to plugins
delegate-connector-telegram
An OSS Python connector for the Terrene Delegate substrate. Implements the
shipped kailash.delegate.Connector ABC (kailash 2.26.2) for Telegram via the
Bot API. It mirrors the email connector's shape and differs only in transport
(HTTP-only Bot API) and identity model (integer user_id / chat_id).
The connector contract (the shipped ABC — authenticate / read / write / invoke
plus the auth_verifier / ledger / revocation trust properties) is:
write—actionis a thunk wrapping a Bot APIsendMessagePOST, executed under audit, returning a realSignedActionEnvelope. The send is the auditable external side-effect.read—queryis a thunk wrapping a Bot APIgetUpdateslong-poll fetch, executed under audit, returning(updates, AttestedReadReceipt).authenticate— resolves the dispatch identity'sdelegate_idto aPrincipalagainst a dual-keyed resolver (by stringified integeruser_idandchat_id). An unknown identity resolves toReject(fail-closed); a@usernamehandle is never a resolution key (ref-unsafe and mutable).invoke— single-method dispatch entry: authenticate FIRST (fail-closed, before any Bot API call), then dispatch a send, returning aConnectorInvocationResult(external_side_effect=True).- Trust properties —
auth_verifierreturns the wiredEd25519Verifier;ledger/revocationreturn shipped concretes (framework-first; no custom trust primitives).
It subclasses Connector directly (ADR-1) — NOT LegacyInvokeConnector,
whose proxied read / write emit empty, unverifiable receipts. There is no
stale connect() / identify() / normalize() surface; those methods do not exist
in the shipped ABC.
Components
transport.py— thehttpx-backed Bot API transport (sendMessageoutbound +getUpdatesinbound long-poll). A Bot API429raises a typedRateLimitedErrorcarryingretry_after; the caller decides backoff.connector.py— theTelegramConnectoritself (the four ABC members + the three trust properties) plus theverify_action_envelope/verify_read_receipthelpers that re-derive identity-bound signing bytes.directory.py— the dual-keyed principal resolver + the closed-enumUnknownSenderDisposition(unknown sender →Reject).validation.py— pure message-content validation (control-character reject,text≤ 4096 UTF-16 code units,chat_idshape), invoked at theOutboundMessageconstruction boundary so every send route is covered.compose.py—build_telegram_runtime, which composes a realDelegateRuntimearound the connector with the shipped trust / audit / verifier concretes (no mocks).
Install
pip install -e connectors/telegram
Configure
All credentials come from the environment (see .env.example):
TELEGRAM_BOT_TOKEN and TELEGRAM_API_BASE. Nothing is hardcoded; nothing is
logged. The token is part of the request URL, so the transport logs the method +
chat, never the URL.
Test
pip install -e "connectors/telegram[test]"
# Tier 1 (unit)
python -m pytest connectors/telegram/tests/unit -q
# Tier 2/3 (integration — REAL TelegramTransport over a REAL httpx.AsyncClient
# whose byte stream terminates at an in-process protocol-faithful Bot API
# double; NO mock at the connector boundary, so these RUN in CI)
python -m pytest connectors/telegram/tests/integration -q
# Conformance (canonical conformance vector set)
python -m pytest connectors/telegram/tests/conformance -q
# Regression (behavioral security-property guards; NEVER deleted)
python -m pytest connectors/telegram/tests/regression -q
The opt-in Tier-3 live test (test_live_telegram) skips with a clear "cannot
execute" reason unless real TELEGRAM_* credentials are present — it never falls
back to a mock. The end-to-end runtime.execute() outcome assertions are
strict-xfail gated on an SDK fix (kailash-py#1182); the connector's own
read / write receipts verify today.
License
Apache 2.0. All open-source IP is owned by the Terrene Foundation.
Metadata
Release files for delegate-connector-telegram 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| delegate_connector_telegram-0.1.0.tar.gz | 57.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| delegate_connector_telegram-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 87.0 kB
Release files / delegate_connector_telegram-0.1.0.tar.gz
| Download URL | delegate_connector_telegram-0.1.0.tar.gz |
|---|---|
| Size | 57.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5b5952440d6ea7c2036a07b6aadda8c6ab86e9ea9620c6d42d267e5aacf548b3
|
|
BLAKE2b-256 checksum How to use checksums |
563c2d196ce53f6037d3989880db9349593f86b00af84c241df8c250599f27c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Release files / delegate_connector_telegram-0.1.0-py3-none-any.whl
| Download URL | delegate_connector_telegram-0.1.0-py3-none-any.whl |
|---|---|
| Size | 29.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6d587b8334076785163bb821d5a2e8dadf2abedd8603067eb9d3a1f994f6e325
|
|
BLAKE2b-256 checksum How to use checksums |
4e34620dd1bfd50e0e47c7ee9a7ccd4657dbb4706468ce9085b63fe22e0d7f7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|