withruntime 0.7.2__tar.gz → 0.8.2__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 (183) hide show
  1. {withruntime-0.7.2/withruntime.egg-info → withruntime-0.8.2}/PKG-INFO +86 -2
  2. {withruntime-0.7.2 → withruntime-0.8.2}/README.md +85 -1
  3. {withruntime-0.7.2 → withruntime-0.8.2}/pyproject.toml +1 -1
  4. withruntime-0.8.2/tests/test_blaxel.py +1181 -0
  5. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_client.py +1 -0
  6. withruntime-0.8.2/tests/test_files_upload_parallel.py +76 -0
  7. withruntime-0.8.2/tests/test_http_tls_close.py +118 -0
  8. withruntime-0.8.2/tests/test_stream_exit_close.py +55 -0
  9. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_client.py +20 -5
  10. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_http.py +7 -3
  11. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_client.py +20 -5
  12. withruntime-0.8.2/withruntime/_version.py +1 -0
  13. withruntime-0.8.2/withruntime/blaxel/__init__.py +121 -0
  14. withruntime-0.8.2/withruntime/blaxel/_async_io.py +50 -0
  15. withruntime-0.8.2/withruntime/blaxel/_async_sandbox.py +1651 -0
  16. withruntime-0.8.2/withruntime/blaxel/_core.py +1586 -0
  17. withruntime-0.8.2/withruntime/blaxel/_sync_io.py +61 -0
  18. withruntime-0.8.2/withruntime/blaxel/_sync_sandbox.py +1649 -0
  19. withruntime-0.8.2/withruntime/blaxel/core/__init__.py +4 -0
  20. withruntime-0.8.2/withruntime/blaxel/core/agents.py +3 -0
  21. withruntime-0.8.2/withruntime/blaxel/core/client/__init__.py +3 -0
  22. withruntime-0.8.2/withruntime/blaxel/core/client/api/__init__.py +2 -0
  23. withruntime-0.8.2/withruntime/blaxel/core/client/api/applications/__init__.py +2 -0
  24. withruntime-0.8.2/withruntime/blaxel/core/client/api/applications/list_application_revisions.py +5 -0
  25. withruntime-0.8.2/withruntime/blaxel/core/client/api/compute/__init__.py +2 -0
  26. withruntime-0.8.2/withruntime/blaxel/core/client/api/compute/get_sandbox.py +5 -0
  27. withruntime-0.8.2/withruntime/blaxel/core/client/api/compute/update_sandbox.py +5 -0
  28. withruntime-0.8.2/withruntime/blaxel/core/client/api/functions/__init__.py +2 -0
  29. withruntime-0.8.2/withruntime/blaxel/core/client/api/functions/create_function.py +5 -0
  30. withruntime-0.8.2/withruntime/blaxel/core/client/api/images.py +6 -0
  31. withruntime-0.8.2/withruntime/blaxel/core/client/api/workspaces.py +6 -0
  32. withruntime-0.8.2/withruntime/blaxel/core/client/client.py +3 -0
  33. withruntime-0.8.2/withruntime/blaxel/core/client/models/__init__.py +17 -0
  34. withruntime-0.8.2/withruntime/blaxel/core/client/models/create_job_execution_request.py +3 -0
  35. withruntime-0.8.2/withruntime/blaxel/core/client/models/create_job_execution_request_env.py +3 -0
  36. withruntime-0.8.2/withruntime/blaxel/core/client/models/env.py +3 -0
  37. withruntime-0.8.2/withruntime/blaxel/core/client/models/function.py +3 -0
  38. withruntime-0.8.2/withruntime/blaxel/core/client/models/function_runtime.py +3 -0
  39. withruntime-0.8.2/withruntime/blaxel/core/client/models/function_spec.py +3 -0
  40. withruntime-0.8.2/withruntime/blaxel/core/client/models/metadata.py +3 -0
  41. withruntime-0.8.2/withruntime/blaxel/core/client/models/workspace.py +3 -0
  42. withruntime-0.8.2/withruntime/blaxel/core/client/types.py +3 -0
  43. withruntime-0.8.2/withruntime/blaxel/core/common.py +3 -0
  44. withruntime-0.8.2/withruntime/blaxel/core/drive.py +3 -0
  45. withruntime-0.8.2/withruntime/blaxel/core/jobs.py +6 -0
  46. withruntime-0.8.2/withruntime/blaxel/core/sandbox/__init__.py +9 -0
  47. withruntime-0.8.2/withruntime/blaxel/core/sandbox/types.py +6 -0
  48. withruntime-0.8.2/withruntime/blaxel/crewai.py +3 -0
  49. withruntime-0.8.2/withruntime/blaxel/googleadk.py +3 -0
  50. withruntime-0.8.2/withruntime/blaxel/langgraph.py +3 -0
  51. withruntime-0.8.2/withruntime/blaxel/livekit.py +3 -0
  52. withruntime-0.8.2/withruntime/blaxel/llamaindex.py +3 -0
  53. withruntime-0.8.2/withruntime/blaxel/openai.py +3 -0
  54. withruntime-0.8.2/withruntime/blaxel/pydantic.py +3 -0
  55. withruntime-0.8.2/withruntime/blaxel/telemetry.py +2 -0
  56. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/inspect_ai.py +2 -1
  57. {withruntime-0.7.2 → withruntime-0.8.2/withruntime.egg-info}/PKG-INFO +86 -2
  58. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime.egg-info/SOURCES.txt +47 -0
  59. withruntime-0.7.2/withruntime/_version.py +0 -1
  60. {withruntime-0.7.2 → withruntime-0.8.2}/LICENSE +0 -0
  61. {withruntime-0.7.2 → withruntime-0.8.2}/setup.cfg +0 -0
  62. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_account_errors.py +0 -0
  63. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_async_stream_cleanup.py +0 -0
  64. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_audit.py +0 -0
  65. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_billing.py +0 -0
  66. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_capacity_wait.py +0 -0
  67. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_daytona.py +0 -0
  68. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_deepagents.py +0 -0
  69. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_e2b_code_interpreter.py +0 -0
  70. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_e2b_sandbox.py +0 -0
  71. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_eval_sandbox.py +0 -0
  72. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_exec_stream.py +0 -0
  73. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_files_download.py +0 -0
  74. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_files_mode.py +0 -0
  75. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_harbor.py +0 -0
  76. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_identity_token.py +0 -0
  77. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_images_v2.py +0 -0
  78. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_images_volumes_interpreter.py +0 -0
  79. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_inspect_ai.py +0 -0
  80. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_late_answer.py +0 -0
  81. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_lifecycle_settings.py +0 -0
  82. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_limits.py +0 -0
  83. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_mounts.py +0 -0
  84. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_network_funding.py +0 -0
  85. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_network_products.py +0 -0
  86. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_observability.py +0 -0
  87. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_openai_agents.py +0 -0
  88. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_previews_network_desktop.py +0 -0
  89. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_proxy.py +0 -0
  90. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_referrals.py +0 -0
  91. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_secrets.py +0 -0
  92. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_snapshot_after_fork.py +0 -0
  93. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_sso.py +0 -0
  94. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_switching.py +0 -0
  95. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_tools.py +0 -0
  96. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_unpack.py +0 -0
  97. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_vercel.py +0 -0
  98. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_volume_backups.py +0 -0
  99. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_wake_awake.py +0 -0
  100. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_wallet.py +0 -0
  101. {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_watch.py +0 -0
  102. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/__init__.py +0 -0
  103. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/__init__.py +0 -0
  104. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/audit.py +0 -0
  105. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/billing.py +0 -0
  106. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/desktop.py +0 -0
  107. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/images.py +0 -0
  108. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/interpreter.py +0 -0
  109. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/limits.py +0 -0
  110. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/mcp.py +0 -0
  111. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/mounts.py +0 -0
  112. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/network.py +0 -0
  113. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/network_products.py +0 -0
  114. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/observability.py +0 -0
  115. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/previews.py +0 -0
  116. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/referrals.py +0 -0
  117. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/secrets.py +0 -0
  118. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/sso.py +0 -0
  119. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/switching.py +0 -0
  120. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/volumes.py +0 -0
  121. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/watch.py +0 -0
  122. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_clock.py +0 -0
  123. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_connection.py +0 -0
  124. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_errors.py +0 -0
  125. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_eval_sandbox.py +0 -0
  126. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_proxy.py +0 -0
  127. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/__init__.py +0 -0
  128. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/audit.py +0 -0
  129. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/billing.py +0 -0
  130. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/desktop.py +0 -0
  131. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/images.py +0 -0
  132. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/interpreter.py +0 -0
  133. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/limits.py +0 -0
  134. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/mcp.py +0 -0
  135. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/mounts.py +0 -0
  136. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/network.py +0 -0
  137. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/network_products.py +0 -0
  138. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/observability.py +0 -0
  139. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/previews.py +0 -0
  140. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/referrals.py +0 -0
  141. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/secrets.py +0 -0
  142. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/sso.py +0 -0
  143. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/switching.py +0 -0
  144. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/volumes.py +0 -0
  145. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/watch.py +0 -0
  146. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_tunnel.py +0 -0
  147. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_unpack.py +0 -0
  148. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_ws.py +0 -0
  149. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/daytona/__init__.py +0 -0
  150. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/daytona/_async_daytona.py +0 -0
  151. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/daytona/_async_io.py +0 -0
  152. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/daytona/_core.py +0 -0
  153. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/daytona/_sync_daytona.py +0 -0
  154. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/daytona/_sync_io.py +0 -0
  155. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/deepagents.py +0 -0
  156. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/__init__.py +0 -0
  157. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/_async_io.py +0 -0
  158. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/_async_sandbox.py +0 -0
  159. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/_core.py +0 -0
  160. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/_sync_io.py +0 -0
  161. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/_sync_sandbox.py +0 -0
  162. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/code_interpreter/__init__.py +0 -0
  163. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/code_interpreter/_async_ci.py +0 -0
  164. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/code_interpreter/_models.py +0 -0
  165. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/code_interpreter/_sync_ci.py +0 -0
  166. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/harbor.py +0 -0
  167. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/openai_agents.py +0 -0
  168. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/tools.py +0 -0
  169. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/__init__.py +0 -0
  170. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/_async_io.py +0 -0
  171. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/_async_sandbox.py +0 -0
  172. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/_core.py +0 -0
  173. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/_sync_io.py +0 -0
  174. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/_sync_sandbox.py +0 -0
  175. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/api.py +0 -0
  176. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/sandbox/__init__.py +0 -0
  177. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/sandbox/sync.py +0 -0
  178. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/wallet.py +0 -0
  179. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/webhooks.py +0 -0
  180. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime.egg-info/dependency_links.txt +0 -0
  181. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime.egg-info/entry_points.txt +0 -0
  182. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime.egg-info/requires.txt +0 -0
  183. {withruntime-0.7.2 → withruntime-0.8.2}/withruntime.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: withruntime
3
- Version: 0.7.2
3
+ Version: 0.8.2
4
4
  Summary: Runtime Cloud: one client (sync and async) for every Runtime product. Sandboxes first.
5
5
  License: Apache-2.0
6
6
  Project-URL: Homepage, https://withruntime.com
@@ -73,7 +73,10 @@ list, glob, stat, move, remove, upload and download directories), `pause`,
73
73
  `wake`, `extend`, `update`, `keep_alive`, `fork` and `snapshot`, and the
74
74
  `interpreter`, `network`, `previews` and `desktop` products. A paused sandbox
75
75
  also wakes by itself on the next call, and `Sandbox.get_or_create(name)` returns
76
- the sandbox with that name or creates it. The client has `sandboxes`, `images`,
76
+ the sandbox with that name or creates it. A sandbox pauses itself after 60 seconds
77
+ with nothing happening in it, keeping its memory and processes, so an
78
+ idle sandbox costs no compute; `idle_pause_seconds` sets 10 to 86,400, or 0 for
79
+ never. The client has `sandboxes`, `images`,
77
80
  `volumes`, `snapshots`, `limits`, `feedback` and `support`;
78
81
  `runtime.limits.get()` (0.3.1 and later) says whether the key is read-only and
79
82
  what its agent may still spend today. Every write carries an
@@ -133,6 +136,87 @@ use instead. The sync modules are generated from the async ones by
133
136
  `scripts/generate_dropin_sync.py`. `DAYTONA.md` and `VERCEL.md` in the
134
137
  JavaScript package list every mapping and gap.
135
138
 
139
+ ## Code written for Blaxel
140
+
141
+ `withruntime.blaxel` runs code written for Blaxel's Python SDK (`blaxel`
142
+ 0.4.11) on Runtime. Change the import and set `RUNTIME_API_KEY`, or run
143
+ `npx withruntime login` once:
144
+
145
+ ```python no-run
146
+ from withruntime.blaxel import SandboxInstance # was: from blaxel.core import SandboxInstance
147
+ from withruntime.blaxel import SyncSandboxInstance # was: from blaxel.core import SyncSandboxInstance
148
+ ```
149
+
150
+ `withruntime.blaxel.core` holds the same names, so replacing `blaxel.` with
151
+ `withruntime.blaxel.` works too. A Runtime key in `BL_API_KEY` is used; a
152
+ Blaxel key is never sent anywhere.
153
+
154
+ How it maps:
155
+
156
+ - **Sandboxes.** `create`, `create_if_not_exists` (one sandbox when two calls
157
+ race), `get`, `get_by_external_id`, `list`, `delete`, `fork`, `snapshots` and
158
+ the `update_*` calls work. `memory` is kept, with one vCPU for every 2048 MB.
159
+ Blaxel's general templates (`blaxel/base-image`, `py-app`, `ts-app`, `node`,
160
+ `jupyter-server`, `docker-in-sandbox`) run on Runtime's image. Any other
161
+ image `ns/name:tag` starts from the ready Runtime image `ns-name:tag`
162
+ (every `/` becomes `-`; the tag is `latest` when none is given), so the
163
+ code keeps Blaxel's image string. A missing one raises `NotSupportedError`
164
+ with the build command, for example `npx withruntime image build
165
+ --dockerfile Dockerfile --name my-company-agent-image -t
166
+ my-company-agent-image:latest`. Volumes mount Runtime volumes of the same
167
+ name. On the free trial a sandbox has at most 4096 MB of memory (2 vCPUs).
168
+ - **Standby.** A sandbox pauses after a minute with no call (Blaxel: about 15
169
+ seconds). It keeps its memory and processes, and wakes on the next command,
170
+ file call or preview visit. `archive` pauses it and keeps its memory too.
171
+ A lease in use is renewed, so a long command is not paused at the hour.
172
+ `keep_alive` raises the idle pause to the process's time limit, or turns it
173
+ off for a process with none. The first call from any client that finds no
174
+ `keep_alive` process running gives the old idle pause back.
175
+ - **How long it is kept.** A paused sandbox with no `ttl` or `lifecycle` is
176
+ kept 365 days. Blaxel keeps it until you delete it. A limit is rounded up to
177
+ whole days of pause. A limit of an hour or less that counts from creation
178
+ also ends the sandbox at that time. On the free trial a paused sandbox is kept
179
+ seven days, the most Blaxel's first tier keeps one.
180
+ - **Envs** reach every process, from any client: they are kept on the
181
+ sandbox, and a process's own `env` wins.
182
+ - **Paths.** `/blaxel`, Blaxel's working directory and `HOME`, is
183
+ `/workspace`. Relative paths and `~` start there.
184
+ - **Processes.** You can find a process by name from any client, as long as
185
+ Runtime still has its record. Runtime keeps the running processes and the
186
+ last 16 that ended.
187
+ - **Previews** are Runtime previews of each port. A private preview's
188
+ `tokens.create(expires_at)` gives a token, which works as Blaxel's
189
+ `X-Blaxel-Preview-Token` header or `bl_preview_token` address parameter.
190
+ `fetch(port)` uses a private preview for you.
191
+ - **Code interpreter.** `CodeInterpreter.run_code` and `create_code_context`
192
+ run on Runtime's interpreter and return Blaxel's result classes.
193
+ - **Errors.** Errors keep Blaxel's classes: `SandboxAPIError`,
194
+ `ResponseError` and `SnapshotAPIError`. Each also carries Runtime's `code`,
195
+ `hint` and `request_id`.
196
+ - **Runtime fields.** `runtime_create={...}` passes Runtime's own create
197
+ fields, for example `{"funding": "trial"}`. `sandbox.withruntime` is the
198
+ Runtime sandbox underneath.
199
+
200
+ Differences you can hit:
201
+
202
+ - Commands run as root, as on Blaxel, with the sandbox's `PATH` and `HOME`
203
+ (`/workspace`). File calls act as the sandbox user and fall back to `sudo`
204
+ where only root may: they reach files a root process made, including private
205
+ ones, and a file they write is the sandbox user's.
206
+ - A key sees the sandboxes it made, and another key's answer 404, unless an
207
+ owner or admin makes the key account-wide, as a Blaxel workspace key is
208
+ ([teams](https://withruntime.com/docs/teams#keys-in-a-team)).
209
+ - Public previews need a paid sandbox.
210
+ - A process's `pid` is Runtime's process id, not an operating-system number.
211
+
212
+ These raise `NotSupportedError` before anything happens, naming what to use:
213
+ regions outside the US, read-only and ephemeral volumes, drives, `extra_args`
214
+ other than `iptables`, egress and subnet settings, preview headers, custom
215
+ domains and preview expiry, restoring a snapshot in place (fork from it
216
+ instead), sessions, codegen, `system`, schedules, and Blaxel's agents, models,
217
+ tools, jobs and applications. The sync module is generated from the async one
218
+ by `scripts/generate_dropin_sync.py`.
219
+
136
220
  ## Agent frameworks
137
221
 
138
222
  `withruntime.openai_agents` is a sandbox client for the OpenAI Agents SDK's
@@ -50,7 +50,10 @@ list, glob, stat, move, remove, upload and download directories), `pause`,
50
50
  `wake`, `extend`, `update`, `keep_alive`, `fork` and `snapshot`, and the
51
51
  `interpreter`, `network`, `previews` and `desktop` products. A paused sandbox
52
52
  also wakes by itself on the next call, and `Sandbox.get_or_create(name)` returns
53
- the sandbox with that name or creates it. The client has `sandboxes`, `images`,
53
+ the sandbox with that name or creates it. A sandbox pauses itself after 60 seconds
54
+ with nothing happening in it, keeping its memory and processes, so an
55
+ idle sandbox costs no compute; `idle_pause_seconds` sets 10 to 86,400, or 0 for
56
+ never. The client has `sandboxes`, `images`,
54
57
  `volumes`, `snapshots`, `limits`, `feedback` and `support`;
55
58
  `runtime.limits.get()` (0.3.1 and later) says whether the key is read-only and
56
59
  what its agent may still spend today. Every write carries an
@@ -110,6 +113,87 @@ use instead. The sync modules are generated from the async ones by
110
113
  `scripts/generate_dropin_sync.py`. `DAYTONA.md` and `VERCEL.md` in the
111
114
  JavaScript package list every mapping and gap.
112
115
 
116
+ ## Code written for Blaxel
117
+
118
+ `withruntime.blaxel` runs code written for Blaxel's Python SDK (`blaxel`
119
+ 0.4.11) on Runtime. Change the import and set `RUNTIME_API_KEY`, or run
120
+ `npx withruntime login` once:
121
+
122
+ ```python no-run
123
+ from withruntime.blaxel import SandboxInstance # was: from blaxel.core import SandboxInstance
124
+ from withruntime.blaxel import SyncSandboxInstance # was: from blaxel.core import SyncSandboxInstance
125
+ ```
126
+
127
+ `withruntime.blaxel.core` holds the same names, so replacing `blaxel.` with
128
+ `withruntime.blaxel.` works too. A Runtime key in `BL_API_KEY` is used; a
129
+ Blaxel key is never sent anywhere.
130
+
131
+ How it maps:
132
+
133
+ - **Sandboxes.** `create`, `create_if_not_exists` (one sandbox when two calls
134
+ race), `get`, `get_by_external_id`, `list`, `delete`, `fork`, `snapshots` and
135
+ the `update_*` calls work. `memory` is kept, with one vCPU for every 2048 MB.
136
+ Blaxel's general templates (`blaxel/base-image`, `py-app`, `ts-app`, `node`,
137
+ `jupyter-server`, `docker-in-sandbox`) run on Runtime's image. Any other
138
+ image `ns/name:tag` starts from the ready Runtime image `ns-name:tag`
139
+ (every `/` becomes `-`; the tag is `latest` when none is given), so the
140
+ code keeps Blaxel's image string. A missing one raises `NotSupportedError`
141
+ with the build command, for example `npx withruntime image build
142
+ --dockerfile Dockerfile --name my-company-agent-image -t
143
+ my-company-agent-image:latest`. Volumes mount Runtime volumes of the same
144
+ name. On the free trial a sandbox has at most 4096 MB of memory (2 vCPUs).
145
+ - **Standby.** A sandbox pauses after a minute with no call (Blaxel: about 15
146
+ seconds). It keeps its memory and processes, and wakes on the next command,
147
+ file call or preview visit. `archive` pauses it and keeps its memory too.
148
+ A lease in use is renewed, so a long command is not paused at the hour.
149
+ `keep_alive` raises the idle pause to the process's time limit, or turns it
150
+ off for a process with none. The first call from any client that finds no
151
+ `keep_alive` process running gives the old idle pause back.
152
+ - **How long it is kept.** A paused sandbox with no `ttl` or `lifecycle` is
153
+ kept 365 days. Blaxel keeps it until you delete it. A limit is rounded up to
154
+ whole days of pause. A limit of an hour or less that counts from creation
155
+ also ends the sandbox at that time. On the free trial a paused sandbox is kept
156
+ seven days, the most Blaxel's first tier keeps one.
157
+ - **Envs** reach every process, from any client: they are kept on the
158
+ sandbox, and a process's own `env` wins.
159
+ - **Paths.** `/blaxel`, Blaxel's working directory and `HOME`, is
160
+ `/workspace`. Relative paths and `~` start there.
161
+ - **Processes.** You can find a process by name from any client, as long as
162
+ Runtime still has its record. Runtime keeps the running processes and the
163
+ last 16 that ended.
164
+ - **Previews** are Runtime previews of each port. A private preview's
165
+ `tokens.create(expires_at)` gives a token, which works as Blaxel's
166
+ `X-Blaxel-Preview-Token` header or `bl_preview_token` address parameter.
167
+ `fetch(port)` uses a private preview for you.
168
+ - **Code interpreter.** `CodeInterpreter.run_code` and `create_code_context`
169
+ run on Runtime's interpreter and return Blaxel's result classes.
170
+ - **Errors.** Errors keep Blaxel's classes: `SandboxAPIError`,
171
+ `ResponseError` and `SnapshotAPIError`. Each also carries Runtime's `code`,
172
+ `hint` and `request_id`.
173
+ - **Runtime fields.** `runtime_create={...}` passes Runtime's own create
174
+ fields, for example `{"funding": "trial"}`. `sandbox.withruntime` is the
175
+ Runtime sandbox underneath.
176
+
177
+ Differences you can hit:
178
+
179
+ - Commands run as root, as on Blaxel, with the sandbox's `PATH` and `HOME`
180
+ (`/workspace`). File calls act as the sandbox user and fall back to `sudo`
181
+ where only root may: they reach files a root process made, including private
182
+ ones, and a file they write is the sandbox user's.
183
+ - A key sees the sandboxes it made, and another key's answer 404, unless an
184
+ owner or admin makes the key account-wide, as a Blaxel workspace key is
185
+ ([teams](https://withruntime.com/docs/teams#keys-in-a-team)).
186
+ - Public previews need a paid sandbox.
187
+ - A process's `pid` is Runtime's process id, not an operating-system number.
188
+
189
+ These raise `NotSupportedError` before anything happens, naming what to use:
190
+ regions outside the US, read-only and ephemeral volumes, drives, `extra_args`
191
+ other than `iptables`, egress and subnet settings, preview headers, custom
192
+ domains and preview expiry, restoring a snapshot in place (fork from it
193
+ instead), sessions, codegen, `system`, schedules, and Blaxel's agents, models,
194
+ tools, jobs and applications. The sync module is generated from the async one
195
+ by `scripts/generate_dropin_sync.py`.
196
+
113
197
  ## Agent frameworks
114
198
 
115
199
  `withruntime.openai_agents` is a sandbox client for the OpenAI Agents SDK's
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "withruntime"
7
- version = "0.7.2"
7
+ version = "0.8.2"
8
8
  description = "Runtime Cloud: one client (sync and async) for every Runtime product. Sandboxes first."
9
9
  readme = "README.md"
10
10
  license = { text = "Apache-2.0" }