terrarium-python 0.1.2__tar.gz → 0.2.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.
@@ -32,3 +32,8 @@ docs/vendor/
32
32
  # Tooling caches
33
33
  .ruff_cache/
34
34
  .serena/
35
+
36
+ # shunt deploy secrets — resolved locally and streamed to the host over ssh, never committed.
37
+ secrets/
38
+
39
+ shunt.toml
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: terrarium-python
3
- Version: 0.1.2
3
+ Version: 0.2.0
4
4
  Summary: Async Python client for the Terrarium orchestrator API — manage sandboxed Claude agents and sessions (Claude-Agent-SDK-aligned).
5
5
  Project-URL: Homepage, https://oaisp.github.io/terrarium/
6
6
  Project-URL: Documentation, https://oaisp.github.io/terrarium/sdk/
@@ -3,7 +3,7 @@
3
3
  # [tool.hatch.build.targets.wheel] below — so code reads `from terrarium import ...`
4
4
  # regardless. The bare `terrarium` name was not available on PyPI.
5
5
  name = "terrarium-python"
6
- version = "0.1.2"
6
+ version = "0.2.0"
7
7
  description = "Async Python client for the Terrarium orchestrator API — manage sandboxed Claude agents and sessions (Claude-Agent-SDK-aligned)."
8
8
  readme = "README.md"
9
9
  requires-python = ">=3.10"
@@ -224,6 +224,19 @@ class SessionsResource:
224
224
  body = {"content": content} if isinstance(content, list) else {"text": content}
225
225
  await self._h.json("POST", f"/v1/sessions/{session_id}/messages", json=body)
226
226
 
227
+ async def recover(self, session_id: str) -> dict[str, Any]:
228
+ """Reattach to a session marked terminated whose sandbox is still running.
229
+
230
+ The orchestrator's event stream is a client of the sandbox, not the sandbox itself, so
231
+ it can drop (a Docker daemon restart, a host suspend) while the agent is perfectly
232
+ alive. The orchestrator reattaches automatically now; this is the manual counterpart
233
+ for sessions stranded before that, or past the automatic retry budget.
234
+
235
+ Raises ConflictError (409) when the sandbox really is gone — the transcript remains
236
+ readable, but the conversation cannot be resumed.
237
+ """
238
+ return await self._h.json("POST", f"/v1/sessions/{session_id}/recover")
239
+
227
240
  async def interrupt(self, session_id: str) -> None:
228
241
  await self._h.json("POST", f"/v1/sessions/{session_id}/interrupt")
229
242