statewire
The Statewire protocol for Python: a Statewire host owns one JSON state dict, streams every change to attached clients as ops, and dispatches typed commands back. Part of harness-sdk, with harness-sdk and pinned.
Install
uv add statewire
Extras: uv add "statewire[langgraph]", uv add "statewire[orjson]".
Use
from fastapi import FastAPI
from pinned import PinnedHost, PinnedWorker
from statewire import Statewire, StatewireReject, command
class Counter(Statewire):
async def lifespan(self):
self.state = {"count": 0}
yield
@command
async def increment(self):
if self.state["count"] >= 10:
raise StatewireReject("the counter is full (max 10)")
self.state["count"] += 1
worker = PinnedWorker()
app = FastAPI()
app.include_router(worker)
app.include_router(PinnedHost(Counter, worker=worker, namespace="/threads"))
Protocols and documents
Connections negotiate date ranges through Statewire-Version and Statewire-Protocol. Protocols are additive and required by default. The server selects versions in syn; WebSockets use statewire.v1.
Each protocol owns its commands, context documents, and state documents. The main document is independent of its optional read key. Command sequences and replay remain shared across protocols. Python hosts support lazy, chained compatibility adapters.
See the protocol registration and migration guide.
Docs
- Get started: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/app/statewire/docs/get-started/statewire/page.mdx
- Guide: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/app/statewire/docs/guides/statewire/host/page.mdx
- Reference: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/app/statewire/docs/reference/statewire-python/page.mdx
- Spec: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/app/statewire/docs/spec/statewire-protocol/page.mdx
Metadata
Release files for statewire 0.17.5
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 | |
|---|---|---|---|---|
| statewire-0.17.5.tar.gz | 117.6 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| statewire-0.17.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 178.2 kB
Release files / statewire-0.17.5.tar.gz
| Download URL | statewire-0.17.5.tar.gz |
|---|---|
| Size | 117.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c145383df5a64af25ab612b6fc884d35d2d45ea83b26131e86fe28753aab272
|
|
BLAKE2b-256 checksum How to use checksums |
d689686f67f37e9e6bf7bc44b670cb4144314aa34119ac154bb7d88f47a2e97f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 9, 2026.
Transparency logRelease files / statewire-0.17.5-py3-none-any.whl
| Download URL | statewire-0.17.5-py3-none-any.whl |
|---|---|
| Size | 60.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
824ccce1903a13ed561dbcc1a8b00444df0f291178ec2632b3c0e47ff001324d
|
|
BLAKE2b-256 checksum How to use checksums |
0ac8c56bd68a67c72aff875877653fbb86a760bec2ad2f77baa88d47d0760d4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 9, 2026.
Transparency logSecurity for statewire 0.17.5
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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for statewire-0.17.5.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 Sep 9, 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.