harness-sdk-python 0.29.0__py3-none-any.whl → 0.29.2__py3-none-any.whl

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.
harness_sdk/deepagents.py CHANGED
@@ -1,7 +1,8 @@
1
1
  """DeepagentsMessages: the ``messages`` slice of a Statewire host, projected
2
2
  from a langgraph checkpointer in the deepagents dialect. The checkpointer is
3
3
  the source of truth and the wire state is its projection, restamped with
4
- ``branch: {id, siblings}`` metadata after every ingest. A rewind restores the
4
+ ``branch: {id, siblings}`` metadata after every ingest; ephemeral overlay
5
+ entries carry ``ephemeral: true`` instead. A rewind restores the
5
6
  projection from the target message's anchor checkpoint; a branch switch clones
6
7
  the target branch's tip as the checkpointer's latest checkpoint, so resumption
7
8
  and reboot both land on the switched world.
@@ -243,7 +244,7 @@ class DeepagentsMessages:
243
244
  return snapshot
244
245
 
245
246
  def upsert_ephemeral_message(self, message: dict[str, Any]) -> None:
246
- """Render an in-flight ``{id, role, text}`` entry in ``state["messages"]``; an ``append_messages`` of the same id replaces it durably."""
247
+ """Render an in-flight ``{id, role, text}`` entry in ``state["messages"]`` tagged ``ephemeral: true``; an ``append_messages`` of the same id replaces it durably."""
247
248
  if message["role"] not in ("user", "assistant"):
248
249
  raise ValueError(f"unsupported message role: {message['role']!r}")
249
250
  if message["id"] not in self._ephemeral and any(
@@ -280,6 +281,8 @@ class DeepagentsMessages:
280
281
  stamped.append({**message, "branch": {"id": branch, "siblings": siblings}})
281
282
  durable = {message["id"] for message in stamped}
282
283
  stamped.extend(
283
- entry for id_, entry in self._ephemeral.items() if id_ not in durable
284
+ {**entry, "ephemeral": True}
285
+ for id_, entry in self._ephemeral.items()
286
+ if id_ not in durable
284
287
  )
285
288
  self._replace(stamped)
harness_sdk/voice.py CHANGED
@@ -13,11 +13,13 @@ status}`` — the SDP answer rides only the command's result payload
13
13
  ``{answer}``. The session is bound to the issuing client's connection: ``voice/end`` from the owner, a
14
14
  provider ``closed`` event, or a connection drop ends it. Provider turn
15
15
  events render live in ``state["messages"]`` through
16
- ``Host.upsert_ephemeral_message`` (message id = turn id); each completed
16
+ ``Host.upsert_ephemeral_message`` (message id = turn id), tagged
17
+ ``ephemeral: true`` on the wire; each completed
17
18
  turn commits through ``Host.commit_voice_turns`` (serialized, in
18
19
  done-order) and the durable entry replaces the ephemeral one under the
19
20
  same id, a failed commit keeps its turns for the next flush; session end
20
- flushes the remaining done turns and drops in-progress turns.
21
+ flushes the remaining done turns, then commits in-progress turns with
22
+ their partial text; in-progress turns with no text yet are dropped.
21
23
 
22
24
  Rejections: ``voice-active`` (a session is already live), ``no-voice``
23
25
  (no voice manager declared, or ``voice/end`` with no session),
@@ -188,6 +190,10 @@ class VoiceManager(Tray):
188
190
  await provider.close()
189
191
  except Exception:
190
192
  logger.exception("voice provider close failed for session %r", self.id)
193
+ self._turns.sort(key=lambda turn: not turn["done"])
194
+ for turn in self._turns:
195
+ if turn["text"]:
196
+ turn["done"] = True
191
197
  await self._flush()
192
198
  turns, self._turns = self._turns, []
193
199
  for turn in turns:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: harness-sdk-python
3
- Version: 0.29.0
3
+ Version: 0.29.2
4
4
  Summary: RunManager: the harness-sdk runs subsystem for Python Statewire hosts
5
5
  Project-URL: Repository, https://github.com/assistant-ui/harness-sdk
6
6
  License-Expression: MIT
@@ -1,10 +1,10 @@
1
1
  harness_sdk/__init__.py,sha256=N9gOUKqe0_eM7cIA9sfA_lH1FBw1MN8U-zerwGAPVHE,1094
2
2
  harness_sdk/checkpoints.py,sha256=L02l1IyLDj2b-GD7_HGrck7uenALeI4kg8yJSzoNVmc,25999
3
- harness_sdk/deepagents.py,sha256=nnpJ65NeVXcpZNoFOSq6brVYrKdEqSjWgf6wz_WlHiw,12145
3
+ harness_sdk/deepagents.py,sha256=cMipZ9ndZ3zUR3-VqOMf5CiPVMmym74ytIeguQAjYZo,12280
4
4
  harness_sdk/fenced_postgres.py,sha256=hbbrMR1WaqrHTNgd4wFrXfRrzQFGnyim-c8nZXgwWp4,13235
5
5
  harness_sdk/linear_thread.py,sha256=laDRXKLFsMlyWS4snqNAM6t38wO26gevLWXRNivhHSM,1810
6
6
  harness_sdk/run_manager.py,sha256=CbY_4dpFeqGx3kJNI1ffsu3uIvzVc-Tc1UB6Nr9SiHY,77654
7
- harness_sdk/voice.py,sha256=RstnsxuMdAatLsfFI1EWTk2HVix-FRFwD4YuMC5rhB4,15589
8
- harness_sdk_python-0.29.0.dist-info/METADATA,sha256=51Q4tAR39PPzgQRJ2u_cMap7bfcppOZjgfEAR8KSImM,2200
9
- harness_sdk_python-0.29.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
10
- harness_sdk_python-0.29.0.dist-info/RECORD,,
7
+ harness_sdk/voice.py,sha256=oVmfxltjyV9ylATIpAszaM6MOS9TC3Haksgf6I7c4v8,15863
8
+ harness_sdk_python-0.29.2.dist-info/METADATA,sha256=-4c6JdBIpkP6td3WlIcpnbUOX9ntoTM5dG6vcwoD55k,2200
9
+ harness_sdk_python-0.29.2.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
10
+ harness_sdk_python-0.29.2.dist-info/RECORD,,