takeover
Game-agnostic protocol takeover, free-threading async runtime, transactional state projection, and automation framework extracted from production multi-account game hosting.
Features
- Pure Standard-Library
FeatureRegistry: Single-point declarative registration for packet hooks (core -> domain -> reconcile), wake topics, topologically sortedProjectionHookpipelines (project_board), lock-scoped actions, automation specs, and workers. - WebSocket Lifecycle & Multi-Channel Auth:
maintain_connection+WebSocketTransport+SessionHandshakeprovide login handshakes, heartbeat monitoring, kick detection (LoginRejected), and exponential reconnect backoff.AuthProvider&AccountStoreseparate shared channel installation templates from redacted per-account credentials (0600atomic writes) and clean up stale login drafts.
- Transactional Field Store & Bounded Persistence:
FieldStateStorelazily decodes only accessed top-level fields, re-encodes dirty fields on commit, supports atomicexpand_batchexpansion, and rolls back partial mutations via SQLiteSAVEPOINT.AsyncPacketStorecouples an8 MiBin-memory live packet ring with coalesced100msbatch writes to SQLite (packets.sqlite3), incrementalauto_vacuum, and32 MiBbackpressure protection (PersistenceError).
- Free-Threading Ready
SharedRuntime&TaskLane:- Single shared
asyncioevent loop orchestrating 9 isolatedBoundedPools,WakeEventmodule targeting,ContextVarisolation, and a slow-callWatchdog. @workflowgenerator coroutines drive both synchronous worker calls and native async waits without holding worker threads.TaskLaneenforces write/query gap separation (request_gapvsquery_request_gap) and exponential failure backoff (3s/6s/12s).
- Single shared
- No-Replay Automation, Timed Windows & Late Settlement:
AutomationCoordinatorcombinesFocusPolicydeferral,TimeWindow/TimedDispatcher(including overnight spans),RecoveryTrackerread-only reconciliation, and delayed server settlement verifiers. - Turnkey Control-Plane API, Multi-User Identity & Server Factory:
EventHub(debounced SSE notifications),BoardUpdates(structural sharing +keyed-listdiffs),build_fastapi_router, andbuild_system_router(/api/system/auth/*,/api/system/admin/*).IdentityStore(scrypt auth, single-use invite codes, subscriptions, concurrent seat enforcement, audit log) +WorkspaceManager(user isolation, idle TTL eviction, online restoration).create_fastapi_app&run_server(ServerConfig,InstanceLockflock guard, local random token auth, SPA static fallback, 12h rotatingcontroller.log).
Installation
pip install takeover
# Optional acceleration and web extras:
pip install "takeover[fast,web]"
For local development from source:
pip install -e ".[fast,web,dev]"
Publishing to PyPI
Releases are automated via GitHub Actions Trusted Publishing (.github/workflows/publish.yml):
- Configure a Trusted Publisher on PyPI (
Owner: JackLuguibin,Repo: takeover,Workflow: publish.yml,Environment: pypi). - Tag and push a release:
git tag v0.1.0 && git push origin v0.1.0.
Quick Start: Extending Fullstack for a New Game
Backend (GamePlugin)
- Implement
GamePlugin(create_framer,create_codec,register_features). - Register
FeatureSpecbundles onFeatureRegistry. - Boot
create_fastapi_app(plugin, ServerConfig(...))orTakeoverApp(plugin, data_dir).
See examples/demo_game/plugin.py and examples/demo_game/run_demo.py:
PYTHONPATH=src python examples/demo_game/run_demo.py
Frontend (FrontendPlugin)
- Copy
templates/frontend/and bind React viacreateReactConsoleBindings(React). - Register
SectionSpec,PanelSpec(withboardKeys), andDialogSpecin aFrontendPlugin. - Mount
useConsoleController()+ConsoleProvider+useBoardKeys(...)to subscribe to SSE deltas.
Architecture, Frontend SDK & Deployment Templates
- Architecture: See docs/architecture.md for layered, UML class, concurrency, storage, and frontend plugin diagrams.
- Frontend SDK (
frontend-sdk/): Zero-dependency@takeover/console-sdkprovidingFrontendRegistry,createConsoleController,mergeBoardDelta,createConsoleStore,createInvalidationQueue,TakeoverClient,createThemeManager, andcreateReactConsoleBindings. - Frontend Template (
templates/frontend/): Ready-to-use React 19 + Vite plugin console skeleton wired to@takeover/console-sdk. - Deploy Templates (
templates/deploy/): Ready-to-use Python3.14tmulti-stageDockerfile,compose.yaml(app+ Nginxedge),nginx.conf, andpublish.sh.
Testing & Quality
PYTHONPATH=src python -m unittest discover -s tests -p 'test_*.py' -v
ruff check src tests examples
ruff format --check src tests examples
npm --prefix frontend-sdk test
Metadata
Release files for takeover 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 | Provenance | Actions |
|---|---|---|---|---|
| takeover-0.1.0.tar.gz | 77.2 kB | With provenance | Details for takeover-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| takeover-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for takeover-0.1.0-py3-none-any.whl |
Total release size: 150.8 kB
Release files / takeover-0.1.0.tar.gz
| Download URL | takeover-0.1.0.tar.gz |
|---|---|
| Size | 77.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b5b6b99f1d80b43369b18ed15811a8052f8ace9a904b875edb93006efafb9da
|
|
BLAKE2b-256 checksum How to use checksums |
50e4b3ee5129bb1aaa4ad8d5672dccc9e6c578c8439775c0ffa2bc22ca93aff1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logRelease files / takeover-0.1.0-py3-none-any.whl
| Download URL | takeover-0.1.0-py3-none-any.whl |
|---|---|
| Size | 73.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2fc40cdaec17fac3ff644732cdc364300ae72fd4b00846d811eca23caee414d2
|
|
BLAKE2b-256 checksum How to use checksums |
68bc8360999778ae7af77ec0f33df1777bfabd17b29b30dbf90d5f591eb0b89e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logSecurity for takeover 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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for takeover-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logA 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.