withruntime 0.15.0__tar.gz → 0.16.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 (404) hide show
  1. {withruntime-0.15.0 → withruntime-0.16.0}/PKG-INFO +1 -1
  2. {withruntime-0.15.0 → withruntime-0.16.0}/pyproject.toml +1 -1
  3. withruntime-0.16.0/tests/test_exec_user.py +92 -0
  4. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_identity_token.py +27 -4
  5. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_package_typing.py +1 -1
  6. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/__init__.py +54 -8
  7. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_client.py +22 -9
  8. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_client.py +22 -9
  9. withruntime-0.16.0/withruntime/_version.py +1 -0
  10. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime.egg-info/PKG-INFO +1 -1
  11. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime.egg-info/SOURCES.txt +1 -0
  12. withruntime-0.15.0/withruntime/_version.py +0 -1
  13. {withruntime-0.15.0 → withruntime-0.16.0}/LICENSE +0 -0
  14. {withruntime-0.15.0 → withruntime-0.16.0}/README.md +0 -0
  15. {withruntime-0.15.0 → withruntime-0.16.0}/setup.cfg +0 -0
  16. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_account_errors.py +0 -0
  17. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_answer_start.py +0 -0
  18. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_async_stream_cleanup.py +0 -0
  19. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_audit.py +0 -0
  20. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_billing.py +0 -0
  21. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_blaxel.py +0 -0
  22. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_blaxel_0_4_17.py +0 -0
  23. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_blaxel_0_4_18.py +0 -0
  24. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_blaxel_create_timeout.py +0 -0
  25. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_blaxel_wait_deadline.py +0 -0
  26. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_browser.py +0 -0
  27. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_capacity_wait.py +0 -0
  28. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_live.py +0 -0
  29. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_modal_deadline_errors.py +0 -0
  30. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_new_providers.py +0 -0
  31. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_prime_contract.py +0 -0
  32. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_prime_process_lifecycle.py +0 -0
  33. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_prime_validation.py +0 -0
  34. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_python_disk_snapshots.py +0 -0
  35. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_python_e2b_deadline.py +0 -0
  36. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_python_e2b_pty.py +0 -0
  37. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_python_e2b_stream.py +0 -0
  38. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_python_e2b_watch.py +0 -0
  39. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_python_interpreter_deadline.py +0 -0
  40. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_python_modal.py +0 -0
  41. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_python_morph.py +0 -0
  42. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_python_official.py +0 -0
  43. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_python_pins.py +0 -0
  44. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_python_processes.py +0 -0
  45. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_python_request_scope.py +0 -0
  46. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_python_runloop.py +0 -0
  47. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_python_shell.py +0 -0
  48. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_python_snapshot_capture.py +0 -0
  49. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_python_sprites.py +0 -0
  50. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_compat_router.py +0 -0
  51. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_customer_usage.py +0 -0
  52. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_daytona.py +0 -0
  53. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_daytona_0_223_1.py +0 -0
  54. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_daytona_0_224_1.py +0 -0
  55. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_daytona_create_cleanup.py +0 -0
  56. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_daytona_create_options.py +0 -0
  57. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_daytona_download_labels.py +0 -0
  58. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_daytona_refusals_lifted.py +0 -0
  59. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_deepagents.py +0 -0
  60. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_e2b_2_55.py +0 -0
  61. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_e2b_code_interpreter.py +0 -0
  62. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_e2b_connection_cap.py +0 -0
  63. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_e2b_exports.py +0 -0
  64. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_e2b_fork_validation.py +0 -0
  65. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_e2b_sandbox.py +0 -0
  66. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_e2b_upstream.py +0 -0
  67. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_e2b_watch.py +0 -0
  68. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_embed_and_webhook_watch.py +0 -0
  69. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_eval_sandbox.py +0 -0
  70. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_exec_stream.py +0 -0
  71. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_exec_stream_names.py +0 -0
  72. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_file_archives.py +0 -0
  73. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_files_download.py +0 -0
  74. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_files_mode.py +0 -0
  75. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_files_upload_parallel.py +0 -0
  76. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_files_write_lost_body.py +0 -0
  77. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_harbor.py +0 -0
  78. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_http_tls_close.py +0 -0
  79. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_image_delete_by_name.py +0 -0
  80. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_images_v2.py +0 -0
  81. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_images_volumes_interpreter.py +0 -0
  82. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_inspect_ai.py +0 -0
  83. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_interface_contract.py +0 -0
  84. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_jobs.py +0 -0
  85. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_late_answer.py +0 -0
  86. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_lifecycle_settings.py +0 -0
  87. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_limits.py +0 -0
  88. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_machine_engine.py +0 -0
  89. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_modal_1_6_2.py +0 -0
  90. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_modal_dropin.py +0 -0
  91. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_mounts.py +0 -0
  92. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_network_funding.py +0 -0
  93. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_network_products.py +0 -0
  94. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_observability.py +0 -0
  95. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_openai_agents.py +0 -0
  96. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_out_of_memory.py +0 -0
  97. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_previews_network_desktop.py +0 -0
  98. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_prime_0_4_5.py +0 -0
  99. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_private_network.py +0 -0
  100. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_process_deadline.py +0 -0
  101. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_process_input.py +0 -0
  102. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_process_object.py +0 -0
  103. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_process_output.py +0 -0
  104. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_process_write_backpressure.py +0 -0
  105. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_product_aliases.py +0 -0
  106. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_proxy.py +0 -0
  107. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_referrals.py +0 -0
  108. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_replayed_create_message.py +0 -0
  109. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_runloop_stream_cleanup.py +0 -0
  110. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_runloop_v2.py +0 -0
  111. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_sandbox_origin.py +0 -0
  112. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_sandbox_sessions.py +0 -0
  113. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_sandboxes_delete_all.py +0 -0
  114. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_sandboxes_stop_all.py +0 -0
  115. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_saved_connection.py +0 -0
  116. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_secrets.py +0 -0
  117. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_signed_requests.py +0 -0
  118. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_snapshot_after_fork.py +0 -0
  119. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_snapshot_recovery.py +0 -0
  120. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_sso.py +0 -0
  121. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_start_report_kept.py +0 -0
  122. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_stream_cut_short.py +0 -0
  123. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_stream_exit_close.py +0 -0
  124. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_switch_image.py +0 -0
  125. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_switching.py +0 -0
  126. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_tailscale.py +0 -0
  127. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_tools.py +0 -0
  128. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_transport_body_recovery.py +0 -0
  129. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_transport_connection_limits.py +0 -0
  130. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_transport_never_sent.py +0 -0
  131. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_unpack.py +0 -0
  132. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_upload_deadline.py +0 -0
  133. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_vercel.py +0 -0
  134. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_vercel_create_validation.py +0 -0
  135. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_vercel_disk_snapshot.py +0 -0
  136. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_vercel_refusals_lifted.py +0 -0
  137. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_volume_backups.py +0 -0
  138. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_volume_operations.py +0 -0
  139. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_wake_awake.py +0 -0
  140. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_wallet.py +0 -0
  141. {withruntime-0.15.0 → withruntime-0.16.0}/tests/test_watch.py +0 -0
  142. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_api_defaults.py +0 -0
  143. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/__init__.py +0 -0
  144. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/audit.py +0 -0
  145. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/billing.py +0 -0
  146. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/browser.py +0 -0
  147. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/desktop.py +0 -0
  148. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/images.py +0 -0
  149. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/interpreter.py +0 -0
  150. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/jobs.py +0 -0
  151. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/limits.py +0 -0
  152. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/mcp.py +0 -0
  153. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/mounts.py +0 -0
  154. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/network.py +0 -0
  155. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/network_products.py +0 -0
  156. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/observability.py +0 -0
  157. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/previews.py +0 -0
  158. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/private_network.py +0 -0
  159. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/referrals.py +0 -0
  160. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/secrets.py +0 -0
  161. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/signed_requests.py +0 -0
  162. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/sso.py +0 -0
  163. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/switching.py +0 -0
  164. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/tailscale.py +0 -0
  165. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/volumes.py +0 -0
  166. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_async_products/watch.py +0 -0
  167. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_clock.py +0 -0
  168. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_compat.py +0 -0
  169. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_compat_lease.py +0 -0
  170. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_compat_lifecycle.py +0 -0
  171. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_compat_shell.py +0 -0
  172. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_connection.py +0 -0
  173. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_errors.py +0 -0
  174. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_eval_sandbox.py +0 -0
  175. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_http.py +0 -0
  176. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_proxy.py +0 -0
  177. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_renamed.py +0 -0
  178. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_request_scope.py +0 -0
  179. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/__init__.py +0 -0
  180. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/audit.py +0 -0
  181. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/billing.py +0 -0
  182. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/browser.py +0 -0
  183. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/desktop.py +0 -0
  184. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/images.py +0 -0
  185. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/interpreter.py +0 -0
  186. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/jobs.py +0 -0
  187. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/limits.py +0 -0
  188. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/mcp.py +0 -0
  189. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/mounts.py +0 -0
  190. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/network.py +0 -0
  191. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/network_products.py +0 -0
  192. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/observability.py +0 -0
  193. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/previews.py +0 -0
  194. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/private_network.py +0 -0
  195. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/referrals.py +0 -0
  196. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/secrets.py +0 -0
  197. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/signed_requests.py +0 -0
  198. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/sso.py +0 -0
  199. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/switching.py +0 -0
  200. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/tailscale.py +0 -0
  201. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/volumes.py +0 -0
  202. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_sync_products/watch.py +0 -0
  203. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_tunnel.py +0 -0
  204. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_unpack.py +0 -0
  205. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/_ws.py +0 -0
  206. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/__init__.py +0 -0
  207. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/_async_io.py +0 -0
  208. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/_async_sandbox.py +0 -0
  209. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/_core.py +0 -0
  210. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/_sync_io.py +0 -0
  211. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/_sync_sandbox.py +0 -0
  212. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/__init__.py +0 -0
  213. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/agents.py +0 -0
  214. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/__init__.py +0 -0
  215. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/api/__init__.py +0 -0
  216. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/api/applications/__init__.py +0 -0
  217. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/api/applications/list_application_revisions.py +0 -0
  218. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/api/compute/__init__.py +0 -0
  219. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/api/compute/get_sandbox.py +0 -0
  220. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/api/compute/update_sandbox.py +0 -0
  221. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/api/functions/__init__.py +0 -0
  222. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/api/functions/create_function.py +0 -0
  223. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/api/images.py +0 -0
  224. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/api/workspaces.py +0 -0
  225. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/client.py +0 -0
  226. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/models/__init__.py +0 -0
  227. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/models/create_job_execution_request.py +0 -0
  228. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/models/create_job_execution_request_env.py +0 -0
  229. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/models/env.py +0 -0
  230. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/models/function.py +0 -0
  231. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/models/function_runtime.py +0 -0
  232. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/models/function_spec.py +0 -0
  233. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/models/metadata.py +0 -0
  234. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/models/pagination_meta.py +0 -0
  235. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/models/workspace.py +0 -0
  236. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/pagination.py +0 -0
  237. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/client/types.py +0 -0
  238. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/common.py +0 -0
  239. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/drive.py +0 -0
  240. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/errors.py +0 -0
  241. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/jobs.py +0 -0
  242. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/sandbox/__init__.py +0 -0
  243. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/sandbox/types.py +0 -0
  244. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/core/secret.py +0 -0
  245. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/crewai.py +0 -0
  246. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/googleadk.py +0 -0
  247. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/langgraph.py +0 -0
  248. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/livekit.py +0 -0
  249. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/llamaindex.py +0 -0
  250. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/openai.py +0 -0
  251. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/pydantic.py +0 -0
  252. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/blaxel/telemetry.py +0 -0
  253. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/daytona/__init__.py +0 -0
  254. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/daytona/_async_daytona.py +0 -0
  255. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/daytona/_async_io.py +0 -0
  256. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/daytona/_core.py +0 -0
  257. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/daytona/_sync_daytona.py +0 -0
  258. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/daytona/_sync_io.py +0 -0
  259. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/deepagents.py +0 -0
  260. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/__init__.py +0 -0
  261. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/_async_io.py +0 -0
  262. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/_async_sandbox.py +0 -0
  263. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/_core.py +0 -0
  264. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/_sync_io.py +0 -0
  265. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/_sync_sandbox.py +0 -0
  266. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/code_interpreter/__init__.py +0 -0
  267. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/code_interpreter/_async_ci.py +0 -0
  268. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/code_interpreter/_models.py +0 -0
  269. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/code_interpreter/_sync_ci.py +0 -0
  270. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/code_interpreter/charts.py +0 -0
  271. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/code_interpreter/code_interpreter_async.py +0 -0
  272. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/code_interpreter/code_interpreter_sync.py +0 -0
  273. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/code_interpreter/models.py +0 -0
  274. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/connection_config.py +0 -0
  275. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/exceptions.py +0 -0
  276. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox/__init__.py +0 -0
  277. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox/commands/__init__.py +0 -0
  278. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox/commands/command_handle.py +0 -0
  279. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox/commands/main.py +0 -0
  280. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox/filesystem/__init__.py +0 -0
  281. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox/filesystem/filesystem.py +0 -0
  282. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox/filesystem/watch_handle.py +0 -0
  283. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox/network.py +0 -0
  284. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox/sandbox_api.py +0 -0
  285. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox/signature.py +0 -0
  286. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_async/__init__.py +0 -0
  287. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_async/commands/__init__.py +0 -0
  288. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_async/commands/command.py +0 -0
  289. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_async/commands/command_handle.py +0 -0
  290. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_async/commands/pty.py +0 -0
  291. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_async/filesystem/__init__.py +0 -0
  292. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_async/filesystem/filesystem.py +0 -0
  293. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_async/filesystem/watch_handle.py +0 -0
  294. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_async/main.py +0 -0
  295. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_async/paginator.py +0 -0
  296. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_async/utils.py +0 -0
  297. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_sync/__init__.py +0 -0
  298. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_sync/commands/__init__.py +0 -0
  299. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_sync/commands/command.py +0 -0
  300. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_sync/commands/command_handle.py +0 -0
  301. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_sync/commands/pty.py +0 -0
  302. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_sync/filesystem/__init__.py +0 -0
  303. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_sync/filesystem/filesystem.py +0 -0
  304. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_sync/filesystem/watch_handle.py +0 -0
  305. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_sync/git.py +0 -0
  306. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_sync/main.py +0 -0
  307. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/sandbox_sync/paginator.py +0 -0
  308. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/secret/__init__.py +0 -0
  309. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/template/__init__.py +0 -0
  310. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/template/dockerfile_parser.py +0 -0
  311. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/template/logger.py +0 -0
  312. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/template/main.py +0 -0
  313. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/template/readycmd.py +0 -0
  314. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/template/types.py +0 -0
  315. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/template_async/__init__.py +0 -0
  316. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/template_async/main.py +0 -0
  317. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/template_sync/__init__.py +0 -0
  318. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/template_sync/main.py +0 -0
  319. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/volume/__init__.py +0 -0
  320. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/volume/connection_config.py +0 -0
  321. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/volume/types.py +0 -0
  322. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/volume/volume_async.py +0 -0
  323. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/e2b/volume/volume_sync.py +0 -0
  324. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/harbor.py +0 -0
  325. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/inspect_ai.py +0 -0
  326. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/__init__.py +0 -0
  327. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/_async.py +0 -0
  328. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/_dual.py +0 -0
  329. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/_fs_async.py +0 -0
  330. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/_fs_common.py +0 -0
  331. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/_fs_sync.py +0 -0
  332. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/_lookup.py +0 -0
  333. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/_object.py +0 -0
  334. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/_probe.py +0 -0
  335. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/_snapshot.py +0 -0
  336. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/_tunnel.py +0 -0
  337. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/app.py +0 -0
  338. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/cloud_bucket_mount.py +0 -0
  339. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/exception.py +0 -0
  340. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/file_pattern_matcher.py +0 -0
  341. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/image.py +0 -0
  342. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/proxy.py +0 -0
  343. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/sandbox/__init__.py +0 -0
  344. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/sandbox/sandbox.py +0 -0
  345. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/sandbox_fs.py +0 -0
  346. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/secret.py +0 -0
  347. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/snapshot.py +0 -0
  348. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/types.py +0 -0
  349. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/modal/volume.py +0 -0
  350. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/morph/__init__.py +0 -0
  351. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/morph/api.py +0 -0
  352. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/openai_agents.py +0 -0
  353. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/prime/__init__.py +0 -0
  354. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/prime/_async.py +0 -0
  355. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/prime/_sync.py +0 -0
  356. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/prime/core/__init__.py +0 -0
  357. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/prime/core/client.py +0 -0
  358. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/prime/exceptions.py +0 -0
  359. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/prime/models.py +0 -0
  360. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/prime/process.py +0 -0
  361. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/prime/sandbox.py +0 -0
  362. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/py.typed +0 -0
  363. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/runloop/__init__.py +0 -0
  364. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/runloop/_async.py +0 -0
  365. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/runloop/_exceptions.py +0 -0
  366. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/runloop/_snapshots.py +0 -0
  367. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/runloop/_sync.py +0 -0
  368. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/runloop/_v2.py +0 -0
  369. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/runloop/lib/__init__.py +0 -0
  370. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/runloop/lib/polling.py +0 -0
  371. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/runloop/sdk/__init__.py +0 -0
  372. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/sprites/__init__.py +0 -0
  373. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/sprites/_capture.py +0 -0
  374. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/sprites/_capture_async.py +0 -0
  375. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/sprites/_features.py +0 -0
  376. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/sprites/_metadata.py +0 -0
  377. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/sprites/_stream.py +0 -0
  378. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/sprites/_stream_async.py +0 -0
  379. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/sprites/_translate.py +0 -0
  380. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/sprites/async_client.py +0 -0
  381. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/sprites/async_exec.py +0 -0
  382. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/sprites/client.py +0 -0
  383. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/sprites/control.py +0 -0
  384. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/sprites/exceptions.py +0 -0
  385. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/sprites/exec.py +0 -0
  386. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/sprites/filesystem.py +0 -0
  387. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/sprites/sprite.py +0 -0
  388. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/sprites/types.py +0 -0
  389. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/tools.py +0 -0
  390. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/vercel/__init__.py +0 -0
  391. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/vercel/_async_io.py +0 -0
  392. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/vercel/_async_sandbox.py +0 -0
  393. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/vercel/_core.py +0 -0
  394. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/vercel/_sync_io.py +0 -0
  395. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/vercel/_sync_sandbox.py +0 -0
  396. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/vercel/api.py +0 -0
  397. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/vercel/sandbox/__init__.py +0 -0
  398. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/vercel/sandbox/sync.py +0 -0
  399. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/wallet.py +0 -0
  400. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime/webhooks.py +0 -0
  401. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime.egg-info/dependency_links.txt +0 -0
  402. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime.egg-info/entry_points.txt +0 -0
  403. {withruntime-0.15.0 → withruntime-0.16.0}/withruntime.egg-info/requires.txt +0 -0
  404. {withruntime-0.15.0 → withruntime-0.16.0}/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.15.0
3
+ Version: 0.16.0
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "withruntime"
7
- version = "0.15.0"
7
+ version = "0.16.0"
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" }
@@ -0,0 +1,92 @@
1
+ """exec, exec_stream, spawn and terminal take user="root", sent only when given."""
2
+ import asyncio
3
+ import unittest
4
+
5
+ from withruntime._async_client import AsyncSandbox
6
+ from withruntime._sync_client import Sandbox
7
+
8
+ ID = "11111111-2222-4333-8444-555555555555"
9
+ RESULT = {"exitCode": 0, "stdout": "", "stderr": "", "state": "exited", "timedOut": False}
10
+
11
+
12
+ class Recorder:
13
+ """Stands in for the transport: keeps each body and query it was given."""
14
+
15
+ def __init__(self, is_async):
16
+ self.is_async, self.bodies, self.queries = is_async, [], []
17
+
18
+ def json(self, method, path, body=None, **_k):
19
+ self.bodies.append(body)
20
+ data = {"id": "p1", "state": "running"} if path.endswith("/processes") else RESULT
21
+ if self.is_async:
22
+ async def later():
23
+ return data
24
+ return later()
25
+ return data
26
+
27
+ def events(self, method, path, body=None, **_k):
28
+ self.bodies.append(body)
29
+ events = [{"type": "start", "processId": "p1"}, {"type": "exit", "exitCode": 0, "state": "exited"}]
30
+ if self.is_async:
31
+ async def gen():
32
+ for event in events:
33
+ yield event
34
+ return gen()
35
+ return (event for event in events)
36
+
37
+ def websocket(self, path, query):
38
+ self.queries.append(query)
39
+ raise OSError("stop")
40
+
41
+
42
+ def drive(is_async, call):
43
+ recorder = Recorder(is_async)
44
+ sandbox = (AsyncSandbox if is_async else Sandbox)(recorder, {"id": ID})
45
+
46
+ def run(name, *args, **kwargs):
47
+ result = getattr(sandbox, name)(*args, **kwargs)
48
+ if name == "exec_stream":
49
+ if is_async:
50
+ async def drain():
51
+ return [e async for e in result]
52
+ return asyncio.run(drain())
53
+ return list(result)
54
+ return asyncio.run(result) if is_async else result
55
+
56
+ call(run)
57
+ return recorder
58
+
59
+
60
+ class ExecUser(unittest.TestCase):
61
+ def test_user_is_sent_only_when_given(self):
62
+ for is_async in (False, True):
63
+ def call(run):
64
+ run("exec", "id", user="root")
65
+ run("exec", "id")
66
+ run("exec_stream", "id", user="root")
67
+ run("exec_stream", "id")
68
+ run("spawn", "sleep 1", user="root")
69
+ run("spawn", "sleep 1")
70
+ bodies = drive(is_async, call).bodies
71
+ self.assertEqual([b.get("user") for b in bodies], ["root", None] * 3)
72
+ self.assertTrue(all("user" not in b for b in bodies[1::2]))
73
+
74
+ def test_terminal_sends_user_only_when_given(self):
75
+ for is_async in (False, True):
76
+ def call(run):
77
+ for kwargs in ({"user": "root"}, {}):
78
+ try:
79
+ run("terminal", **kwargs)
80
+ except OSError:
81
+ pass
82
+ queries = drive(is_async, call).queries
83
+ self.assertEqual([q.get("user") for q in queries], ["root", None])
84
+
85
+ def test_process_reports_its_user(self):
86
+ from withruntime._sync_client import Process
87
+ self.assertEqual(Process(None, ID, {"id": "p1", "user": "root"}).user, "root")
88
+ self.assertIsNone(Process(None, ID, {"id": "p1"}).user)
89
+
90
+
91
+ if __name__ == "__main__":
92
+ unittest.main()
@@ -9,11 +9,14 @@ import unittest
9
9
  from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
10
10
  from urllib.parse import parse_qs, urlparse
11
11
 
12
+ import withruntime
12
13
  from withruntime import RuntimeError, Sandbox
13
14
 
14
15
 
15
16
  class Stub(BaseHTTPRequestHandler):
16
17
  seen: list = []
18
+ # What the sandbox's listener answers at /v1/environment; None: nothing.
19
+ current = None
17
20
 
18
21
  def log_message(self, *args):
19
22
  pass
@@ -21,7 +24,9 @@ class Stub(BaseHTTPRequestHandler):
21
24
  def do_GET(self):
22
25
  url = urlparse(self.path)
23
26
  Stub.seen.append((url.path, parse_qs(url.query), self.headers.get("Authorization")))
24
- if self.headers.get("Authorization") != "Bearer rtid1.statement.sig":
27
+ if url.path == "/v1/environment":
28
+ body, status = (Stub.current, 200) if Stub.current else ({}, 404)
29
+ elif self.headers.get("Authorization") != "Bearer rtid1.statement.sig":
25
30
  body, status = {"error": {"code": "unauthorized", "message": "This request token is not valid."}}, 401
26
31
  else:
27
32
  body, status = {"token": "header.payload.signature", "expiresAt": "2026-09-24T00:10:00Z"}, 200
@@ -40,9 +45,13 @@ class IdentityTokenTest(unittest.TestCase):
40
45
  self.thread.start()
41
46
  self.saved = {k: os.environ.get(k) for k in ("RUNTIME_ID_TOKEN_REQUEST_URL", "RUNTIME_ID_TOKEN_REQUEST_TOKEN")}
42
47
  os.environ["RUNTIME_ID_TOKEN_REQUEST_URL"] = f"http://127.0.0.1:{self.server.server_port}/v1/identity/token"
43
- Stub.seen = []
48
+ Stub.seen, Stub.current = [], None
49
+ self.where = (withruntime._ENVIRONMENT_URL, withruntime._ENVIRONMENT_FILE)
50
+ withruntime._ENVIRONMENT_URL = f"http://127.0.0.1:{self.server.server_port}/v1/environment"
51
+ withruntime._ENVIRONMENT_FILE = "/nonexistent/runtime/environment.json"
44
52
 
45
53
  def tearDown(self):
54
+ withruntime._ENVIRONMENT_URL, withruntime._ENVIRONMENT_FILE = self.where
46
55
  self.server.shutdown()
47
56
  self.server.server_close()
48
57
  self.thread.join()
@@ -83,14 +92,28 @@ class IdentityTokenTest(unittest.TestCase):
83
92
  Sandbox.identity_token("sts.amazonaws.com")
84
93
  self.assertIn("not valid", str(caught.exception))
85
94
  self.assertEqual(caught.exception.status, 401)
86
- self.assertEqual(len(responses), 1)
87
- self.assertTrue(responses[0].closed, "identity error response was not closed")
95
+ # The listener had nothing newer: one ask, and its environment read.
96
+ self.assertEqual([seen[0] for seen in Stub.seen], ["/v1/identity/token", "/v1/environment"])
97
+ self.assertEqual(len(responses), 2)
98
+ self.assertTrue(all(r.closed for r in responses), "an error response was not closed")
88
99
  finally:
89
100
  # Preserve deterministic cleanup even against the unfixed client;
90
101
  # the assertion above observes SDK ownership, before this fallback.
91
102
  for response in responses:
92
103
  response.close()
93
104
 
105
+ def test_a_stale_request_token_is_read_again_from_the_host_once(self):
106
+ # The build sandbox's statement, as an App copy's saved server holds it.
107
+ os.environ["RUNTIME_ID_TOKEN_REQUEST_TOKEN"] = "rtid1.build.sig"
108
+ Stub.current = {"RUNTIME_ID_TOKEN_REQUEST_URL": os.environ["RUNTIME_ID_TOKEN_REQUEST_URL"],
109
+ "RUNTIME_ID_TOKEN_REQUEST_TOKEN": "rtid1.statement.sig"}
110
+ self.assertEqual(Sandbox.identity_token("sts.amazonaws.com"), "header.payload.signature")
111
+ self.assertEqual([(path, auth) for path, _, auth in Stub.seen], [
112
+ ("/v1/identity/token", "Bearer rtid1.build.sig"),
113
+ ("/v1/environment", None),
114
+ ("/v1/identity/token", "Bearer rtid1.statement.sig"),
115
+ ])
116
+
94
117
  def test_outside_a_sandbox_there_is_nothing_to_ask_with(self):
95
118
  os.environ.pop("RUNTIME_ID_TOKEN_REQUEST_TOKEN", None)
96
119
  if os.path.exists("/run/runtime/environment.json"):
@@ -13,7 +13,7 @@ import zipfile
13
13
 
14
14
 
15
15
  ROOT = Path(__file__).resolve().parents[1]
16
- VERSION = "0.15.0"
16
+ VERSION = "0.16.0"
17
17
  MAX_ARTIFACT_BYTES = 16 * 1024 * 1024
18
18
  MAX_FILE_BYTES = 4 * 1024 * 1024
19
19
  MAX_METADATA_BYTES = 256 * 1024
@@ -62,6 +62,42 @@ class Sandbox(_Sandbox):
62
62
  return _identity_token(audience, lifetime_seconds, timeout)
63
63
 
64
64
 
65
+ # The sandbox's own listener (packages/cloud/src/linux/egress.ts).
66
+ _ENVIRONMENT_URL = "http://runtime.internal/v1/environment"
67
+ _ENVIRONMENT_FILE = "/run/runtime/environment.json"
68
+
69
+
70
+ def _file_credentials():
71
+ import json as _json
72
+ try:
73
+ with open(_ENVIRONMENT_FILE, "rb") as file:
74
+ env = _json.load(file)
75
+ return env.get("RUNTIME_ID_TOKEN_REQUEST_URL"), env.get("RUNTIME_ID_TOKEN_REQUEST_TOKEN")
76
+ except (OSError, ValueError, AttributeError):
77
+ return None, None
78
+
79
+
80
+ def _current_credentials(timeout: float):
81
+ """The sandbox's request token as its host holds it now. The one in
82
+ os.environ was current when the process started: it changes with every
83
+ renewal of the sandbox's lease (about every 30 minutes for one that keeps
84
+ running), and a server restored from a snapshot (an App's copies, a fork)
85
+ holds the statement of the sandbox it was saved from."""
86
+ import json as _json
87
+ import urllib.request as _request
88
+ try:
89
+ with _request.urlopen(_ENVIRONMENT_URL, timeout=min(timeout, 5.0)) as answer:
90
+ env = _json.load(answer)
91
+ url, token = env.get("RUNTIME_ID_TOKEN_REQUEST_URL"), env.get("RUNTIME_ID_TOKEN_REQUEST_TOKEN")
92
+ if isinstance(url, str) and url and isinstance(token, str) and token:
93
+ return url, token
94
+ except _request.HTTPError as error: # type: ignore[attr-defined]
95
+ error.close()
96
+ except (OSError, ValueError, AttributeError):
97
+ pass # Not in a sandbox, or a host that predates the listener's environment.
98
+ return _file_credentials()
99
+
100
+
65
101
  def _identity_token(audience: str, lifetime_seconds: Optional[int], timeout: float) -> str:
66
102
  import json as _json
67
103
  import os as _os
@@ -71,22 +107,32 @@ def _identity_token(audience: str, lifetime_seconds: Optional[int], timeout: flo
71
107
  url = _os.environ.get("RUNTIME_ID_TOKEN_REQUEST_URL")
72
108
  token = _os.environ.get("RUNTIME_ID_TOKEN_REQUEST_TOKEN")
73
109
  if not url or not token:
74
- try:
75
- with open("/run/runtime/environment.json", "rb") as file:
76
- env = _json.load(file)
77
- url, token = env.get("RUNTIME_ID_TOKEN_REQUEST_URL"), env.get("RUNTIME_ID_TOKEN_REQUEST_TOKEN")
78
- except (OSError, ValueError):
79
- pass
110
+ url, token = _file_credentials()
80
111
  if not url or not token:
81
112
  raise RuntimeError("Identity tokens are issued only inside a Runtime sandbox (RUNTIME_ID_TOKEN_REQUEST_TOKEN is not set).",
82
113
  code="identity_unavailable")
83
114
  query = {"audience": audience}
84
115
  if lifetime_seconds is not None:
85
116
  query["lifetimeSeconds"] = str(lifetime_seconds)
86
- request = _request.Request(f"{url}?{_parse.urlencode(query)}", headers={"Authorization": f"Bearer {token}"})
87
- try:
117
+
118
+ def ask(url, token):
119
+ request = _request.Request(f"{url}?{_parse.urlencode(query)}", headers={"Authorization": f"Bearer {token}"})
88
120
  with _request.urlopen(request, timeout=timeout) as answer:
89
121
  return _json.load(answer)["token"]
122
+
123
+ try:
124
+ try:
125
+ return ask(url, token)
126
+ except _request.HTTPError as error: # type: ignore[attr-defined]
127
+ # Refused for a request token that is no longer this sandbox's
128
+ # current one: ask once more with the one its host holds now.
129
+ if error.code not in (401, 403):
130
+ raise
131
+ current_url, current_token = _current_credentials(timeout)
132
+ if not current_url or not current_token or current_token == token:
133
+ raise
134
+ error.close()
135
+ return ask(current_url, current_token)
90
136
  except _request.HTTPError as error: # type: ignore[attr-defined]
91
137
  try:
92
138
  message = _json.load(error).get("error", {}).get("message", str(error))
@@ -10,7 +10,7 @@ import os
10
10
  import random
11
11
  import time
12
12
  import uuid
13
- from typing import Any, AsyncIterator, Callable, Generic, Optional, TypeVar, Union
13
+ from typing import Any, Literal, AsyncIterator, Callable, Generic, Optional, TypeVar, Union
14
14
  from urllib.parse import quote, urlencode
15
15
 
16
16
  from ._api_defaults import KEEP_ALIVE_MARGIN_SECONDS, STREAMED_EXEC_TIMEOUT_MS, WAIT_FOR_TIMEOUT_SECONDS
@@ -597,10 +597,13 @@ class AsyncPage:
597
597
 
598
598
 
599
599
  def _command(command: Union[str, list[str], tuple[str, ...]], cwd: Optional[str], env: Optional[dict[str, str]],
600
- stdin: Optional[Union[str, bytes]], timeout_ms: Optional[int]) -> dict[str, Any]:
600
+ stdin: Optional[Union[str, bytes]], timeout_ms: Optional[int],
601
+ user: Optional[Literal["sandbox", "root"]] = None) -> dict[str, Any]:
601
602
  body: dict[str, Any] = {"command": command} if isinstance(command, str) else {"argv": list(command)}
602
603
  if cwd is not None:
603
604
  body["cwd"] = cwd
605
+ if user is not None:
606
+ body["user"] = user
604
607
  if env is not None:
605
608
  body["env"] = env
606
609
  if isinstance(stdin, str):
@@ -691,6 +694,11 @@ class AsyncProcess:
691
694
  """The command line as the sandbox reports it."""
692
695
  return self.info.get("command")
693
696
 
697
+ @property
698
+ def user(self) -> Optional[str]:
699
+ """Who it runs as, "sandbox" or "root"; None from an API that does not say."""
700
+ return self.info.get("user")
701
+
694
702
  @property
695
703
  def state(self) -> Optional[str]:
696
704
  """As of the last answer: spawn, wait() or refresh()."""
@@ -1572,6 +1580,7 @@ class AsyncSandbox(AsyncMachine):
1572
1580
  return AsyncSandbox(t, {"id": sandbox_id})
1573
1581
 
1574
1582
  async def exec(self, command: Union[str, list[str], tuple[str, ...]], *, cwd: Optional[str] = None,
1583
+ user: Optional[Literal["sandbox", "root"]] = None,
1575
1584
  env: Optional[dict[str, str]] = None, stdin: Optional[Union[str, bytes]] = None,
1576
1585
  timeout_ms: Optional[int] = None, on_stdout: Optional[Callable[[str], Any]] = None,
1577
1586
  on_stderr: Optional[Callable[[str], Any]] = None, check: bool = False,
@@ -1580,10 +1589,11 @@ class AsyncSandbox(AsyncMachine):
1580
1589
  With on_stdout/on_stderr the output streams. The timeout is 60 s by
1581
1590
  default, 24 h when the output streams. A timeout is a result
1582
1591
  (timed_out=True, the output so far), never an error; ``check=True``
1583
- raises CommandError on a non-zero exit."""
1592
+ raises CommandError on a non-zero exit. ``user="root"`` runs it as root
1593
+ through the sandbox's sudo (the default is "sandbox")."""
1584
1594
  streaming = on_stdout is not None or on_stderr is not None or (timeout_ms or 0) > 60_000
1585
1595
  if not streaming:
1586
- data = await self._t.json("POST", self._path(":exec"), body=_command(command, cwd, env, stdin, timeout_ms),
1596
+ data = await self._t.json("POST", self._path(":exec"), body=_command(command, cwd, env, stdin, timeout_ms, user),
1587
1597
  idempotency_key=idempotency_key, timeout=(timeout_ms or 60_000) / 1000 + 60)
1588
1598
  result = CommandResult.from_json(data)
1589
1599
  else:
@@ -1595,7 +1605,7 @@ class AsyncSandbox(AsyncMachine):
1595
1605
  # both flags carry it.
1596
1606
  dropped = False
1597
1607
  try:
1598
- async for event in self.exec_stream(command, cwd=cwd, env=env, stdin=stdin, timeout_ms=timeout_ms,
1608
+ async for event in self.exec_stream(command, cwd=cwd, user=user, env=env, stdin=stdin, timeout_ms=timeout_ms,
1599
1609
  idempotency_key=idempotency_key):
1600
1610
  if event["type"] == "start":
1601
1611
  process_id = event["processId"]
@@ -1634,6 +1644,7 @@ class AsyncSandbox(AsyncMachine):
1634
1644
  return result
1635
1645
 
1636
1646
  async def exec_stream(self, command: Union[str, list[str], tuple[str, ...]], *, cwd: Optional[str] = None,
1647
+ user: Optional[Literal["sandbox", "root"]] = None,
1637
1648
  env: Optional[dict[str, str]] = None, stdin: Optional[Union[str, bytes]] = None,
1638
1649
  timeout_ms: Optional[int] = None,
1639
1650
  idempotency_key: Optional[str] = None) -> AsyncIterator[dict[str, Any]]:
@@ -1648,7 +1659,7 @@ class AsyncSandbox(AsyncMachine):
1648
1659
  "stderrTruncated": "stderr_truncated", "droppedBytes": "dropped_bytes",
1649
1660
  "resumeAt": "resume_at", "outOfMemory": "out_of_memory"}
1650
1661
  return {**event, **{alias: event[name] for name, alias in aliases.items() if name in event}}
1651
- body = {**_command(command, cwd, env, stdin, timeout_ms if timeout_ms is not None else STREAMED_EXEC_TIMEOUT_MS), "stream": True}
1662
+ body = {**_command(command, cwd, env, stdin, timeout_ms if timeout_ms is not None else STREAMED_EXEC_TIMEOUT_MS, user), "stream": True}
1652
1663
  events = self._t.events("POST", self._path(":exec"), body=body, idempotency_key=idempotency_key,
1653
1664
  timeout=((timeout_ms or STREAMED_EXEC_TIMEOUT_MS) / 1000) + 60)
1654
1665
  read = _OutputCursor()
@@ -1685,12 +1696,13 @@ class AsyncSandbox(AsyncMachine):
1685
1696
  await _close_events(continued)
1686
1697
 
1687
1698
  async def spawn(self, command: Union[str, list[str], tuple[str, ...]], *, cwd: Optional[str] = None,
1699
+ user: Optional[Literal["sandbox", "root"]] = None,
1688
1700
  env: Optional[dict[str, str]] = None, stdin: Optional[str] = None,
1689
1701
  pty: Optional[dict[str, int]] = None, timeout_ms: Optional[int] = None,
1690
1702
  output_encoding: Optional[str] = None) -> AsyncProcess:
1691
1703
  """Starts a background process and returns at once. ``stdin="pipe"``
1692
1704
  keeps input open for write(); ``pty={"cols": 120, "rows": 40}`` gives a terminal."""
1693
- body = _command(command, cwd, env, None if stdin == "pipe" else stdin, timeout_ms)
1705
+ body = _command(command, cwd, env, None if stdin == "pipe" else stdin, timeout_ms, user)
1694
1706
  if output_encoding is not None:
1695
1707
  if output_encoding not in ("utf8", "base64"):
1696
1708
  raise ValueError("output_encoding must be utf8 or base64")
@@ -1709,10 +1721,11 @@ class AsyncSandbox(AsyncMachine):
1709
1721
  return AsyncProcess(self._t, self.id, await self._t.json("GET", self._path(f"/processes/{_enc(process_id)}")))
1710
1722
 
1711
1723
  async def terminal(self, *, cols: int = 80, rows: int = 24, command: Optional[str] = None,
1712
- cwd: Optional[str] = None, process_id: Optional[str] = None) -> AsyncTerminal:
1724
+ cwd: Optional[str] = None, user: Optional[Literal["sandbox", "root"]] = None,
1725
+ process_id: Optional[str] = None) -> AsyncTerminal:
1713
1726
  """An interactive terminal over a WebSocket."""
1714
1727
  socket = await self._t.websocket(self._path("/terminal"), {
1715
- "cols": cols, "rows": rows, "command": command, "cwd": cwd, "processId": process_id})
1728
+ "cols": cols, "rows": rows, "command": command, "cwd": cwd, "user": user, "processId": process_id})
1716
1729
  ready = await socket.recv()
1717
1730
  if not isinstance(ready, str):
1718
1731
  raise RuntimeError("The terminal did not start.", code="terminal_refused")
@@ -9,7 +9,7 @@ import os
9
9
  import random
10
10
  import time
11
11
  import uuid
12
- from typing import Any, Iterator, Callable, Generic, Optional, TypeVar, Union
12
+ from typing import Any, Literal, Iterator, Callable, Generic, Optional, TypeVar, Union
13
13
  from urllib.parse import quote, urlencode
14
14
 
15
15
  from ._api_defaults import KEEP_ALIVE_MARGIN_SECONDS, STREAMED_EXEC_TIMEOUT_MS, WAIT_FOR_TIMEOUT_SECONDS
@@ -596,10 +596,13 @@ class Page:
596
596
 
597
597
 
598
598
  def _command(command: Union[str, list[str], tuple[str, ...]], cwd: Optional[str], env: Optional[dict[str, str]],
599
- stdin: Optional[Union[str, bytes]], timeout_ms: Optional[int]) -> dict[str, Any]:
599
+ stdin: Optional[Union[str, bytes]], timeout_ms: Optional[int],
600
+ user: Optional[Literal["sandbox", "root"]] = None) -> dict[str, Any]:
600
601
  body: dict[str, Any] = {"command": command} if isinstance(command, str) else {"argv": list(command)}
601
602
  if cwd is not None:
602
603
  body["cwd"] = cwd
604
+ if user is not None:
605
+ body["user"] = user
603
606
  if env is not None:
604
607
  body["env"] = env
605
608
  if isinstance(stdin, str):
@@ -690,6 +693,11 @@ class Process:
690
693
  """The command line as the sandbox reports it."""
691
694
  return self.info.get("command")
692
695
 
696
+ @property
697
+ def user(self) -> Optional[str]:
698
+ """Who it runs as, "sandbox" or "root"; None from an API that does not say."""
699
+ return self.info.get("user")
700
+
693
701
  @property
694
702
  def state(self) -> Optional[str]:
695
703
  """As of the last answer: spawn, wait() or refresh()."""
@@ -1571,6 +1579,7 @@ class Sandbox(Machine):
1571
1579
  return Sandbox(t, {"id": sandbox_id})
1572
1580
 
1573
1581
  def exec(self, command: Union[str, list[str], tuple[str, ...]], *, cwd: Optional[str] = None,
1582
+ user: Optional[Literal["sandbox", "root"]] = None,
1574
1583
  env: Optional[dict[str, str]] = None, stdin: Optional[Union[str, bytes]] = None,
1575
1584
  timeout_ms: Optional[int] = None, on_stdout: Optional[Callable[[str], Any]] = None,
1576
1585
  on_stderr: Optional[Callable[[str], Any]] = None, check: bool = False,
@@ -1579,10 +1588,11 @@ class Sandbox(Machine):
1579
1588
  With on_stdout/on_stderr the output streams. The timeout is 60 s by
1580
1589
  default, 24 h when the output streams. A timeout is a result
1581
1590
  (timed_out=True, the output so far), never an error; ``check=True``
1582
- raises CommandError on a non-zero exit."""
1591
+ raises CommandError on a non-zero exit. ``user="root"`` runs it as root
1592
+ through the sandbox's sudo (the default is "sandbox")."""
1583
1593
  streaming = on_stdout is not None or on_stderr is not None or (timeout_ms or 0) > 60_000
1584
1594
  if not streaming:
1585
- data = self._t.json("POST", self._path(":exec"), body=_command(command, cwd, env, stdin, timeout_ms),
1595
+ data = self._t.json("POST", self._path(":exec"), body=_command(command, cwd, env, stdin, timeout_ms, user),
1586
1596
  idempotency_key=idempotency_key, timeout=(timeout_ms or 60_000) / 1000 + 60)
1587
1597
  result = CommandResult.from_json(data)
1588
1598
  else:
@@ -1594,7 +1604,7 @@ class Sandbox(Machine):
1594
1604
  # both flags carry it.
1595
1605
  dropped = False
1596
1606
  try:
1597
- for event in self.exec_stream(command, cwd=cwd, env=env, stdin=stdin, timeout_ms=timeout_ms,
1607
+ for event in self.exec_stream(command, cwd=cwd, user=user, env=env, stdin=stdin, timeout_ms=timeout_ms,
1598
1608
  idempotency_key=idempotency_key):
1599
1609
  if event["type"] == "start":
1600
1610
  process_id = event["processId"]
@@ -1633,6 +1643,7 @@ class Sandbox(Machine):
1633
1643
  return result
1634
1644
 
1635
1645
  def exec_stream(self, command: Union[str, list[str], tuple[str, ...]], *, cwd: Optional[str] = None,
1646
+ user: Optional[Literal["sandbox", "root"]] = None,
1636
1647
  env: Optional[dict[str, str]] = None, stdin: Optional[Union[str, bytes]] = None,
1637
1648
  timeout_ms: Optional[int] = None,
1638
1649
  idempotency_key: Optional[str] = None) -> Iterator[dict[str, Any]]:
@@ -1647,7 +1658,7 @@ class Sandbox(Machine):
1647
1658
  "stderrTruncated": "stderr_truncated", "droppedBytes": "dropped_bytes",
1648
1659
  "resumeAt": "resume_at", "outOfMemory": "out_of_memory"}
1649
1660
  return {**event, **{alias: event[name] for name, alias in aliases.items() if name in event}}
1650
- body = {**_command(command, cwd, env, stdin, timeout_ms if timeout_ms is not None else STREAMED_EXEC_TIMEOUT_MS), "stream": True}
1661
+ body = {**_command(command, cwd, env, stdin, timeout_ms if timeout_ms is not None else STREAMED_EXEC_TIMEOUT_MS, user), "stream": True}
1651
1662
  events = self._t.events("POST", self._path(":exec"), body=body, idempotency_key=idempotency_key,
1652
1663
  timeout=((timeout_ms or STREAMED_EXEC_TIMEOUT_MS) / 1000) + 60)
1653
1664
  read = _OutputCursor()
@@ -1684,12 +1695,13 @@ class Sandbox(Machine):
1684
1695
  _close_events(continued)
1685
1696
 
1686
1697
  def spawn(self, command: Union[str, list[str], tuple[str, ...]], *, cwd: Optional[str] = None,
1698
+ user: Optional[Literal["sandbox", "root"]] = None,
1687
1699
  env: Optional[dict[str, str]] = None, stdin: Optional[str] = None,
1688
1700
  pty: Optional[dict[str, int]] = None, timeout_ms: Optional[int] = None,
1689
1701
  output_encoding: Optional[str] = None) -> Process:
1690
1702
  """Starts a background process and returns at once. ``stdin="pipe"``
1691
1703
  keeps input open for write(); ``pty={"cols": 120, "rows": 40}`` gives a terminal."""
1692
- body = _command(command, cwd, env, None if stdin == "pipe" else stdin, timeout_ms)
1704
+ body = _command(command, cwd, env, None if stdin == "pipe" else stdin, timeout_ms, user)
1693
1705
  if output_encoding is not None:
1694
1706
  if output_encoding not in ("utf8", "base64"):
1695
1707
  raise ValueError("output_encoding must be utf8 or base64")
@@ -1708,10 +1720,11 @@ class Sandbox(Machine):
1708
1720
  return Process(self._t, self.id, self._t.json("GET", self._path(f"/processes/{_enc(process_id)}")))
1709
1721
 
1710
1722
  def terminal(self, *, cols: int = 80, rows: int = 24, command: Optional[str] = None,
1711
- cwd: Optional[str] = None, process_id: Optional[str] = None) -> Terminal:
1723
+ cwd: Optional[str] = None, user: Optional[Literal["sandbox", "root"]] = None,
1724
+ process_id: Optional[str] = None) -> Terminal:
1712
1725
  """An interactive terminal over a WebSocket."""
1713
1726
  socket = self._t.websocket(self._path("/terminal"), {
1714
- "cols": cols, "rows": rows, "command": command, "cwd": cwd, "processId": process_id})
1727
+ "cols": cols, "rows": rows, "command": command, "cwd": cwd, "user": user, "processId": process_id})
1715
1728
  ready = socket.recv()
1716
1729
  if not isinstance(ready, str):
1717
1730
  raise RuntimeError("The terminal did not start.", code="terminal_refused")
@@ -0,0 +1 @@
1
+ VERSION = "0.16.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: withruntime
3
- Version: 0.15.0
3
+ Version: 0.16.0
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
@@ -57,6 +57,7 @@ tests/test_embed_and_webhook_watch.py
57
57
  tests/test_eval_sandbox.py
58
58
  tests/test_exec_stream.py
59
59
  tests/test_exec_stream_names.py
60
+ tests/test_exec_user.py
60
61
  tests/test_file_archives.py
61
62
  tests/test_files_download.py
62
63
  tests/test_files_mode.py
@@ -1 +0,0 @@
1
- VERSION = "0.15.0"
File without changes
File without changes
File without changes