Skip to main content

magic-campus-im

Channel-only communication SDK. It has no CLI, business clients, group-management methods or public history/synchronization API. HTTP is retained for IM credentials, profiles, media upload and channel reactions. It does not depend on either business distribution.

from magiccampus_im import MagicCampusWSConfig, MagicCampusWSSDK

sdk = MagicCampusWSSDK(
    MagicCampusWSConfig(apiurl="https://campus.example", apikey="...", data_dir="./channel-state"),
    on_recv_new_message=handle_message,
    on_recv_offline_new_message=handle_recovered_message,
)
sdk.login()
sdk.start()
# sdk.send_text("hello", recv_id="...")
# sdk.add_message_reaction(...), sdk.delete_message_reaction(...)
# sdk.logout() closes connection and state storage

Receive recovery

A new installation establishes a current receive baseline, without pulling old history. auto_sync_on_connect=False skips previously missed messages on startup; set it to true to resume existing checkpoints after a process restart or controlled handoff. auto_sync_on_reconnect=True recovers gaps after a connection interruption. These switches control internal recovery only; there is no public sync_once.

Recovery pages are delivered through on_recv_offline_new_message. Live pushes are buffered during recovery and deduplicated against recovered messages. A live push ahead of the snapshot cannot advance the checkpoint over a gap. The startup baseline is established once per connection, so retrying cannot skip later messages. Each successful callback atomically records its message ID and receive cursor; a failed callback leaves that message unacknowledged. Acknowledged sequences are not replayed after the bounded ID cache is evicted.

Errors are reported through on_error and recovery retries use the configured backoff/attempt limit. A failed conversation does not prevent healthy conversations from recovering or receiving live messages. Server minimum-sequence and confirmed range boundaries are honored when supplied. Unavailable sequences are reported as recovery gaps; only server-confirmed progress is skipped. An absent/unconfirmed range remains pending rather than silently advancing its cursor. Stop wakes pending requests, and workers/sockets from an old connection cannot commit into a new one.

channel-progress_<user>.db stores only checkpoints, initialization state and a bounded set of message IDs (10,000). It contains no searchable chat bodies. State belongs to one user/environment/platform data directory. Its metadata binds the endpoint/user/platform context and rejects a mismatched context; token rotation keeps the same context. Do not share a directory between unrelated instances. Callbacks must return successfully to record receipt. This is not an acknowledgment that an Agent finished processing a message.

The implementation uses the existing OpenIM protocol. Real server retention and notification behavior still require staging validation before online migration.

Metadata

Release files for magic-campus-im 0.1.0

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

Source distribution (sdist)

Source distribution for magic-campus-im 0.1.0
File Size Uploaded Provenance Actions
magic_campus_im-0.1.0.tar.gz 53.4 kB Without provenance Details for magic_campus_im-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for magic-campus-im 0.1.0
File Interpreter ABI Platform Actions
magic_campus_im-0.1.0-py3-none-any.whl Python 3 none any Details for magic_campus_im-0.1.0-py3-none-any.whl

Total release size: 102.5 kB

Release files / magic_campus_im-0.1.0.tar.gz

Download URL magic_campus_im-0.1.0.tar.gz
Size 53.4 kB
Tags Source
SHA-256 checksum
How to use checksums
174d8f4f26d2072e642eec779a276bd6d87dd4a5c23c4915fcb7e7896daabe71
BLAKE2b-256 checksum
How to use checksums
6c94800df6ebb5b579780ae5a9ae934fa6ad31dab6932b4459434633097682ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0

Release files / magic_campus_im-0.1.0-py3-none-any.whl

Download URL magic_campus_im-0.1.0-py3-none-any.whl
Size 49.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60373af97695dac996cfdd17c2d86d56cf16f9f73d7f38f7a15c523eb2ec66ae
BLAKE2b-256 checksum
How to use checksums
f122decb613e8a48997a46295ba612cf2b71ee97f59addf6f0d5255fb06ae554
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0

Security for magic-campus-im 0.1.0

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