Skip to main content

agim

One stateless interface for IM login, receive, and send. agim is a plain SDK: it owns no storage, no plugin registry, and no host concepts. Callers persist the login handshake and receive cursor themselves and hand them back on the next call.

Interface

class IMClient(ABC):
    async def login(self) -> LoginHandshake: ...
    async def is_login(self, handshake: LoginHandshake) -> LoginState: ...
    async def receive(self, cursor: str | None = None) -> ReceiveResult: ...
    async def send(self, chat_id: str, text: str, *, context_token: str | None = None) -> None: ...
    async def aclose(self) -> None: ...

Because nothing is stored inside agim:

  • login() returns the QR payload and the provider state needed to poll it. Persist the whole LoginHandshake, then pass it back to is_login().
  • receive() returns the message and the next cursor. Persist the cursor, then pass it to the next receive().
  • send() takes the context token the caller stored from the inbound message.

One getupdates poll can carry several messages. receive() still hands over exactly one message per call: the rest of the batch waits in memory (oldest first), and the returned cursor only advances past the batch once its last message has been handed over, so a restart mid-batch re-delivers that batch instead of dropping the messages behind the first one.

Platform clients

WeChatClient implements the Tencent personal WeChat iLink/ClawBot protocol used by Tencent's official openclaw-weixin project: QR login, getupdates long polling, and sendmessage. More platforms (for example Discord) implement the same IMClient surface.

Inbound messages carry their attachments on InboundMessage.media, one InboundMedia per image, voice note, file, or video. The client downloads the CDN reference and removes the AES-128-ECB encryption before returning, so a caller receives usable bytes; whether a given consumer reads an image, plays a voice note, or ignores both is the caller's decision. An item that cannot be downloaded or decrypted is logged and skipped: the message keeps the [image]/[voice]/[file]/[video] placeholder in its text. An item over MAX_MEDIA_BYTES raises MediaTooLargeError from fetch_media and is reported on InboundMessage.rejected_media, so a caller can tell the sender that the attachment was refused instead of losing it quietly.

Storage

None. Whoever calls agim owns persistence.

Metadata

Release files for agim 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agim 0.0.3
File Size Uploaded Provenance Actions
agim-0.0.3.tar.gz 57.9 kB Without provenance Details for agim-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agim 0.0.3
File Interpreter ABI Platform Actions
agim-0.0.3-py3-none-any.whl Python 3 none any Details for agim-0.0.3-py3-none-any.whl

Total release size: 74.8 kB

Release files / agim-0.0.3.tar.gz

Download URL agim-0.0.3.tar.gz
Size 57.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3dec9d3feece57f200d417c9882fb2565a15a577697aaf60de07ebf18b97c21e
BLAKE2b-256 checksum
How to use checksums
66b2baeb4266f6a94feafc1f5a0536219021ac4aeb9bb9570f65e16a1ae6771b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / agim-0.0.3-py3-none-any.whl

Download URL agim-0.0.3-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4202f07d849e867f51fe316d5adf28e9e83a779fe4f2dea583470718a0e51ee
BLAKE2b-256 checksum
How to use checksums
61329f72c93afc8adf73de4995e765777b0b7129025dde6ffb3622b807d3c704
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for agim 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page