statewire 0.6.2__tar.gz → 0.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. {statewire-0.6.2 → statewire-0.7.0}/PKG-INFO +3 -6
  2. {statewire-0.6.2 → statewire-0.7.0}/README.md +1 -4
  3. {statewire-0.6.2 → statewire-0.7.0}/examples/demo_app.py +0 -2
  4. {statewire-0.6.2 → statewire-0.7.0}/pyproject.toml +1 -1
  5. {statewire-0.6.2 → statewire-0.7.0}/src/statewire/api.py +655 -221
  6. {statewire-0.6.2 → statewire-0.7.0}/src/statewire/client.py +456 -410
  7. statewire-0.7.0/src/statewire/ops.py +170 -0
  8. {statewire-0.6.2 → statewire-0.7.0}/src/statewire/testing.py +2 -2
  9. {statewire-0.6.2 → statewire-0.7.0}/tests/client_helpers.py +2 -2
  10. {statewire-0.6.2 → statewire-0.7.0}/tests/statewire_helpers.py +63 -5
  11. {statewire-0.6.2 → statewire-0.7.0}/tests/test_authorize.py +21 -21
  12. {statewire-0.6.2 → statewire-0.7.0}/tests/test_client.py +57 -22
  13. {statewire-0.6.2 → statewire-0.7.0}/tests/test_commands.py +157 -108
  14. {statewire-0.6.2 → statewire-0.7.0}/tests/test_context.py +24 -16
  15. statewire-0.7.0/tests/test_frames.py +610 -0
  16. {statewire-0.6.2 → statewire-0.7.0}/tests/test_idle.py +2 -2
  17. {statewire-0.6.2 → statewire-0.7.0}/tests/test_meta.py +1 -17
  18. {statewire-0.6.2 → statewire-0.7.0}/tests/test_observer.py +16 -16
  19. statewire-0.7.0/tests/test_start_session.py +116 -0
  20. {statewire-0.6.2 → statewire-0.7.0}/tests/test_state_proxy.py +10 -8
  21. {statewire-0.6.2 → statewire-0.7.0}/tests/test_stream.py +4 -39
  22. {statewire-0.6.2 → statewire-0.7.0}/tests/test_testing.py +7 -3
  23. {statewire-0.6.2 → statewire-0.7.0}/tests/test_writer_lease.py +1 -1
  24. {statewire-0.6.2 → statewire-0.7.0}/tests/test_ws.py +57 -25
  25. statewire-0.6.2/src/statewire/ops.py +0 -110
  26. {statewire-0.6.2 → statewire-0.7.0}/.gitignore +0 -0
  27. {statewire-0.6.2 → statewire-0.7.0}/examples/__init__.py +0 -0
  28. {statewire-0.6.2 → statewire-0.7.0}/src/statewire/__init__.py +0 -0
  29. {statewire-0.6.2 → statewire-0.7.0}/src/statewire/langgraph.py +0 -0
  30. {statewire-0.6.2 → statewire-0.7.0}/src/statewire/state.py +0 -0
  31. {statewire-0.6.2 → statewire-0.7.0}/tests/test_client_ws.py +0 -0
  32. {statewire-0.6.2 → statewire-0.7.0}/tests/test_langgraph.py +0 -0
  33. {statewire-0.6.2 → statewire-0.7.0}/tests/test_lifespan.py +0 -0
  34. {statewire-0.6.2 → statewire-0.7.0}/tests/test_route_auth.py +0 -0
  35. {statewire-0.6.2 → statewire-0.7.0}/tests/test_statewire_hostable.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: statewire
3
- Version: 0.6.2
3
+ Version: 0.7.0
4
4
  Summary: Replicate one JSON object over an SSE op stream + a command endpoint
5
5
  Project-URL: Repository, https://github.com/assistant-ui/harness-sdk
6
6
  License-Expression: MIT
@@ -41,8 +41,7 @@ one JSON object — any State — over envelope streams:
41
41
  `ops` are Immer-style deltas with array paths (object keys as strings, list
42
42
  indices as ints): `replace` sets a value, `add` splices — its final int segment
43
43
  indexes into the parent, so a list parent gains an element and a string parent
44
- gains text at that offset — `remove` deletes, and `event` is transient (never in
45
- snapshots). `ack`
44
+ gains text at that offset — `remove` deletes. `ack`
46
45
  is the cumulative watermark for the issuing client, emitted after the command's
47
46
  effect ops. `res` carries responses (`{"seq", "type": "accepted" | "rejected" |
48
47
  "pending" | "crashed" | "result-unavailable", "message"?, "payload"?}`): the envelope
@@ -112,8 +111,6 @@ are Statewire's own; a subclass that decorates a `@route` onto any of them
112
111
  raises at class-definition time rather than silently shadowing the protocol.
113
112
 
114
113
  `GET /statewire` is the meta endpoint: `{"protocol": 1, "commands": [<names>]}`.
115
- Setting `envelope_ts = True` on the subclass stamps every non-empty envelope
116
- (snapshot included) with `"ts"` (epoch ms) for debuggability.
117
114
 
118
115
  ## Layering
119
116
 
@@ -27,8 +27,7 @@ one JSON object — any State — over envelope streams:
27
27
  `ops` are Immer-style deltas with array paths (object keys as strings, list
28
28
  indices as ints): `replace` sets a value, `add` splices — its final int segment
29
29
  indexes into the parent, so a list parent gains an element and a string parent
30
- gains text at that offset — `remove` deletes, and `event` is transient (never in
31
- snapshots). `ack`
30
+ gains text at that offset — `remove` deletes. `ack`
32
31
  is the cumulative watermark for the issuing client, emitted after the command's
33
32
  effect ops. `res` carries responses (`{"seq", "type": "accepted" | "rejected" |
34
33
  "pending" | "crashed" | "result-unavailable", "message"?, "payload"?}`): the envelope
@@ -98,8 +97,6 @@ are Statewire's own; a subclass that decorates a `@route` onto any of them
98
97
  raises at class-definition time rather than silently shadowing the protocol.
99
98
 
100
99
  `GET /statewire` is the meta endpoint: `{"protocol": 1, "commands": [<names>]}`.
101
- Setting `envelope_ts = True` on the subclass stamps every non-empty envelope
102
- (snapshot included) with `"ts"` (epoch ms) for debuggability.
103
100
 
104
101
  ## Layering
105
102
 
@@ -36,8 +36,6 @@ class Counter(Statewire):
36
36
  )
37
37
  await asyncio.sleep(0.4) # a slow handler makes the optimistic window visible
38
38
  self.state["count"] += 1
39
- if self.state["count"] == MAX_COUNT:
40
- self.emit({"kind": "toast", "text": "the counter is full — reset to keep going"})
41
39
 
42
40
  @command
43
41
  async def reset(self):
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "statewire"
3
- version = "0.6.2"
3
+ version = "0.7.0"
4
4
  description = "Replicate one JSON object over an SSE op stream + a command endpoint"
5
5
  readme = "README.md"
6
6
  license = "MIT"