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.2

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.2
File Size Uploaded Provenance Actions
agim-0.0.2.tar.gz 55.8 kB Without provenance Details for agim-0.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 72.7 kB

Release files / agim-0.0.2.tar.gz

Download URL agim-0.0.2.tar.gz
Size 55.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c868bde1c7bf58bdb757367569521c2f2535914be9d8ff30611a4f837cb7aca2
BLAKE2b-256 checksum
How to use checksums
7da4d75e1c1ecedab22c144fa8d24277a37c214b74b336398793bbec37929659
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.2-py3-none-any.whl

Download URL agim-0.0.2-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2fa0d675a2acc6607feceb9cfb2753b80df74b2ec255047e6ed092f169ff89f1
BLAKE2b-256 checksum
How to use checksums
8d90630bdff145d43f348e6797aa0f137e10e3864ea1b64abe19297f2a6a9c72
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.2

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