Metadata-Version: 2.5
Name: statepatch
Version: 0.1.1
Summary: Immer-style ops over a plain JSON tree: observables that emit every mutation as an op
Project-URL: Repository, https://github.com/assistant-ui/harness-sdk
License-Expression: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# statepatch

Immer-style ops over a plain JSON tree.

`observable(initial)` wraps one value: `.value` reads it, every mutation applies to the tree and emits the matching op (`replace` / `add` / `remove`) to subscribers. Observables compose: an observable stored inside another mounts its op stream at that path.

```python
from statepatch import observable

state = observable({"runs": []})
state.subscribe(print)

run = observable({"runId": "r1", "queue": []})
state["runs"].append(run)          # add op at ["runs", 0]
run["queue"].append({"id": "q1"})  # forwarded as add at ["runs", 0, "queue", 0]
state["runs"].pop(0)               # remove op; run is detached and reusable
```
