withruntime 0.43.0__tar.gz → 0.44.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 (443) hide show
  1. {withruntime-0.43.0/withruntime.egg-info → withruntime-0.44.0}/PKG-INFO +1 -1
  2. {withruntime-0.43.0 → withruntime-0.44.0}/pyproject.toml +1 -1
  3. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_package_typing.py +1 -1
  4. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_client.py +10 -5
  5. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_client.py +10 -5
  6. withruntime-0.44.0/withruntime/_version.py +1 -0
  7. withruntime-0.44.0/withruntime/_ws.py +403 -0
  8. {withruntime-0.43.0 → withruntime-0.44.0/withruntime.egg-info}/PKG-INFO +1 -1
  9. withruntime-0.43.0/withruntime/_version.py +0 -1
  10. withruntime-0.43.0/withruntime/_ws.py +0 -161
  11. {withruntime-0.43.0 → withruntime-0.44.0}/LICENSE +0 -0
  12. {withruntime-0.43.0 → withruntime-0.44.0}/README.md +0 -0
  13. {withruntime-0.43.0 → withruntime-0.44.0}/setup.cfg +0 -0
  14. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_account_errors.py +0 -0
  15. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_agents.py +0 -0
  16. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_answer_start.py +0 -0
  17. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_apps_builds.py +0 -0
  18. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_async_stream_cleanup.py +0 -0
  19. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_audit.py +0 -0
  20. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_billing.py +0 -0
  21. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_blaxel.py +0 -0
  22. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_blaxel_0_4_17.py +0 -0
  23. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_blaxel_0_4_18.py +0 -0
  24. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_blaxel_create_timeout.py +0 -0
  25. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_blaxel_wait_deadline.py +0 -0
  26. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_browser.py +0 -0
  27. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_browsers.py +0 -0
  28. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_capacity_wait.py +0 -0
  29. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_ci.py +0 -0
  30. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_live.py +0 -0
  31. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_modal_deadline_errors.py +0 -0
  32. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_new_providers.py +0 -0
  33. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_prime_contract.py +0 -0
  34. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_prime_process_lifecycle.py +0 -0
  35. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_prime_validation.py +0 -0
  36. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_python_disk_snapshots.py +0 -0
  37. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_python_e2b_deadline.py +0 -0
  38. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_python_e2b_pty.py +0 -0
  39. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_python_e2b_stream.py +0 -0
  40. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_python_e2b_watch.py +0 -0
  41. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_python_interpreter_deadline.py +0 -0
  42. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_python_modal.py +0 -0
  43. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_python_morph.py +0 -0
  44. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_python_official.py +0 -0
  45. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_python_pins.py +0 -0
  46. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_python_processes.py +0 -0
  47. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_python_request_scope.py +0 -0
  48. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_python_runloop.py +0 -0
  49. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_python_shell.py +0 -0
  50. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_python_snapshot_capture.py +0 -0
  51. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_python_sprites.py +0 -0
  52. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_compat_router.py +0 -0
  53. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_customer_usage.py +0 -0
  54. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_daytona.py +0 -0
  55. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_daytona_0_223_1.py +0 -0
  56. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_daytona_0_224_1.py +0 -0
  57. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_daytona_0_225_0.py +0 -0
  58. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_daytona_create_cleanup.py +0 -0
  59. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_daytona_create_options.py +0 -0
  60. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_daytona_download_labels.py +0 -0
  61. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_daytona_refusals_lifted.py +0 -0
  62. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_deepagents.py +0 -0
  63. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_e2b_2_55.py +0 -0
  64. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_e2b_code_interpreter.py +0 -0
  65. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_e2b_connection_cap.py +0 -0
  66. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_e2b_exports.py +0 -0
  67. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_e2b_fork_validation.py +0 -0
  68. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_e2b_sandbox.py +0 -0
  69. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_e2b_upstream.py +0 -0
  70. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_e2b_watch.py +0 -0
  71. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_embed_and_webhook_watch.py +0 -0
  72. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_eval_sandbox.py +0 -0
  73. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_exec_stream.py +0 -0
  74. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_exec_stream_names.py +0 -0
  75. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_exec_user.py +0 -0
  76. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_file_archives.py +0 -0
  77. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_files_download.py +0 -0
  78. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_files_mode.py +0 -0
  79. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_files_upload_parallel.py +0 -0
  80. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_files_write_lost_body.py +0 -0
  81. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_harbor.py +0 -0
  82. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_http_tls_close.py +0 -0
  83. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_identity_token.py +0 -0
  84. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_image_delete_by_name.py +0 -0
  85. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_images_v2.py +0 -0
  86. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_images_volumes_interpreter.py +0 -0
  87. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_inspect_ai.py +0 -0
  88. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_interface_contract.py +0 -0
  89. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_jobs.py +0 -0
  90. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_late_answer.py +0 -0
  91. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_lifecycle_settings.py +0 -0
  92. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_limits.py +0 -0
  93. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_machine_engine.py +0 -0
  94. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_modal_1_6_2.py +0 -0
  95. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_modal_dropin.py +0 -0
  96. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_modal_examples.py +0 -0
  97. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_modal_jobs.py +0 -0
  98. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_mounts.py +0 -0
  99. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_network_funding.py +0 -0
  100. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_network_products.py +0 -0
  101. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_observability.py +0 -0
  102. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_openai_agents.py +0 -0
  103. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_out_of_memory.py +0 -0
  104. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_plans.py +0 -0
  105. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_previews_network_desktop.py +0 -0
  106. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_prime_0_4_5.py +0 -0
  107. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_prime_0_4_6.py +0 -0
  108. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_prime_0_4_7.py +0 -0
  109. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_private_network.py +0 -0
  110. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_process_deadline.py +0 -0
  111. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_process_input.py +0 -0
  112. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_process_object.py +0 -0
  113. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_process_output.py +0 -0
  114. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_process_write_backpressure.py +0 -0
  115. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_product_aliases.py +0 -0
  116. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_proxy.py +0 -0
  117. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_referrals.py +0 -0
  118. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_replayed_create_message.py +0 -0
  119. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_reservations.py +0 -0
  120. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_runloop_stream_cleanup.py +0 -0
  121. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_runloop_v2.py +0 -0
  122. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_sandbox_origin.py +0 -0
  123. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_sandbox_sessions.py +0 -0
  124. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_sandboxes_delete_all.py +0 -0
  125. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_sandboxes_stop_all.py +0 -0
  126. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_saved_connection.py +0 -0
  127. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_secrets.py +0 -0
  128. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_signed_requests.py +0 -0
  129. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_snapshot_after_fork.py +0 -0
  130. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_snapshot_recovery.py +0 -0
  131. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_sso.py +0 -0
  132. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_start_report_kept.py +0 -0
  133. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_stream_cut_short.py +0 -0
  134. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_stream_exit_close.py +0 -0
  135. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_switch_image.py +0 -0
  136. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_switching.py +0 -0
  137. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_tailscale.py +0 -0
  138. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_tools.py +0 -0
  139. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_trace_files.py +0 -0
  140. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_transport_body_recovery.py +0 -0
  141. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_transport_connection_limits.py +0 -0
  142. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_transport_never_sent.py +0 -0
  143. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_unpack.py +0 -0
  144. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_upload_deadline.py +0 -0
  145. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_usage_export.py +0 -0
  146. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_vercel.py +0 -0
  147. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_vercel_create_validation.py +0 -0
  148. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_vercel_disk_snapshot.py +0 -0
  149. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_vercel_refusals_lifted.py +0 -0
  150. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_volume_backups.py +0 -0
  151. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_volume_operations.py +0 -0
  152. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_wake_awake.py +0 -0
  153. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_wallet.py +0 -0
  154. {withruntime-0.43.0 → withruntime-0.44.0}/tests/test_watch.py +0 -0
  155. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/__init__.py +0 -0
  156. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_agent_templates.py +0 -0
  157. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_api_defaults.py +0 -0
  158. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/__init__.py +0 -0
  159. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/agents.py +0 -0
  160. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/apps.py +0 -0
  161. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/audit.py +0 -0
  162. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/billing.py +0 -0
  163. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/browser.py +0 -0
  164. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/browsers.py +0 -0
  165. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/builds.py +0 -0
  166. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/ci.py +0 -0
  167. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/containers.py +0 -0
  168. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/desktop.py +0 -0
  169. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/images.py +0 -0
  170. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/interpreter.py +0 -0
  171. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/jobs.py +0 -0
  172. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/limits.py +0 -0
  173. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/mcp.py +0 -0
  174. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/mounts.py +0 -0
  175. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/network.py +0 -0
  176. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/network_products.py +0 -0
  177. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/observability.py +0 -0
  178. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/plans.py +0 -0
  179. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/previews.py +0 -0
  180. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/private_network.py +0 -0
  181. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/referrals.py +0 -0
  182. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/reservations.py +0 -0
  183. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/secrets.py +0 -0
  184. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/signed_requests.py +0 -0
  185. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/sso.py +0 -0
  186. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/switching.py +0 -0
  187. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/tailscale.py +0 -0
  188. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/volumes.py +0 -0
  189. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_async_products/watch.py +0 -0
  190. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_clock.py +0 -0
  191. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_compat.py +0 -0
  192. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_compat_lease.py +0 -0
  193. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_compat_lifecycle.py +0 -0
  194. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_compat_shell.py +0 -0
  195. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_connection.py +0 -0
  196. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_errors.py +0 -0
  197. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_eval_sandbox.py +0 -0
  198. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_http.py +0 -0
  199. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_proxy.py +0 -0
  200. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_renamed.py +0 -0
  201. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_request_scope.py +0 -0
  202. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/__init__.py +0 -0
  203. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/agents.py +0 -0
  204. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/apps.py +0 -0
  205. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/audit.py +0 -0
  206. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/billing.py +0 -0
  207. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/browser.py +0 -0
  208. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/browsers.py +0 -0
  209. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/builds.py +0 -0
  210. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/ci.py +0 -0
  211. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/containers.py +0 -0
  212. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/desktop.py +0 -0
  213. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/images.py +0 -0
  214. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/interpreter.py +0 -0
  215. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/jobs.py +0 -0
  216. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/limits.py +0 -0
  217. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/mcp.py +0 -0
  218. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/mounts.py +0 -0
  219. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/network.py +0 -0
  220. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/network_products.py +0 -0
  221. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/observability.py +0 -0
  222. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/plans.py +0 -0
  223. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/previews.py +0 -0
  224. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/private_network.py +0 -0
  225. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/referrals.py +0 -0
  226. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/reservations.py +0 -0
  227. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/secrets.py +0 -0
  228. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/signed_requests.py +0 -0
  229. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/sso.py +0 -0
  230. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/switching.py +0 -0
  231. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/tailscale.py +0 -0
  232. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/volumes.py +0 -0
  233. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_sync_products/watch.py +0 -0
  234. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_trace.py +0 -0
  235. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_tunnel.py +0 -0
  236. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/_unpack.py +0 -0
  237. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/__init__.py +0 -0
  238. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/_async_io.py +0 -0
  239. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/_async_sandbox.py +0 -0
  240. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/_core.py +0 -0
  241. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/_sync_io.py +0 -0
  242. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/_sync_sandbox.py +0 -0
  243. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/__init__.py +0 -0
  244. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/agents.py +0 -0
  245. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/__init__.py +0 -0
  246. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/api/__init__.py +0 -0
  247. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/api/applications/__init__.py +0 -0
  248. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/api/applications/list_application_revisions.py +0 -0
  249. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/api/compute/__init__.py +0 -0
  250. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/api/compute/get_sandbox.py +0 -0
  251. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/api/compute/update_sandbox.py +0 -0
  252. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/api/functions/__init__.py +0 -0
  253. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/api/functions/create_function.py +0 -0
  254. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/api/images.py +0 -0
  255. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/api/workspaces.py +0 -0
  256. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/client.py +0 -0
  257. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/models/__init__.py +0 -0
  258. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/models/create_job_execution_request.py +0 -0
  259. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/models/create_job_execution_request_env.py +0 -0
  260. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/models/env.py +0 -0
  261. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/models/function.py +0 -0
  262. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/models/function_runtime.py +0 -0
  263. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/models/function_spec.py +0 -0
  264. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/models/metadata.py +0 -0
  265. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/models/pagination_meta.py +0 -0
  266. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/models/workspace.py +0 -0
  267. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/pagination.py +0 -0
  268. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/client/types.py +0 -0
  269. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/common.py +0 -0
  270. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/drive.py +0 -0
  271. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/errors.py +0 -0
  272. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/jobs.py +0 -0
  273. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/sandbox/__init__.py +0 -0
  274. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/sandbox/types.py +0 -0
  275. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/core/secret.py +0 -0
  276. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/crewai.py +0 -0
  277. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/googleadk.py +0 -0
  278. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/langgraph.py +0 -0
  279. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/livekit.py +0 -0
  280. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/llamaindex.py +0 -0
  281. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/openai.py +0 -0
  282. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/pydantic.py +0 -0
  283. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/blaxel/telemetry.py +0 -0
  284. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/daytona/__init__.py +0 -0
  285. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/daytona/_async_daytona.py +0 -0
  286. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/daytona/_async_io.py +0 -0
  287. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/daytona/_core.py +0 -0
  288. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/daytona/_sync_daytona.py +0 -0
  289. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/daytona/_sync_io.py +0 -0
  290. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/deepagents.py +0 -0
  291. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/__init__.py +0 -0
  292. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/_async_io.py +0 -0
  293. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/_async_sandbox.py +0 -0
  294. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/_core.py +0 -0
  295. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/_sync_io.py +0 -0
  296. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/_sync_sandbox.py +0 -0
  297. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/code_interpreter/__init__.py +0 -0
  298. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/code_interpreter/_async_ci.py +0 -0
  299. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/code_interpreter/_models.py +0 -0
  300. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/code_interpreter/_sync_ci.py +0 -0
  301. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/code_interpreter/charts.py +0 -0
  302. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/code_interpreter/code_interpreter_async.py +0 -0
  303. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/code_interpreter/code_interpreter_sync.py +0 -0
  304. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/code_interpreter/models.py +0 -0
  305. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/connection_config.py +0 -0
  306. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/exceptions.py +0 -0
  307. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox/__init__.py +0 -0
  308. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox/commands/__init__.py +0 -0
  309. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox/commands/command_handle.py +0 -0
  310. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox/commands/main.py +0 -0
  311. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox/filesystem/__init__.py +0 -0
  312. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox/filesystem/filesystem.py +0 -0
  313. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox/filesystem/watch_handle.py +0 -0
  314. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox/network.py +0 -0
  315. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox/sandbox_api.py +0 -0
  316. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox/signature.py +0 -0
  317. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_async/__init__.py +0 -0
  318. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_async/commands/__init__.py +0 -0
  319. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_async/commands/command.py +0 -0
  320. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_async/commands/command_handle.py +0 -0
  321. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_async/commands/pty.py +0 -0
  322. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_async/filesystem/__init__.py +0 -0
  323. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_async/filesystem/filesystem.py +0 -0
  324. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_async/filesystem/watch_handle.py +0 -0
  325. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_async/main.py +0 -0
  326. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_async/paginator.py +0 -0
  327. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_async/utils.py +0 -0
  328. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_sync/__init__.py +0 -0
  329. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_sync/commands/__init__.py +0 -0
  330. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_sync/commands/command.py +0 -0
  331. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_sync/commands/command_handle.py +0 -0
  332. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_sync/commands/pty.py +0 -0
  333. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_sync/filesystem/__init__.py +0 -0
  334. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_sync/filesystem/filesystem.py +0 -0
  335. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_sync/filesystem/watch_handle.py +0 -0
  336. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_sync/git.py +0 -0
  337. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_sync/main.py +0 -0
  338. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/sandbox_sync/paginator.py +0 -0
  339. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/secret/__init__.py +0 -0
  340. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/template/__init__.py +0 -0
  341. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/template/dockerfile_parser.py +0 -0
  342. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/template/logger.py +0 -0
  343. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/template/main.py +0 -0
  344. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/template/readycmd.py +0 -0
  345. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/template/types.py +0 -0
  346. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/template_async/__init__.py +0 -0
  347. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/template_async/main.py +0 -0
  348. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/template_sync/__init__.py +0 -0
  349. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/template_sync/main.py +0 -0
  350. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/volume/__init__.py +0 -0
  351. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/volume/connection_config.py +0 -0
  352. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/volume/types.py +0 -0
  353. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/volume/volume_async.py +0 -0
  354. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/e2b/volume/volume_sync.py +0 -0
  355. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/harbor.py +0 -0
  356. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/inspect_ai.py +0 -0
  357. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/__init__.py +0 -0
  358. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/__main__.py +0 -0
  359. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/_async.py +0 -0
  360. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/_dual.py +0 -0
  361. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/_fs_async.py +0 -0
  362. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/_fs_common.py +0 -0
  363. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/_fs_sync.py +0 -0
  364. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/_functions.py +0 -0
  365. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/_job_runner.py +0 -0
  366. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/_lookup.py +0 -0
  367. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/_object.py +0 -0
  368. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/_probe.py +0 -0
  369. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/_snapshot.py +0 -0
  370. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/_tunnel.py +0 -0
  371. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/app.py +0 -0
  372. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/cloud_bucket_mount.py +0 -0
  373. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/container_process.py +0 -0
  374. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/exception.py +0 -0
  375. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/file_pattern_matcher.py +0 -0
  376. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/image.py +0 -0
  377. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/io_streams.py +0 -0
  378. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/output.py +0 -0
  379. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/proxy.py +0 -0
  380. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/sandbox/__init__.py +0 -0
  381. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/sandbox/sandbox.py +0 -0
  382. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/sandbox_fs.py +0 -0
  383. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/secret.py +0 -0
  384. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/snapshot.py +0 -0
  385. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/stream_type.py +0 -0
  386. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/types.py +0 -0
  387. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/modal/volume.py +0 -0
  388. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/morph/__init__.py +0 -0
  389. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/morph/api.py +0 -0
  390. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/openai_agents.py +0 -0
  391. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/prime/__init__.py +0 -0
  392. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/prime/_async.py +0 -0
  393. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/prime/_sync.py +0 -0
  394. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/prime/core/__init__.py +0 -0
  395. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/prime/core/client.py +0 -0
  396. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/prime/exceptions.py +0 -0
  397. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/prime/models.py +0 -0
  398. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/prime/process.py +0 -0
  399. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/prime/sandbox.py +0 -0
  400. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/py.typed +0 -0
  401. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/runloop/__init__.py +0 -0
  402. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/runloop/_async.py +0 -0
  403. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/runloop/_exceptions.py +0 -0
  404. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/runloop/_snapshots.py +0 -0
  405. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/runloop/_sync.py +0 -0
  406. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/runloop/_v2.py +0 -0
  407. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/runloop/lib/__init__.py +0 -0
  408. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/runloop/lib/polling.py +0 -0
  409. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/runloop/sdk/__init__.py +0 -0
  410. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/sprites/__init__.py +0 -0
  411. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/sprites/_capture.py +0 -0
  412. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/sprites/_capture_async.py +0 -0
  413. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/sprites/_features.py +0 -0
  414. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/sprites/_metadata.py +0 -0
  415. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/sprites/_stream.py +0 -0
  416. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/sprites/_stream_async.py +0 -0
  417. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/sprites/_translate.py +0 -0
  418. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/sprites/async_client.py +0 -0
  419. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/sprites/async_exec.py +0 -0
  420. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/sprites/client.py +0 -0
  421. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/sprites/control.py +0 -0
  422. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/sprites/exceptions.py +0 -0
  423. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/sprites/exec.py +0 -0
  424. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/sprites/filesystem.py +0 -0
  425. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/sprites/sprite.py +0 -0
  426. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/sprites/types.py +0 -0
  427. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/tools.py +0 -0
  428. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/vercel/__init__.py +0 -0
  429. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/vercel/_async_io.py +0 -0
  430. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/vercel/_async_sandbox.py +0 -0
  431. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/vercel/_core.py +0 -0
  432. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/vercel/_sync_io.py +0 -0
  433. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/vercel/_sync_sandbox.py +0 -0
  434. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/vercel/api.py +0 -0
  435. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/vercel/sandbox/__init__.py +0 -0
  436. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/vercel/sandbox/sync.py +0 -0
  437. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/wallet.py +0 -0
  438. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime/webhooks.py +0 -0
  439. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime.egg-info/SOURCES.txt +0 -0
  440. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime.egg-info/dependency_links.txt +0 -0
  441. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime.egg-info/entry_points.txt +0 -0
  442. {withruntime-0.43.0 → withruntime-0.44.0}/withruntime.egg-info/requires.txt +0 -0
  443. {withruntime-0.43.0 → withruntime-0.44.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.43.0
3
+ Version: 0.44.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.43.0"
7
+ version = "0.44.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" }
@@ -13,7 +13,7 @@ import zipfile
13
13
 
14
14
 
15
15
  ROOT = Path(__file__).resolve().parents[1]
16
- VERSION = "0.43.0"
16
+ VERSION = "0.44.0"
17
17
  MAX_ARTIFACT_BYTES = 16 * 1024 * 1024
18
18
  MAX_FILE_BYTES = 4 * 1024 * 1024
19
19
  MAX_METADATA_BYTES = 256 * 1024
@@ -36,6 +36,7 @@ from ._http import NoAnswerStarted, Origin, default_base_url, reachable
36
36
  from ._proxy import describe as describe_route
37
37
  from ._renamed import renamed
38
38
  from ._unpack import Unpacker
39
+ from ._ws import AsyncResumableWebSocket
39
40
  from ._ws import AsyncWebSocket as WebSocket
40
41
  from ._tunnel import AsyncPortForward
41
42
  from ._trace import trace_headers
@@ -497,10 +498,14 @@ class _Transport:
497
498
  finally:
498
499
  await hold.lend()
499
500
 
500
- async def websocket(self, path: str, query: dict[str, Any]) -> WebSocket:
501
- socket = WebSocket(self.origin, path + _query(query), {
502
- "Authorization": "Bearer " + self._api_key(), "X-Runtime-Client": f"sdk-python/{VERSION}"})
503
- return await open_ws(socket)
501
+ async def websocket(self, path: str, query: dict[str, Any]) -> AsyncResumableWebSocket:
502
+ """A terminal's or tunnel's WebSocket. It resumes across a restart of
503
+ the API with nothing lost or repeated (_ws.py)."""
504
+ async def connect(resume: Optional[str]) -> WebSocket:
505
+ socket = WebSocket(self.origin, path + _query({"resume": resume} if resume else query), {
506
+ "Authorization": "Bearer " + self._api_key(), "X-Runtime-Client": f"sdk-python/{VERSION}"})
507
+ return await open_ws(socket)
508
+ return await AsyncResumableWebSocket(connect).connect()
504
509
 
505
510
  async def close(self) -> None:
506
511
  await self._http.close()
@@ -964,7 +969,7 @@ class AsyncProcess:
964
969
  class AsyncTerminal:
965
970
  """An interactive terminal over a WebSocket: write() types, recv() reads."""
966
971
 
967
- def __init__(self, socket: WebSocket, process_id: Optional[str]) -> None:
972
+ def __init__(self, socket: AsyncResumableWebSocket, process_id: Optional[str]) -> None:
968
973
  self._socket, self.process_id = socket, process_id
969
974
  self.exit_code: Optional[int] = None
970
975
 
@@ -35,6 +35,7 @@ from ._http import NoAnswerStarted, Origin, default_base_url, reachable
35
35
  from ._proxy import describe as describe_route
36
36
  from ._renamed import renamed
37
37
  from ._unpack import Unpacker
38
+ from ._ws import ResumableWebSocket
38
39
  from ._ws import SyncWebSocket as WebSocket
39
40
  from ._tunnel import PortForward
40
41
  from ._trace import trace_headers
@@ -496,10 +497,14 @@ class _Transport:
496
497
  finally:
497
498
  hold.lend()
498
499
 
499
- def websocket(self, path: str, query: dict[str, Any]) -> WebSocket:
500
- socket = WebSocket(self.origin, path + _query(query), {
501
- "Authorization": "Bearer " + self._api_key(), "X-Runtime-Client": f"sdk-python/{VERSION}"})
502
- return open_ws(socket)
500
+ def websocket(self, path: str, query: dict[str, Any]) -> ResumableWebSocket:
501
+ """A terminal's or tunnel's WebSocket. It resumes across a restart of
502
+ the API with nothing lost or repeated (_ws.py)."""
503
+ def connect(resume: Optional[str]) -> WebSocket:
504
+ socket = WebSocket(self.origin, path + _query({"resume": resume} if resume else query), {
505
+ "Authorization": "Bearer " + self._api_key(), "X-Runtime-Client": f"sdk-python/{VERSION}"})
506
+ return open_ws(socket)
507
+ return ResumableWebSocket(connect).connect()
503
508
 
504
509
  def close(self) -> None:
505
510
  self._http.close()
@@ -963,7 +968,7 @@ class Process:
963
968
  class Terminal:
964
969
  """An interactive terminal over a WebSocket: write() types, recv() reads."""
965
970
 
966
- def __init__(self, socket: WebSocket, process_id: Optional[str]) -> None:
971
+ def __init__(self, socket: ResumableWebSocket, process_id: Optional[str]) -> None:
967
972
  self._socket, self.process_id = socket, process_id
968
973
  self.exit_code: Optional[int] = None
969
974
 
@@ -0,0 +1 @@
1
+ VERSION = "0.44.0"
@@ -0,0 +1,403 @@
1
+ """A minimal RFC 6455 WebSocket client (client frames masked), for terminals
2
+ and tunnels, and the socket over it that resumes across a restart of the API.
3
+ Standard library only; sync over sockets, async over asyncio streams."""
4
+ from __future__ import annotations
5
+
6
+ import base64
7
+ import json
8
+ import os
9
+ import socket
10
+ import struct
11
+ import threading
12
+ import time
13
+ from typing import Any, Awaitable, Callable, Optional, Tuple
14
+
15
+ from ._http import Origin, _context, open_stream, within
16
+ from ._proxy import route_for, tunnel
17
+
18
+
19
+ def _handshake(origin: Origin, target: str, headers: dict[str, str]) -> Tuple[bytes, str]:
20
+ key = base64.b64encode(os.urandom(16)).decode()
21
+ lines = [f"GET {target} HTTP/1.1", f"Host: {origin.netloc}", "Upgrade: websocket", "Connection: Upgrade",
22
+ f"Sec-WebSocket-Key: {key}", "Sec-WebSocket-Version: 13"]
23
+ lines += [f"{k}: {v}" for k, v in headers.items()]
24
+ return ("\r\n".join(lines) + "\r\n\r\n").encode("latin-1"), key
25
+
26
+
27
+ def _frame(opcode: int, payload: bytes) -> bytes:
28
+ mask = os.urandom(4)
29
+ length = len(payload)
30
+ if length < 126:
31
+ head = struct.pack("!BB", 0x80 | opcode, 0x80 | length)
32
+ elif length < 65536:
33
+ head = struct.pack("!BBH", 0x80 | opcode, 0x80 | 126, length)
34
+ else:
35
+ head = struct.pack("!BBQ", 0x80 | opcode, 0x80 | 127, length)
36
+ return head + mask + bytes(b ^ mask[i % 4] for i, b in enumerate(payload))
37
+
38
+
39
+ def _close_code(payload: bytes) -> int:
40
+ return struct.unpack("!H", payload[:2])[0] if len(payload) >= 2 else 1005
41
+
42
+
43
+ class SyncWebSocket:
44
+ def __init__(self, origin: Origin, target: str, headers: dict[str, str], timeout: float = 30) -> None:
45
+ route = route_for(origin.tls, origin.host, origin.port)
46
+ raw = (tunnel(route, origin.host, origin.port, timeout) if route.proxy_host
47
+ else socket.create_connection((origin.host, origin.port), timeout=timeout))
48
+ self._sock: socket.socket = _context().wrap_socket(raw, server_hostname=origin.host) if origin.tls else raw
49
+ request, _ = _handshake(origin, target, headers)
50
+ self._sock.sendall(request)
51
+ response = b""
52
+ while b"\r\n\r\n" not in response:
53
+ chunk = self._sock.recv(4096)
54
+ if not chunk:
55
+ raise ConnectionError("WebSocket handshake closed")
56
+ response += chunk
57
+ head, self._buffer = response.split(b"\r\n\r\n", 1)
58
+ status = head.split(b"\r\n", 1)[0]
59
+ if b" 101 " not in status + b" ":
60
+ raise ConnectionRefusedError(head.decode("latin-1", "replace").split("\r\n", 1)[0])
61
+ self._sock.settimeout(None)
62
+ self.closed = False
63
+ self.close_code: Optional[int] = None
64
+
65
+ def _read(self, n: int) -> bytes:
66
+ while len(self._buffer) < n:
67
+ chunk = self._sock.recv(65536)
68
+ if not chunk:
69
+ raise ConnectionResetError("WebSocket closed")
70
+ self._buffer += chunk
71
+ data, self._buffer = self._buffer[:n], self._buffer[n:]
72
+ return data
73
+
74
+ def send(self, data: bytes | str) -> None:
75
+ self._sock.sendall(_frame(0x1, data.encode()) if isinstance(data, str) else _frame(0x2, data))
76
+
77
+ def recv(self) -> Optional[bytes | str]:
78
+ """The next message: bytes, str, or None once the socket closed."""
79
+ while True:
80
+ try:
81
+ first, second = self._read(2)
82
+ except (ConnectionResetError, OSError):
83
+ self.closed = True
84
+ return None
85
+ length = second & 0x7F
86
+ if length == 126:
87
+ length = struct.unpack("!H", self._read(2))[0]
88
+ elif length == 127:
89
+ length = struct.unpack("!Q", self._read(8))[0]
90
+ payload = self._read(length)
91
+ opcode = first & 0x0F
92
+ if opcode == 0x8:
93
+ self.closed = True
94
+ self.close_code = _close_code(payload)
95
+ try:
96
+ self._sock.sendall(_frame(0x8, payload[:2]))
97
+ except OSError:
98
+ pass
99
+ return None
100
+ if opcode == 0x9:
101
+ self._sock.sendall(_frame(0xA, payload))
102
+ continue
103
+ if opcode == 0x1:
104
+ return payload.decode("utf-8", "replace")
105
+ if opcode in (0x0, 0x2):
106
+ return payload
107
+
108
+ def close(self) -> None:
109
+ if not self.closed:
110
+ try:
111
+ self._sock.sendall(_frame(0x8, struct.pack("!H", 1000)))
112
+ except OSError:
113
+ pass
114
+ self.closed = True
115
+ self._sock.close()
116
+
117
+
118
+ class AsyncWebSocket:
119
+ def __init__(self, origin: Origin, target: str, headers: dict[str, str], timeout: float = 30) -> None:
120
+ self._origin, self._target, self._headers, self._timeout = origin, target, headers, timeout
121
+ self.closed = False
122
+ self.close_code: Optional[int] = None
123
+
124
+ async def connect(self) -> "AsyncWebSocket":
125
+ self._reader, self._writer = await open_stream(self._origin, self._timeout)
126
+ request, _ = _handshake(self._origin, self._target, self._headers)
127
+ self._writer.write(request)
128
+ await self._writer.drain()
129
+ head = await within(self._reader.readuntil(b"\r\n\r\n"), self._timeout)
130
+ if b" 101 " not in head.split(b"\r\n", 1)[0] + b" ":
131
+ raise ConnectionRefusedError(head.decode("latin-1", "replace").split("\r\n", 1)[0])
132
+ return self
133
+
134
+ async def send(self, data: bytes | str) -> None:
135
+ self._writer.write(_frame(0x1, data.encode()) if isinstance(data, str) else _frame(0x2, data))
136
+ await self._writer.drain()
137
+
138
+ async def recv(self) -> Optional[bytes | str]:
139
+ import asyncio
140
+ while True:
141
+ try:
142
+ first, second = await self._reader.readexactly(2)
143
+ except (asyncio.IncompleteReadError, ConnectionError):
144
+ self.closed = True
145
+ return None
146
+ length = second & 0x7F
147
+ if length == 126:
148
+ length = struct.unpack("!H", await self._reader.readexactly(2))[0]
149
+ elif length == 127:
150
+ length = struct.unpack("!Q", await self._reader.readexactly(8))[0]
151
+ payload = await self._reader.readexactly(length)
152
+ opcode = first & 0x0F
153
+ if opcode == 0x8:
154
+ self.closed = True
155
+ self.close_code = _close_code(payload)
156
+ return None
157
+ if opcode == 0x9:
158
+ self._writer.write(_frame(0xA, payload))
159
+ continue
160
+ if opcode == 0x1:
161
+ return payload.decode("utf-8", "replace")
162
+ if opcode in (0x0, 0x2):
163
+ return payload
164
+
165
+ async def close(self) -> None:
166
+ if not self.closed:
167
+ try:
168
+ self._writer.write(_frame(0x8, struct.pack("!H", 1000)))
169
+ await self._writer.drain()
170
+ except OSError:
171
+ pass
172
+ self.closed = True
173
+ self._writer.close()
174
+
175
+
176
+ # A terminal's or tunnel's socket that outlives a restart of the API behind it
177
+ # (packages/cloud/src/api/tunnels.ts, "Hand-off"): the API sends {"type":"restart"},
178
+ # this side stops sending, buffers what the caller writes and answers
179
+ # {"type":"restart"}; the API sends {"type":"resume","token":...,"replay":...}
180
+ # and closes with 1012 (Service Restart); this side opens the socket again with
181
+ # ?resume=<token>, sends {"type":"replay"} first when there was input the API
182
+ # had not yet written, then what it buffered. Output and streams continue from
183
+ # the exact byte they stopped at, and the caller sees no close.
184
+
185
+ #: RFC 6455 close code 1012, Service Restart.
186
+ SERVICE_RESTART = 1012
187
+ #: How long reconnecting may take before the socket reads as closed.
188
+ RESUME_SECONDS = 25.0
189
+
190
+
191
+ def _refused_for_good(error: OSError) -> bool:
192
+ """A 4xx answer to the upgrade other than 429: the token or the sandbox
193
+ is not good, and asking again changes nothing."""
194
+ parts = str(error).split(" ")
195
+ status = int(parts[1]) if len(parts) > 1 and parts[1].isdigit() else 0
196
+ return 400 <= status < 500 and status != 429
197
+
198
+
199
+ def _control(message: Any) -> dict[str, Any]:
200
+ if not isinstance(message, str):
201
+ return {}
202
+ try:
203
+ event = json.loads(message)
204
+ except ValueError:
205
+ return {}
206
+ return event if isinstance(event, dict) else {}
207
+
208
+
209
+ class ResumableWebSocket:
210
+ """send(), recv() and close() of a WebSocket, resumed across a restart of
211
+ the API. ``open(resume)`` opens the API's socket, with the token once
212
+ there is one. Thread-safe for one reader and any number of senders."""
213
+
214
+ def __init__(self, open: Callable[[Optional[str]], Any]) -> None:
215
+ self._open = open
216
+ self._socket: Any = None
217
+ self._lock = threading.Lock()
218
+ self._paused = False
219
+ self._outbox: list[bytes | str] = []
220
+ self._token: Optional[str] = None
221
+ self._replay: Optional[str] = None
222
+ self._said: Optional[str] = None
223
+ self.closed = False
224
+ #: Times it resumed, and of those how many replayed unwritten input.
225
+ self.resumes = 0
226
+ self.replays = 0
227
+
228
+ def connect(self) -> "ResumableWebSocket":
229
+ self._socket = self._open(None)
230
+ return self
231
+
232
+ def send(self, data: bytes | str) -> None:
233
+ with self._lock:
234
+ if self.closed:
235
+ return
236
+ if self._paused:
237
+ self._outbox.append(data)
238
+ else:
239
+ self._socket.send(data)
240
+
241
+ def recv(self) -> Optional[bytes | str]:
242
+ """The next message, or None once the socket closed for good."""
243
+ while not self.closed:
244
+ message = self._socket.recv()
245
+ if message is None:
246
+ if self._socket.close_code == SERVICE_RESTART and self._token and self._resume():
247
+ continue
248
+ self.closed = True
249
+ said, self._said = self._said, None
250
+ return said
251
+ event = _control(message)
252
+ if event.get("type") == "restart":
253
+ with self._lock:
254
+ self._paused = True
255
+ self._socket.send(json.dumps({"type": "restart"}))
256
+ continue
257
+ if event.get("type") == "resume" and isinstance(event.get("token"), str):
258
+ self._token = event["token"]
259
+ self._replay = event.get("replay") if isinstance(event.get("replay"), str) else None
260
+ continue
261
+ return message
262
+ return None
263
+
264
+ def _resume(self) -> bool:
265
+ token, replay = self._token, self._replay
266
+ self._token = self._replay = None
267
+ deadline, wait = time.monotonic() + RESUME_SECONDS, 0.05
268
+ while time.monotonic() < deadline and not self.closed:
269
+ try:
270
+ socket = self._open(token)
271
+ except OSError as error:
272
+ if _refused_for_good(error):
273
+ return False
274
+ socket = None
275
+ if socket is not None:
276
+ # A server that never answers must not hold this past the deadline.
277
+ socket._sock.settimeout(max(0.1, deadline - time.monotonic()))
278
+ first = socket.recv()
279
+ socket._sock.settimeout(None)
280
+ event = _control(first)
281
+ if event.get("type") == "ready" and event.get("resumed") is True:
282
+ with self._lock:
283
+ if self.closed:
284
+ socket.close()
285
+ return False
286
+ self._socket = socket
287
+ self.resumes += 1
288
+ if replay:
289
+ self.replays += 1
290
+ socket.send(json.dumps({"type": "replay", "data": replay}))
291
+ for data in self._outbox:
292
+ socket.send(data)
293
+ self._outbox, self._paused = [], False
294
+ return True
295
+ socket.close()
296
+ if event.get("type") == "error":
297
+ # Refused for good (the sandbox stopped, say): the
298
+ # caller reads the error, as on any socket.
299
+ self._said = first
300
+ return False
301
+ time.sleep(wait)
302
+ wait = min(wait * 2, 1.0)
303
+ return False
304
+
305
+ def close(self) -> None:
306
+ with self._lock:
307
+ self.closed = True
308
+ self._outbox = []
309
+ self._socket.close()
310
+
311
+
312
+ class AsyncResumableWebSocket:
313
+ """ResumableWebSocket for asyncio."""
314
+
315
+ def __init__(self, open: Callable[[Optional[str]], Awaitable[Any]]) -> None:
316
+ self._open = open
317
+ self._socket: Any = None
318
+ self._paused = False
319
+ self._outbox: list[bytes | str] = []
320
+ self._token: Optional[str] = None
321
+ self._replay: Optional[str] = None
322
+ self._said: Optional[str] = None
323
+ self.closed = False
324
+ self.resumes = 0
325
+ self.replays = 0
326
+
327
+ async def connect(self) -> "AsyncResumableWebSocket":
328
+ self._socket = await self._open(None)
329
+ return self
330
+
331
+ async def send(self, data: bytes | str) -> None:
332
+ if self.closed:
333
+ return
334
+ if self._paused:
335
+ self._outbox.append(data)
336
+ else:
337
+ await self._socket.send(data)
338
+
339
+ async def recv(self) -> Optional[bytes | str]:
340
+ while not self.closed:
341
+ message = await self._socket.recv()
342
+ if message is None:
343
+ if self._socket.close_code == SERVICE_RESTART and self._token and await self._resume():
344
+ continue
345
+ self.closed = True
346
+ said, self._said = self._said, None
347
+ return said
348
+ event = _control(message)
349
+ if event.get("type") == "restart":
350
+ self._paused = True
351
+ await self._socket.send(json.dumps({"type": "restart"}))
352
+ continue
353
+ if event.get("type") == "resume" and isinstance(event.get("token"), str):
354
+ self._token = event["token"]
355
+ self._replay = event.get("replay") if isinstance(event.get("replay"), str) else None
356
+ continue
357
+ return message
358
+ return None
359
+
360
+ async def _resume(self) -> bool:
361
+ import asyncio
362
+ token, replay = self._token, self._replay
363
+ self._token = self._replay = None
364
+ deadline, wait = time.monotonic() + RESUME_SECONDS, 0.05
365
+ while time.monotonic() < deadline and not self.closed:
366
+ try:
367
+ socket = await self._open(token)
368
+ except OSError as error:
369
+ if _refused_for_good(error):
370
+ return False
371
+ socket = None
372
+ if socket is not None:
373
+ try:
374
+ first = await within(socket.recv(), max(0.1, deadline - time.monotonic()))
375
+ except (asyncio.TimeoutError, TimeoutError):
376
+ first = None
377
+ event = _control(first)
378
+ if event.get("type") == "ready" and event.get("resumed") is True:
379
+ if self.closed:
380
+ await socket.close()
381
+ return False
382
+ self._socket = socket
383
+ self.resumes += 1
384
+ if replay:
385
+ self.replays += 1
386
+ await socket.send(json.dumps({"type": "replay", "data": replay}))
387
+ # Senders append while these go out; the loop takes them too.
388
+ while self._outbox:
389
+ await socket.send(self._outbox.pop(0))
390
+ self._paused = False
391
+ return True
392
+ await socket.close()
393
+ if event.get("type") == "error":
394
+ self._said = first
395
+ return False
396
+ await asyncio.sleep(wait)
397
+ wait = min(wait * 2, 1.0)
398
+ return False
399
+
400
+ async def close(self) -> None:
401
+ self.closed = True
402
+ self._outbox = []
403
+ await self._socket.close()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: withruntime
3
- Version: 0.43.0
3
+ Version: 0.44.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
@@ -1 +0,0 @@
1
- VERSION = "0.43.0"
@@ -1,161 +0,0 @@
1
- """A minimal RFC 6455 WebSocket client (client frames masked), for terminals.
2
- Standard library only; sync over sockets, async over asyncio streams."""
3
- from __future__ import annotations
4
-
5
- import base64
6
- import os
7
- import socket
8
- import struct
9
- from typing import Optional, Tuple
10
-
11
- from ._http import Origin, _context, open_stream, within
12
- from ._proxy import route_for, tunnel
13
-
14
-
15
- def _handshake(origin: Origin, target: str, headers: dict[str, str]) -> Tuple[bytes, str]:
16
- key = base64.b64encode(os.urandom(16)).decode()
17
- lines = [f"GET {target} HTTP/1.1", f"Host: {origin.netloc}", "Upgrade: websocket", "Connection: Upgrade",
18
- f"Sec-WebSocket-Key: {key}", "Sec-WebSocket-Version: 13"]
19
- lines += [f"{k}: {v}" for k, v in headers.items()]
20
- return ("\r\n".join(lines) + "\r\n\r\n").encode("latin-1"), key
21
-
22
-
23
- def _frame(opcode: int, payload: bytes) -> bytes:
24
- mask = os.urandom(4)
25
- length = len(payload)
26
- if length < 126:
27
- head = struct.pack("!BB", 0x80 | opcode, 0x80 | length)
28
- elif length < 65536:
29
- head = struct.pack("!BBH", 0x80 | opcode, 0x80 | 126, length)
30
- else:
31
- head = struct.pack("!BBQ", 0x80 | opcode, 0x80 | 127, length)
32
- return head + mask + bytes(b ^ mask[i % 4] for i, b in enumerate(payload))
33
-
34
-
35
- class SyncWebSocket:
36
- def __init__(self, origin: Origin, target: str, headers: dict[str, str], timeout: float = 30) -> None:
37
- route = route_for(origin.tls, origin.host, origin.port)
38
- raw = (tunnel(route, origin.host, origin.port, timeout) if route.proxy_host
39
- else socket.create_connection((origin.host, origin.port), timeout=timeout))
40
- self._sock: socket.socket = _context().wrap_socket(raw, server_hostname=origin.host) if origin.tls else raw
41
- request, _ = _handshake(origin, target, headers)
42
- self._sock.sendall(request)
43
- response = b""
44
- while b"\r\n\r\n" not in response:
45
- chunk = self._sock.recv(4096)
46
- if not chunk:
47
- raise ConnectionError("WebSocket handshake closed")
48
- response += chunk
49
- head, self._buffer = response.split(b"\r\n\r\n", 1)
50
- status = head.split(b"\r\n", 1)[0]
51
- if b" 101 " not in status + b" ":
52
- raise ConnectionRefusedError(head.decode("latin-1", "replace").split("\r\n", 1)[0])
53
- self._sock.settimeout(None)
54
- self.closed = False
55
-
56
- def _read(self, n: int) -> bytes:
57
- while len(self._buffer) < n:
58
- chunk = self._sock.recv(65536)
59
- if not chunk:
60
- raise ConnectionResetError("WebSocket closed")
61
- self._buffer += chunk
62
- data, self._buffer = self._buffer[:n], self._buffer[n:]
63
- return data
64
-
65
- def send(self, data: bytes | str) -> None:
66
- self._sock.sendall(_frame(0x1, data.encode()) if isinstance(data, str) else _frame(0x2, data))
67
-
68
- def recv(self) -> Optional[bytes | str]:
69
- """The next message: bytes, str, or None once the socket closed."""
70
- while True:
71
- try:
72
- first, second = self._read(2)
73
- except (ConnectionResetError, OSError):
74
- self.closed = True
75
- return None
76
- length = second & 0x7F
77
- if length == 126:
78
- length = struct.unpack("!H", self._read(2))[0]
79
- elif length == 127:
80
- length = struct.unpack("!Q", self._read(8))[0]
81
- payload = self._read(length)
82
- opcode = first & 0x0F
83
- if opcode == 0x8:
84
- self.closed = True
85
- try:
86
- self._sock.sendall(_frame(0x8, payload[:2]))
87
- except OSError:
88
- pass
89
- return None
90
- if opcode == 0x9:
91
- self._sock.sendall(_frame(0xA, payload))
92
- continue
93
- if opcode == 0x1:
94
- return payload.decode("utf-8", "replace")
95
- if opcode in (0x0, 0x2):
96
- return payload
97
-
98
- def close(self) -> None:
99
- if not self.closed:
100
- try:
101
- self._sock.sendall(_frame(0x8, struct.pack("!H", 1000)))
102
- except OSError:
103
- pass
104
- self.closed = True
105
- self._sock.close()
106
-
107
-
108
- class AsyncWebSocket:
109
- def __init__(self, origin: Origin, target: str, headers: dict[str, str], timeout: float = 30) -> None:
110
- self._origin, self._target, self._headers, self._timeout = origin, target, headers, timeout
111
- self.closed = False
112
-
113
- async def connect(self) -> "AsyncWebSocket":
114
- self._reader, self._writer = await open_stream(self._origin, self._timeout)
115
- request, _ = _handshake(self._origin, self._target, self._headers)
116
- self._writer.write(request)
117
- await self._writer.drain()
118
- head = await within(self._reader.readuntil(b"\r\n\r\n"), self._timeout)
119
- if b" 101 " not in head.split(b"\r\n", 1)[0] + b" ":
120
- raise ConnectionRefusedError(head.decode("latin-1", "replace").split("\r\n", 1)[0])
121
- return self
122
-
123
- async def send(self, data: bytes | str) -> None:
124
- self._writer.write(_frame(0x1, data.encode()) if isinstance(data, str) else _frame(0x2, data))
125
- await self._writer.drain()
126
-
127
- async def recv(self) -> Optional[bytes | str]:
128
- import asyncio
129
- while True:
130
- try:
131
- first, second = await self._reader.readexactly(2)
132
- except (asyncio.IncompleteReadError, ConnectionError):
133
- self.closed = True
134
- return None
135
- length = second & 0x7F
136
- if length == 126:
137
- length = struct.unpack("!H", await self._reader.readexactly(2))[0]
138
- elif length == 127:
139
- length = struct.unpack("!Q", await self._reader.readexactly(8))[0]
140
- payload = await self._reader.readexactly(length)
141
- opcode = first & 0x0F
142
- if opcode == 0x8:
143
- self.closed = True
144
- return None
145
- if opcode == 0x9:
146
- self._writer.write(_frame(0xA, payload))
147
- continue
148
- if opcode == 0x1:
149
- return payload.decode("utf-8", "replace")
150
- if opcode in (0x0, 0x2):
151
- return payload
152
-
153
- async def close(self) -> None:
154
- if not self.closed:
155
- try:
156
- self._writer.write(_frame(0x8, struct.pack("!H", 1000)))
157
- await self._writer.drain()
158
- except OSError:
159
- pass
160
- self.closed = True
161
- self._writer.close()
File without changes