withruntime 0.17.0__tar.gz → 0.20.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.
- {withruntime-0.17.0/withruntime.egg-info → withruntime-0.20.0}/PKG-INFO +1 -1
- {withruntime-0.17.0 → withruntime-0.20.0}/pyproject.toml +1 -1
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_account_errors.py +26 -0
- withruntime-0.20.0/tests/test_agents.py +376 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_python_request_scope.py +3 -1
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_lifecycle_settings.py +45 -1
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_package_typing.py +1 -1
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_secrets.py +26 -0
- withruntime-0.20.0/withruntime/_agent_templates.py +57 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_client.py +31 -5
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/__init__.py +4 -0
- withruntime-0.20.0/withruntime/_async_products/agents.py +406 -0
- withruntime-0.20.0/withruntime/_async_products/containers.py +125 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/secrets.py +25 -1
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_eval_sandbox.py +3 -1
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_client.py +31 -5
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/__init__.py +4 -0
- withruntime-0.20.0/withruntime/_sync_products/agents.py +407 -0
- withruntime-0.20.0/withruntime/_sync_products/containers.py +126 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/secrets.py +25 -1
- withruntime-0.20.0/withruntime/_version.py +1 -0
- {withruntime-0.17.0 → withruntime-0.20.0/withruntime.egg-info}/PKG-INFO +1 -1
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime.egg-info/SOURCES.txt +6 -0
- withruntime-0.17.0/withruntime/_version.py +0 -1
- {withruntime-0.17.0 → withruntime-0.20.0}/LICENSE +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/README.md +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/setup.cfg +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_answer_start.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_apps_builds.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_async_stream_cleanup.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_audit.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_billing.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_blaxel.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_blaxel_0_4_17.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_blaxel_0_4_18.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_blaxel_create_timeout.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_blaxel_wait_deadline.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_browser.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_capacity_wait.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_live.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_modal_deadline_errors.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_new_providers.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_prime_contract.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_prime_process_lifecycle.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_prime_validation.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_python_disk_snapshots.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_python_e2b_deadline.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_python_e2b_pty.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_python_e2b_stream.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_python_e2b_watch.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_python_interpreter_deadline.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_python_modal.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_python_morph.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_python_official.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_python_pins.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_python_processes.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_python_runloop.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_python_shell.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_python_snapshot_capture.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_python_sprites.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_compat_router.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_customer_usage.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_daytona.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_daytona_0_223_1.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_daytona_0_224_1.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_daytona_0_225_0.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_daytona_create_cleanup.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_daytona_create_options.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_daytona_download_labels.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_daytona_refusals_lifted.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_deepagents.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_e2b_2_55.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_e2b_code_interpreter.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_e2b_connection_cap.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_e2b_exports.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_e2b_fork_validation.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_e2b_sandbox.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_e2b_upstream.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_e2b_watch.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_embed_and_webhook_watch.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_eval_sandbox.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_exec_stream.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_exec_stream_names.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_exec_user.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_file_archives.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_files_download.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_files_mode.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_files_upload_parallel.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_files_write_lost_body.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_harbor.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_http_tls_close.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_identity_token.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_image_delete_by_name.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_images_v2.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_images_volumes_interpreter.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_inspect_ai.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_interface_contract.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_jobs.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_late_answer.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_limits.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_machine_engine.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_modal_1_6_2.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_modal_dropin.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_mounts.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_network_funding.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_network_products.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_observability.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_openai_agents.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_out_of_memory.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_previews_network_desktop.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_prime_0_4_5.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_prime_0_4_6.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_private_network.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_process_deadline.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_process_input.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_process_object.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_process_output.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_process_write_backpressure.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_product_aliases.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_proxy.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_referrals.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_replayed_create_message.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_runloop_stream_cleanup.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_runloop_v2.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_sandbox_origin.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_sandbox_sessions.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_sandboxes_delete_all.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_sandboxes_stop_all.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_saved_connection.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_signed_requests.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_snapshot_after_fork.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_snapshot_recovery.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_sso.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_start_report_kept.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_stream_cut_short.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_stream_exit_close.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_switch_image.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_switching.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_tailscale.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_tools.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_transport_body_recovery.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_transport_connection_limits.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_transport_never_sent.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_unpack.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_upload_deadline.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_vercel.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_vercel_create_validation.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_vercel_disk_snapshot.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_vercel_refusals_lifted.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_volume_backups.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_volume_operations.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_wake_awake.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_wallet.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/tests/test_watch.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_api_defaults.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/apps.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/audit.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/billing.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/browser.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/builds.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/desktop.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/images.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/interpreter.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/jobs.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/limits.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/mcp.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/mounts.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/network.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/network_products.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/observability.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/previews.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/private_network.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/referrals.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/signed_requests.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/sso.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/switching.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/tailscale.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/volumes.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_async_products/watch.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_clock.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_compat.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_compat_lease.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_compat_lifecycle.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_compat_shell.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_connection.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_errors.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_http.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_proxy.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_renamed.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_request_scope.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/apps.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/audit.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/billing.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/browser.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/builds.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/desktop.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/images.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/interpreter.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/jobs.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/limits.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/mcp.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/mounts.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/network.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/network_products.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/observability.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/previews.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/private_network.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/referrals.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/signed_requests.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/sso.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/switching.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/tailscale.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/volumes.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_sync_products/watch.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_tunnel.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_unpack.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/_ws.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/_async_io.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/_async_sandbox.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/_core.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/_sync_io.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/_sync_sandbox.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/agents.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/api/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/api/applications/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/api/applications/list_application_revisions.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/api/compute/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/api/compute/get_sandbox.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/api/compute/update_sandbox.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/api/functions/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/api/functions/create_function.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/api/images.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/api/workspaces.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/client.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/models/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/models/create_job_execution_request.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/models/create_job_execution_request_env.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/models/env.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/models/function.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/models/function_runtime.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/models/function_spec.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/models/metadata.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/models/pagination_meta.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/models/workspace.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/pagination.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/client/types.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/common.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/drive.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/errors.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/jobs.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/sandbox/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/sandbox/types.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/core/secret.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/crewai.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/googleadk.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/langgraph.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/livekit.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/llamaindex.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/openai.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/pydantic.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/blaxel/telemetry.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/daytona/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/daytona/_async_daytona.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/daytona/_async_io.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/daytona/_core.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/daytona/_sync_daytona.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/daytona/_sync_io.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/deepagents.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/_async_io.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/_async_sandbox.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/_core.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/_sync_io.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/_sync_sandbox.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/code_interpreter/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/code_interpreter/_async_ci.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/code_interpreter/_models.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/code_interpreter/_sync_ci.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/code_interpreter/charts.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/code_interpreter/code_interpreter_async.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/code_interpreter/code_interpreter_sync.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/code_interpreter/models.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/connection_config.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/exceptions.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox/commands/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox/commands/command_handle.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox/commands/main.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox/filesystem/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox/filesystem/filesystem.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox/filesystem/watch_handle.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox/network.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox/sandbox_api.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox/signature.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_async/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_async/commands/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_async/commands/command.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_async/commands/command_handle.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_async/commands/pty.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_async/filesystem/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_async/filesystem/filesystem.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_async/filesystem/watch_handle.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_async/main.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_async/paginator.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_async/utils.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_sync/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_sync/commands/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_sync/commands/command.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_sync/commands/command_handle.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_sync/commands/pty.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_sync/filesystem/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_sync/filesystem/filesystem.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_sync/filesystem/watch_handle.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_sync/git.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_sync/main.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/sandbox_sync/paginator.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/secret/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/template/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/template/dockerfile_parser.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/template/logger.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/template/main.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/template/readycmd.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/template/types.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/template_async/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/template_async/main.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/template_sync/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/template_sync/main.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/volume/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/volume/connection_config.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/volume/types.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/volume/volume_async.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/e2b/volume/volume_sync.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/harbor.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/inspect_ai.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/_async.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/_dual.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/_fs_async.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/_fs_common.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/_fs_sync.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/_lookup.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/_object.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/_probe.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/_snapshot.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/_tunnel.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/app.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/cloud_bucket_mount.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/exception.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/file_pattern_matcher.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/image.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/proxy.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/sandbox/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/sandbox/sandbox.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/sandbox_fs.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/secret.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/snapshot.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/types.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/modal/volume.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/morph/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/morph/api.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/openai_agents.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/prime/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/prime/_async.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/prime/_sync.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/prime/core/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/prime/core/client.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/prime/exceptions.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/prime/models.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/prime/process.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/prime/sandbox.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/py.typed +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/runloop/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/runloop/_async.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/runloop/_exceptions.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/runloop/_snapshots.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/runloop/_sync.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/runloop/_v2.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/runloop/lib/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/runloop/lib/polling.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/runloop/sdk/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/sprites/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/sprites/_capture.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/sprites/_capture_async.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/sprites/_features.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/sprites/_metadata.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/sprites/_stream.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/sprites/_stream_async.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/sprites/_translate.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/sprites/async_client.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/sprites/async_exec.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/sprites/client.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/sprites/control.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/sprites/exceptions.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/sprites/exec.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/sprites/filesystem.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/sprites/sprite.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/sprites/types.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/tools.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/vercel/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/vercel/_async_io.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/vercel/_async_sandbox.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/vercel/_core.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/vercel/_sync_io.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/vercel/_sync_sandbox.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/vercel/api.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/vercel/sandbox/__init__.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/vercel/sandbox/sync.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/wallet.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime/webhooks.py +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime.egg-info/dependency_links.txt +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime.egg-info/entry_points.txt +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime.egg-info/requires.txt +0 -0
- {withruntime-0.17.0 → withruntime-0.20.0}/withruntime.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "withruntime"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.20.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" }
|
|
@@ -42,5 +42,31 @@ class AccountCloseTest(unittest.TestCase):
|
|
|
42
42
|
self.assertTrue(hasattr(withruntime.Runtime(api_key="rk_x"), "account"))
|
|
43
43
|
|
|
44
44
|
|
|
45
|
+
class AccountEmailsTest(unittest.TestCase):
|
|
46
|
+
"""runtime.account.emails (0921): read the key's person's optional emails,
|
|
47
|
+
or turn one on or off."""
|
|
48
|
+
|
|
49
|
+
def test_reads_and_changes_one(self) -> None:
|
|
50
|
+
from withruntime._sync_client import Account
|
|
51
|
+
|
|
52
|
+
calls: list[tuple[Any, ...]] = []
|
|
53
|
+
settings = [{"category": "own-deletions", "enabled": False, "updatedAt": None}]
|
|
54
|
+
|
|
55
|
+
class Transport:
|
|
56
|
+
def json(self, method: str, path: str, **kwargs: Any) -> dict[str, Any]:
|
|
57
|
+
calls.append((method, path, kwargs))
|
|
58
|
+
return {"settings": settings}
|
|
59
|
+
|
|
60
|
+
account = Account(Transport()) # type: ignore[arg-type]
|
|
61
|
+
self.assertEqual(account.emails(), settings)
|
|
62
|
+
self.assertEqual(account.emails("own-deletions", False), settings)
|
|
63
|
+
self.assertEqual(calls, [
|
|
64
|
+
("GET", "/v1/account/emails", {}),
|
|
65
|
+
("POST", "/v1/account/emails:update", {"body": {"category": "own-deletions", "enabled": False}}),
|
|
66
|
+
])
|
|
67
|
+
with self.assertRaises(ValueError):
|
|
68
|
+
account.emails("billing")
|
|
69
|
+
|
|
70
|
+
|
|
45
71
|
if __name__ == "__main__":
|
|
46
72
|
unittest.main()
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
"""runtime.agents against a stub API, sync and async: every route with the
|
|
2
|
+
API's names, paging by ``nextCursor``, the log followed by long polls until the
|
|
3
|
+
session ends, wait(), the refusals as the SDK's own errors, and the templates
|
|
4
|
+
held to the guide's copy (packages/cloud-guide/agent-templates.json)."""
|
|
5
|
+
import asyncio
|
|
6
|
+
import json
|
|
7
|
+
import threading
|
|
8
|
+
import unittest
|
|
9
|
+
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from urllib.parse import parse_qs, urlsplit
|
|
12
|
+
|
|
13
|
+
from withruntime import (AsyncRuntime, AuthenticationError, ConflictError, InvalidRequestError, NotFoundError,
|
|
14
|
+
PermissionDeniedError, RateLimitError, Runtime)
|
|
15
|
+
from withruntime import RuntimeError as RuntimeAPIError
|
|
16
|
+
|
|
17
|
+
AGENT_ID = "11111111-1111-4111-8111-111111111111"
|
|
18
|
+
SESSION_ID = "22222222-2222-4222-8222-222222222222"
|
|
19
|
+
CHILD_ID = "44444444-4444-4444-8444-444444444444"
|
|
20
|
+
TRIGGER_ID = "33333333-3333-4333-8333-333333333333"
|
|
21
|
+
AGENT = {"id": AGENT_ID, "name": "dev", "version": 1, "definition": {"command": "run"}, "labels": {},
|
|
22
|
+
"createdAt": "2026-10-18T00:00:00Z", "updatedAt": "2026-10-18T00:00:00Z"}
|
|
23
|
+
TRIGGER = {"id": TRIGGER_ID, "agentId": AGENT_ID, "kind": "github",
|
|
24
|
+
"config": {"repository": "acme/web", "installation": 42}, "pausedAt": None, "pausedWhy": None,
|
|
25
|
+
"createdAt": "2026-10-18T00:00:00Z"}
|
|
26
|
+
GUIDE = Path(__file__).resolve().parents[3] / "packages" / "cloud-guide" / "agent-templates.json"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def session(state="running", last_seq=1):
|
|
30
|
+
return {"id": SESSION_ID, "agentId": AGENT_ID, "agentVersion": 1, "key": None, "trigger": "api",
|
|
31
|
+
"state": state, "reason": None, "result": None, "sandboxId": None, "lastSeq": last_seq,
|
|
32
|
+
"labels": {}, "createdAt": "2026-10-18T00:00:00Z", "startedAt": None, "endedAt": None,
|
|
33
|
+
"parentSessionId": None, "rootSessionId": SESSION_ID, "depth": 0,
|
|
34
|
+
"cost": {"dollars": 0.25, "vcpuSeconds": 120, "gibSeconds": 240},
|
|
35
|
+
"treeCost": {"dollars": 0.75, "vcpuSeconds": 360, "gibSeconds": 720},
|
|
36
|
+
"historyBytes": 2048, "attachmentBytes": 4096, "stopWhy": None, "deletedAt": None}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def child(**fields):
|
|
40
|
+
"""A session its parent's harness started, as the API answers it."""
|
|
41
|
+
return {**session("done", 4), "id": CHILD_ID, "trigger": "spawn", "parentSessionId": SESSION_ID, "depth": 1,
|
|
42
|
+
**fields}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def event(seq, kind="reply", text="hi"):
|
|
46
|
+
return {"seq": seq, "kind": kind, "actor": "agent", "body": {"text": text}, "createdAt": "2026-10-18T00:00:00Z"}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
REFUSALS = {
|
|
50
|
+
"beta": (403, "product_in_beta", PermissionDeniedError),
|
|
51
|
+
"denied": (403, "permission_denied", PermissionDeniedError),
|
|
52
|
+
"missing": (404, "not_found", NotFoundError),
|
|
53
|
+
"ended": (409, "session_ended", ConflictError),
|
|
54
|
+
"taken": (409, "name_taken", ConflictError),
|
|
55
|
+
"paused": (409, "trigger_paused", ConflictError),
|
|
56
|
+
"uninstalled": (409, "not_installed", ConflictError),
|
|
57
|
+
"budget": (409, "budget_reached", ConflictError),
|
|
58
|
+
"open": (409, "session_open", ConflictError),
|
|
59
|
+
"quota": (429, "quota_exceeded", RateLimitError),
|
|
60
|
+
"invalid": (400, "invalid_request", InvalidRequestError),
|
|
61
|
+
"refused": (401, "unauthorized", AuthenticationError),
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class Stub(BaseHTTPRequestHandler):
|
|
66
|
+
seen: list = []
|
|
67
|
+
mode = "ok"
|
|
68
|
+
# Each read of the log answers the next of these pages; each read of the
|
|
69
|
+
# session the next of these states. The last of each repeats.
|
|
70
|
+
pages: list = []
|
|
71
|
+
states: list = []
|
|
72
|
+
# When set, what a read of one session answers.
|
|
73
|
+
record = None
|
|
74
|
+
|
|
75
|
+
def log_message(self, *args):
|
|
76
|
+
pass
|
|
77
|
+
|
|
78
|
+
def answer(self, value, status=200):
|
|
79
|
+
data = b"" if value is None else json.dumps(value).encode()
|
|
80
|
+
self.send_response(status)
|
|
81
|
+
self.send_header("content-type", "application/json")
|
|
82
|
+
self.send_header("content-length", str(len(data)))
|
|
83
|
+
self.end_headers()
|
|
84
|
+
self.wfile.write(data)
|
|
85
|
+
|
|
86
|
+
def handle_any(self):
|
|
87
|
+
length = int(self.headers.get("content-length") or 0)
|
|
88
|
+
body = json.loads(self.rfile.read(length)) if length else None
|
|
89
|
+
url = urlsplit(self.path)
|
|
90
|
+
path, query = url.path, parse_qs(url.query)
|
|
91
|
+
Stub.seen.append((self.command, path, query, body, self.headers.get("idempotency-key")))
|
|
92
|
+
if Stub.mode in REFUSALS:
|
|
93
|
+
status, code, _ = REFUSALS[Stub.mode]
|
|
94
|
+
return self.answer({"error": {"code": code, "message": f"refused: {code}", "hint": "h"}}, status)
|
|
95
|
+
method = self.command
|
|
96
|
+
if path == "/v1/agents" and method == "GET":
|
|
97
|
+
if "cursor" in query:
|
|
98
|
+
return self.answer({"data": [{**AGENT, "id": "second", "warnings": ["subscription_for_customers"]}],
|
|
99
|
+
"nextCursor": None})
|
|
100
|
+
return self.answer({"data": [AGENT], "nextCursor": "page-2"})
|
|
101
|
+
if path == "/v1/agents/sessions" and method == "GET":
|
|
102
|
+
if "cursor" in query:
|
|
103
|
+
return self.answer({"data": [{**session(), "id": "second"}], "nextCursor": None})
|
|
104
|
+
return self.answer({"data": [session()], "nextCursor": "page-2"})
|
|
105
|
+
if path.endswith("/events"):
|
|
106
|
+
page = Stub.pages.pop(0) if len(Stub.pages) > 1 else Stub.pages[0]
|
|
107
|
+
return self.answer(page)
|
|
108
|
+
if path.endswith("/messages"):
|
|
109
|
+
return self.answer({"seq": 7})
|
|
110
|
+
if path.endswith("/stop"):
|
|
111
|
+
return self.answer(session("stopped"))
|
|
112
|
+
if path == f"/v1/agents/sessions/{SESSION_ID}" and method == "DELETE":
|
|
113
|
+
return self.answer(None, 204)
|
|
114
|
+
if path == f"/v1/agents/sessions/{SESSION_ID}" and Stub.record is not None:
|
|
115
|
+
return self.answer(Stub.record)
|
|
116
|
+
if path == f"/v1/agents/sessions/{SESSION_ID}":
|
|
117
|
+
state = Stub.states.pop(0) if len(Stub.states) > 1 else (Stub.states or ["running"])[0]
|
|
118
|
+
return self.answer(session(state, 3))
|
|
119
|
+
if path.endswith("/sessions") and method == "POST":
|
|
120
|
+
return self.answer({"session": session("queued"), "joined": body.get("key") == "customer:42", "seq": 1},
|
|
121
|
+
200 if body.get("key") == "customer:42" else 201)
|
|
122
|
+
if path.endswith("/triggers"):
|
|
123
|
+
return self.answer({"data": [TRIGGER]} if method == "GET" else TRIGGER, 200 if method == "GET" else 201)
|
|
124
|
+
if path.startswith("/v1/agents/triggers/"):
|
|
125
|
+
if method == "DELETE":
|
|
126
|
+
return self.answer(None, 204)
|
|
127
|
+
paused = path.endswith("/pause")
|
|
128
|
+
return self.answer({**TRIGGER, "pausedAt": "x" if paused else None,
|
|
129
|
+
"pausedWhy": body["why"] if paused else None})
|
|
130
|
+
if path.startswith("/v1/agents"):
|
|
131
|
+
if method == "DELETE":
|
|
132
|
+
return self.answer(None, 204)
|
|
133
|
+
return self.answer(AGENT, 201 if method == "POST" else 200)
|
|
134
|
+
self.answer({"error": {"code": "not_found", "message": "no"}}, 404)
|
|
135
|
+
|
|
136
|
+
do_GET = do_POST = do_PATCH = do_DELETE = handle_any
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
class AgentsTest(unittest.TestCase):
|
|
140
|
+
@classmethod
|
|
141
|
+
def setUpClass(cls):
|
|
142
|
+
cls.server = ThreadingHTTPServer(("127.0.0.1", 0), Stub)
|
|
143
|
+
threading.Thread(target=cls.server.serve_forever, daemon=True).start()
|
|
144
|
+
cls.url = f"http://127.0.0.1:{cls.server.server_address[1]}"
|
|
145
|
+
|
|
146
|
+
@classmethod
|
|
147
|
+
def tearDownClass(cls):
|
|
148
|
+
cls.server.shutdown()
|
|
149
|
+
|
|
150
|
+
def setUp(self):
|
|
151
|
+
Stub.seen, Stub.mode, Stub.pages, Stub.states = [], "ok", [{"data": [], "ended": True}], []
|
|
152
|
+
Stub.record = None
|
|
153
|
+
|
|
154
|
+
def client(self):
|
|
155
|
+
return Runtime(api_key="rk_test", base_url=self.url, max_retries=2)
|
|
156
|
+
|
|
157
|
+
def routes(self):
|
|
158
|
+
return [(s[0], s[1]) for s in Stub.seen]
|
|
159
|
+
|
|
160
|
+
def test_every_agent_verb_calls_its_route_with_the_apis_names(self):
|
|
161
|
+
with self.client() as runtime:
|
|
162
|
+
agent = runtime.agents.create("dev", {"command": "run"}, labels={"team": "web"})
|
|
163
|
+
self.assertEqual(agent["warnings"], [])
|
|
164
|
+
runtime.agents.get("dev bot")
|
|
165
|
+
agents = list(runtime.agents.list(limit=1))
|
|
166
|
+
self.assertEqual([a["id"] for a in agents], [AGENT_ID, "second"])
|
|
167
|
+
self.assertEqual(agents[1]["warnings"], ["subscription_for_customers"])
|
|
168
|
+
self.assertEqual(runtime.agents.update(AGENT_ID, {"command": "run2"})["version"], 1)
|
|
169
|
+
self.assertIsNone(runtime.agents.delete(AGENT_ID))
|
|
170
|
+
self.assertEqual(self.routes(), [
|
|
171
|
+
("POST", "/v1/agents"), ("GET", "/v1/agents/dev%20bot"), ("GET", "/v1/agents"), ("GET", "/v1/agents"),
|
|
172
|
+
("PATCH", f"/v1/agents/{AGENT_ID}"), ("DELETE", f"/v1/agents/{AGENT_ID}")])
|
|
173
|
+
self.assertEqual(Stub.seen[0][3], {"name": "dev", "definition": {"command": "run"}, "labels": {"team": "web"}})
|
|
174
|
+
self.assertEqual(Stub.seen[2][2], {"limit": ["1"]})
|
|
175
|
+
self.assertEqual(Stub.seen[3][2], {"cursor": ["page-2"], "limit": ["1"]})
|
|
176
|
+
self.assertEqual(Stub.seen[4][3], {"definition": {"command": "run2"}})
|
|
177
|
+
# Every write carries a key, so the transport's retries never write twice.
|
|
178
|
+
self.assertTrue(all(s[4] for s in Stub.seen if s[0] != "GET"))
|
|
179
|
+
|
|
180
|
+
def test_start_send_stop_and_the_sessions_reads(self):
|
|
181
|
+
with self.client() as runtime:
|
|
182
|
+
started = runtime.agents.start("dev", "Fix the test", labels={"pr": "7"}, idempotency_key="start-1")
|
|
183
|
+
self.assertEqual((started.id, started.state, started.joined, started.seq), (SESSION_ID, "queued", False, 1))
|
|
184
|
+
joined = runtime.agents.start(AGENT_ID, "Hello", key="customer:42")
|
|
185
|
+
self.assertTrue(joined.joined)
|
|
186
|
+
self.assertEqual(started.send("More words", idempotency_key="words-1"), 7)
|
|
187
|
+
self.assertEqual(started.stop()["state"], "stopped")
|
|
188
|
+
self.assertTrue(started.ended)
|
|
189
|
+
again = runtime.agents.sessions.get(SESSION_ID)
|
|
190
|
+
self.assertEqual((again.id, again.joined, again.seq), (SESSION_ID, False, 3))
|
|
191
|
+
listed = runtime.agents.sessions.list(agent="dev", state="running")
|
|
192
|
+
self.assertEqual([s["id"] for s in listed], [SESSION_ID, "second"])
|
|
193
|
+
self.assertIsNone(runtime.agents.sessions.delete(SESSION_ID))
|
|
194
|
+
base = f"/v1/agents/sessions/{SESSION_ID}"
|
|
195
|
+
self.assertEqual(self.routes(), [
|
|
196
|
+
("POST", "/v1/agents/dev/sessions"), ("POST", f"/v1/agents/{AGENT_ID}/sessions"),
|
|
197
|
+
("POST", f"{base}/messages"), ("POST", f"{base}/stop"), ("GET", base),
|
|
198
|
+
("GET", "/v1/agents/sessions"), ("GET", "/v1/agents/sessions"), ("DELETE", base)])
|
|
199
|
+
self.assertEqual(Stub.seen[0][3], {"input": "Fix the test", "labels": {"pr": "7"}})
|
|
200
|
+
self.assertEqual(Stub.seen[0][4], "start-1")
|
|
201
|
+
self.assertEqual(Stub.seen[1][3], {"input": "Hello", "key": "customer:42"})
|
|
202
|
+
self.assertEqual(Stub.seen[2][3], {"text": "More words"})
|
|
203
|
+
self.assertEqual(Stub.seen[2][4], "words-1")
|
|
204
|
+
self.assertEqual(Stub.seen[5][2], {"agent": ["dev"], "state": ["running"]})
|
|
205
|
+
self.assertEqual(Stub.seen[6][2], {"agent": ["dev"], "state": ["running"], "cursor": ["page-2"]})
|
|
206
|
+
self.assertTrue(all(s[4] for s in Stub.seen if s[0] != "GET"))
|
|
207
|
+
|
|
208
|
+
def test_children_and_tree_lists_read_by_parent_root_and_deleted(self):
|
|
209
|
+
with self.client() as runtime:
|
|
210
|
+
handle = runtime.agents.sessions.get(SESSION_ID)
|
|
211
|
+
children = handle.children(limit=5)
|
|
212
|
+
self.assertTrue(children.has_more)
|
|
213
|
+
self.assertEqual([s["id"] for s in children], [SESSION_ID, "second"])
|
|
214
|
+
self.assertEqual(len(list(runtime.agents.sessions.list(root=SESSION_ID, deleted=True))), 2)
|
|
215
|
+
runtime.agents.sessions.list(parent=SESSION_ID, state="done", deleted=False)
|
|
216
|
+
reads = [s[2] for s in Stub.seen if s[1] == "/v1/agents/sessions"]
|
|
217
|
+
self.assertEqual(reads, [
|
|
218
|
+
{"parent": [SESSION_ID], "limit": ["5"]}, {"parent": [SESSION_ID], "limit": ["5"], "cursor": ["page-2"]},
|
|
219
|
+
{"root": [SESSION_ID], "deleted": ["true"]}, {"root": [SESSION_ID], "deleted": ["true"], "cursor": ["page-2"]},
|
|
220
|
+
{"parent": [SESSION_ID], "state": ["done"], "deleted": ["false"]}])
|
|
221
|
+
# A spawn is the harness's own call: no SDK method sends one.
|
|
222
|
+
self.assertFalse(any(s[1].endswith("/spawn") for s in Stub.seen))
|
|
223
|
+
self.assertFalse(hasattr(handle, "spawn"))
|
|
224
|
+
|
|
225
|
+
def test_a_sessions_tree_cost_and_storage_read_as_the_api_sends_them(self):
|
|
226
|
+
Stub.record = child(reason="budget", stopWhy="budget")
|
|
227
|
+
with self.client() as runtime:
|
|
228
|
+
found = runtime.agents.sessions.get(SESSION_ID).session
|
|
229
|
+
self.assertEqual((found["trigger"], found["parentSessionId"], found["rootSessionId"], found["depth"]),
|
|
230
|
+
("spawn", SESSION_ID, SESSION_ID, 1))
|
|
231
|
+
self.assertEqual((found["reason"], found["stopWhy"]), ("budget", "budget"))
|
|
232
|
+
self.assertEqual(found["cost"], {"dollars": 0.25, "vcpuSeconds": 120, "gibSeconds": 240})
|
|
233
|
+
self.assertEqual(found["treeCost"]["dollars"], 0.75)
|
|
234
|
+
self.assertEqual((found["historyBytes"], found["attachmentBytes"]), (2048, 4096))
|
|
235
|
+
self.assertIsNone(found["deletedAt"])
|
|
236
|
+
|
|
237
|
+
def test_a_deleted_session_is_kept_as_a_record_with_an_empty_log(self):
|
|
238
|
+
Stub.record = {**session("done", 4), "reason": "deleted", "key": None, "result": None,
|
|
239
|
+
"deletedAt": "2026-10-19T00:00:00Z"}
|
|
240
|
+
with self.client() as runtime:
|
|
241
|
+
self.assertIsNone(runtime.agents.sessions.delete(SESSION_ID))
|
|
242
|
+
kept = runtime.agents.sessions.get(SESSION_ID)
|
|
243
|
+
self.assertEqual(list(kept.events()), [])
|
|
244
|
+
self.assertEqual((kept.session["reason"], kept.session["deletedAt"]), ("deleted", "2026-10-19T00:00:00Z"))
|
|
245
|
+
self.assertEqual(kept.session["cost"]["dollars"], 0.25)
|
|
246
|
+
base = f"/v1/agents/sessions/{SESSION_ID}"
|
|
247
|
+
self.assertEqual(self.routes(), [("DELETE", base), ("GET", base), ("GET", f"{base}/events")])
|
|
248
|
+
|
|
249
|
+
def test_a_childs_end_reads_in_its_parents_log(self):
|
|
250
|
+
Stub.pages = [{"data": [event(5, "child", "done: https://github.com/acme/web/pull/8")], "ended": True},
|
|
251
|
+
{"data": [], "ended": True}]
|
|
252
|
+
with self.client() as runtime:
|
|
253
|
+
events = list(runtime.agents.sessions.get(SESSION_ID).events(after=4))
|
|
254
|
+
self.assertEqual([(e["seq"], e["kind"]) for e in events], [(5, "child")])
|
|
255
|
+
|
|
256
|
+
def test_events_long_poll_from_after_and_drain_the_log_once_it_ended(self):
|
|
257
|
+
Stub.pages = [
|
|
258
|
+
{"data": [event(1, "input", "Fix it"), event(2, "status", "on it")], "ended": False},
|
|
259
|
+
{"data": [], "ended": False},
|
|
260
|
+
{"data": [event(3, "result", "https://github.com/acme/web/pull/7")], "ended": True},
|
|
261
|
+
{"data": [event(4, "note", "sandbox deleted")], "ended": True},
|
|
262
|
+
{"data": [], "ended": True},
|
|
263
|
+
]
|
|
264
|
+
with self.client() as runtime:
|
|
265
|
+
handle = runtime.agents.sessions.get(SESSION_ID)
|
|
266
|
+
events = list(handle.events())
|
|
267
|
+
self.assertEqual([e["seq"] for e in events], [1, 2, 3, 4])
|
|
268
|
+
self.assertEqual(events[2]["body"]["text"], "https://github.com/acme/web/pull/7")
|
|
269
|
+
reads = [s[2] for s in Stub.seen if s[1].endswith("/events")]
|
|
270
|
+
self.assertEqual(reads, [
|
|
271
|
+
{"after": ["0"], "wait": ["30"]}, {"after": ["2"], "wait": ["30"]}, {"after": ["2"], "wait": ["30"]},
|
|
272
|
+
{"after": ["3"], "wait": ["0"]}, {"after": ["4"], "wait": ["0"]}])
|
|
273
|
+
|
|
274
|
+
def test_events_start_after_a_given_seq(self):
|
|
275
|
+
with self.client() as runtime:
|
|
276
|
+
self.assertEqual(list(runtime.agents.sessions.get(SESSION_ID).events(after=9)), [])
|
|
277
|
+
self.assertEqual([s[2] for s in Stub.seen if s[1].endswith("/events")], [{"after": ["9"], "wait": ["30"]}])
|
|
278
|
+
|
|
279
|
+
def test_wait_follows_the_log_until_the_session_ended_and_returns_it(self):
|
|
280
|
+
Stub.states = ["running", "running", "waiting", "failed"]
|
|
281
|
+
Stub.pages = [{"data": [event(4)], "ended": False}, {"data": [], "ended": True}]
|
|
282
|
+
with self.client() as runtime:
|
|
283
|
+
handle = runtime.agents.sessions.get(SESSION_ID)
|
|
284
|
+
ended = handle.wait()
|
|
285
|
+
# A failed session is returned, not raised.
|
|
286
|
+
self.assertEqual(ended["state"], "failed")
|
|
287
|
+
self.assertEqual(handle.state, "failed")
|
|
288
|
+
base = f"/v1/agents/sessions/{SESSION_ID}"
|
|
289
|
+
self.assertEqual(self.routes(), [("GET", base), ("GET", base), ("GET", f"{base}/events"), ("GET", base),
|
|
290
|
+
("GET", f"{base}/events"), ("GET", base)])
|
|
291
|
+
self.assertTrue(all(s[2] == {"after": ["3"], "wait": ["30"]} for s in Stub.seen if s[1].endswith("/events")))
|
|
292
|
+
|
|
293
|
+
def test_a_wait_past_its_deadline_says_timeout(self):
|
|
294
|
+
Stub.states = ["running"]
|
|
295
|
+
Stub.pages = [{"data": [], "ended": False}]
|
|
296
|
+
with self.client() as runtime:
|
|
297
|
+
handle = runtime.agents.sessions.get(SESSION_ID)
|
|
298
|
+
with self.assertRaises(RuntimeAPIError) as caught:
|
|
299
|
+
handle.wait(timeout=0.3)
|
|
300
|
+
self.assertEqual(caught.exception.code, "timeout")
|
|
301
|
+
with self.assertRaises(InvalidRequestError):
|
|
302
|
+
handle.wait(timeout=-1)
|
|
303
|
+
|
|
304
|
+
def test_every_trigger_verb_calls_its_route(self):
|
|
305
|
+
with self.client() as runtime:
|
|
306
|
+
created = runtime.agents.triggers.create("dev", "github", {"repository": "acme/web", "installation": 42})
|
|
307
|
+
self.assertEqual(created["config"]["installation"], 42)
|
|
308
|
+
self.assertEqual(runtime.agents.triggers.list("dev")[0]["id"], TRIGGER_ID)
|
|
309
|
+
self.assertEqual(runtime.agents.triggers.pause(TRIGGER_ID, "release freeze")["pausedWhy"], "release freeze")
|
|
310
|
+
self.assertIsNone(runtime.agents.triggers.resume(TRIGGER_ID)["pausedAt"])
|
|
311
|
+
self.assertIsNone(runtime.agents.triggers.delete(TRIGGER_ID))
|
|
312
|
+
base = f"/v1/agents/triggers/{TRIGGER_ID}"
|
|
313
|
+
self.assertEqual(self.routes(), [
|
|
314
|
+
("POST", "/v1/agents/dev/triggers"), ("GET", "/v1/agents/dev/triggers"), ("POST", f"{base}/pause"),
|
|
315
|
+
("POST", f"{base}/resume"), ("DELETE", base)])
|
|
316
|
+
self.assertEqual(Stub.seen[0][3], {"kind": "github", "config": {"repository": "acme/web", "installation": 42}})
|
|
317
|
+
self.assertEqual(Stub.seen[2][3], {"why": "release freeze"})
|
|
318
|
+
|
|
319
|
+
def test_refusals_are_the_sdks_own_errors(self):
|
|
320
|
+
for mode, (status, code, kind) in REFUSALS.items():
|
|
321
|
+
Stub.seen, Stub.mode = [], mode
|
|
322
|
+
with self.client() as runtime:
|
|
323
|
+
with self.assertRaises(kind) as caught:
|
|
324
|
+
runtime.agents.start("dev", "hi")
|
|
325
|
+
self.assertEqual((caught.exception.code, caught.exception.status), (code, status))
|
|
326
|
+
# A 429 is retried as every product's is (with the same key); the rest are refused once.
|
|
327
|
+
self.assertEqual(len(Stub.seen), 3 if status == 429 else 1, mode)
|
|
328
|
+
|
|
329
|
+
def test_templates_are_the_guides_and_merge_a_use_over_a_harness(self):
|
|
330
|
+
with self.client() as runtime:
|
|
331
|
+
templates = runtime.agents.templates
|
|
332
|
+
self.assertEqual(list(templates), ["claude-code", "codex", "gemini-cli", "claude-agent-sdk",
|
|
333
|
+
"openai-agents-sdk"])
|
|
334
|
+
if GUIDE.exists():
|
|
335
|
+
guide = json.loads(GUIDE.read_text())
|
|
336
|
+
self.assertEqual({"templates": dict(templates), "uses": templates.uses}, guide)
|
|
337
|
+
definition = templates.definition("claude-code", use="support")
|
|
338
|
+
self.assertEqual(definition, {**templates["claude-code"]["definition"], "template": "support", "vcpu": 1,
|
|
339
|
+
"memoryMiB": 1024, "idlePauseSeconds": 10, "maxConcurrent": 1000})
|
|
340
|
+
definition["vcpu"] = 16
|
|
341
|
+
self.assertEqual(templates.definition("codex"), {"command": templates["codex"]["command"],
|
|
342
|
+
"secrets": ["OPENAI_API_KEY"]})
|
|
343
|
+
self.assertEqual(templates.definition("claude-code", "support")["vcpu"], 1)
|
|
344
|
+
self.assertEqual(templates.definition("gemini-cli", "team")["memoryMiB"], 8192)
|
|
345
|
+
for template, use in (("nope", None), ("codex", "nope")):
|
|
346
|
+
with self.assertRaises(InvalidRequestError):
|
|
347
|
+
templates.definition(template, use)
|
|
348
|
+
self.assertEqual(Stub.seen, [])
|
|
349
|
+
|
|
350
|
+
def test_async_clients_await_and_iterate_the_same_way(self):
|
|
351
|
+
Stub.pages = [{"data": [event(1), event(2)], "ended": True}, {"data": [], "ended": True}]
|
|
352
|
+
Stub.states = ["done"]
|
|
353
|
+
|
|
354
|
+
async def go():
|
|
355
|
+
async with AsyncRuntime(api_key="rk_test", base_url=self.url, max_retries=2) as runtime:
|
|
356
|
+
await runtime.agents.create("dev", runtime.agents.templates.definition("codex", "team"))
|
|
357
|
+
ids = [a["id"] async for a in await runtime.agents.list()]
|
|
358
|
+
handle = await runtime.agents.start("dev", "go")
|
|
359
|
+
seq = await handle.send("more")
|
|
360
|
+
events = [e["seq"] async for e in handle.events()]
|
|
361
|
+
ended = await handle.wait()
|
|
362
|
+
triggers = await runtime.agents.triggers.list("dev")
|
|
363
|
+
sessions = await (await runtime.agents.sessions.list()).to_list()
|
|
364
|
+
children = await (await handle.children()).to_list()
|
|
365
|
+
return ids, seq, events, ended, triggers, sessions + children
|
|
366
|
+
ids, seq, events, ended, triggers, sessions = asyncio.run(go())
|
|
367
|
+
self.assertEqual(ids, [AGENT_ID, "second"])
|
|
368
|
+
self.assertEqual((seq, events, ended["state"]), (7, [1, 2], "done"))
|
|
369
|
+
self.assertEqual((len(triggers), len(sessions)), (1, 4))
|
|
370
|
+
self.assertEqual([s[2] for s in Stub.seen if s[1] == "/v1/agents/sessions"][2:],
|
|
371
|
+
[{"parent": [SESSION_ID]}, {"parent": [SESSION_ID], "cursor": ["page-2"]}])
|
|
372
|
+
self.assertEqual(Stub.seen[0][3]["definition"]["template"], "team")
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
if __name__ == "__main__":
|
|
376
|
+
unittest.main()
|
|
@@ -107,7 +107,9 @@ class HTTPDeadline(unittest.TestCase):
|
|
|
107
107
|
with request_scope(.03):
|
|
108
108
|
transport.json("GET", "/retry")
|
|
109
109
|
self.assertEqual(caught.exception.code, "request_timeout")
|
|
110
|
-
|
|
110
|
+
# Retry-After asks for 10 s: well under that proves the deadline
|
|
111
|
+
# cut the wait, with room for a busy check machine.
|
|
112
|
+
self.assertLess(time.monotonic() - started, 2)
|
|
111
113
|
self.assertEqual(sum("retry" in path for path in self.calls), 1)
|
|
112
114
|
self.assertIsNone(current().deadline)
|
|
113
115
|
finally:
|
|
@@ -23,6 +23,7 @@ def info(**extra):
|
|
|
23
23
|
|
|
24
24
|
class Stub(BaseHTTPRequestHandler):
|
|
25
25
|
seen: list = []
|
|
26
|
+
extra: dict = {}
|
|
26
27
|
state = "running"
|
|
27
28
|
expires_in = 60
|
|
28
29
|
|
|
@@ -39,7 +40,7 @@ class Stub(BaseHTTPRequestHandler):
|
|
|
39
40
|
|
|
40
41
|
def do_GET(self):
|
|
41
42
|
Stub.seen.append(("GET", self.path, None))
|
|
42
|
-
self._answer(info())
|
|
43
|
+
self._answer(info(**Stub.extra))
|
|
43
44
|
|
|
44
45
|
def do_POST(self):
|
|
45
46
|
length = int(self.headers.get("content-length") or 0)
|
|
@@ -49,6 +50,9 @@ class Stub(BaseHTTPRequestHandler):
|
|
|
49
50
|
self._answer(info(**body))
|
|
50
51
|
elif self.path == "/v1/sandboxes":
|
|
51
52
|
self._answer(info(**({"reused": True} if body.get("getOrCreate") else {})))
|
|
53
|
+
elif self.path.endswith(":fork"):
|
|
54
|
+
self._answer({"sandboxes": [info(id=f"{ID[:-1]}{n}", secrets=body.get("secrets"))
|
|
55
|
+
for n in range(body.get("count") or 1)]})
|
|
52
56
|
else:
|
|
53
57
|
self._answer(info())
|
|
54
58
|
|
|
@@ -66,6 +70,7 @@ class LifecycleSettingsTest(unittest.TestCase):
|
|
|
66
70
|
|
|
67
71
|
def setUp(self):
|
|
68
72
|
Stub.seen = []
|
|
73
|
+
Stub.extra = {}
|
|
69
74
|
Stub.state = "running"
|
|
70
75
|
Stub.expires_in = 60
|
|
71
76
|
|
|
@@ -89,6 +94,45 @@ class LifecycleSettingsTest(unittest.TestCase):
|
|
|
89
94
|
runtime.sandboxes.create(spread_from=["a", "b"], wait=False)
|
|
90
95
|
self.assertEqual(self.posts("/v1/sandboxes")[0], {"spreadFrom": ["a", "b"]})
|
|
91
96
|
|
|
97
|
+
def test_create_sends_secrets_only_when_given(self):
|
|
98
|
+
with Runtime(api_key="rk_test", base_url=self.url, max_retries=0) as runtime:
|
|
99
|
+
runtime.sandboxes.create(secrets=["ANTHROPIC_API_KEY"], wait=False)
|
|
100
|
+
runtime.sandboxes.create(secrets=[], wait=False)
|
|
101
|
+
runtime.sandboxes.create(wait=False)
|
|
102
|
+
runtime.sandboxes.get_or_create("dev", secrets=["ANTHROPIC_API_KEY"], wait=False)
|
|
103
|
+
runtime.sandboxes.create(snapshot="snap-1", secrets=[], wait=False)
|
|
104
|
+
self.assertEqual(self.posts("/v1/sandboxes"), [
|
|
105
|
+
{"secrets": ["ANTHROPIC_API_KEY"]}, {"secrets": []}, {},
|
|
106
|
+
{"name": "dev", "getOrCreate": True, "secrets": ["ANTHROPIC_API_KEY"]},
|
|
107
|
+
{"snapshot": "snap-1", "secrets": []}])
|
|
108
|
+
|
|
109
|
+
def test_fork_sends_secrets_only_when_given(self):
|
|
110
|
+
with Runtime(api_key="rk_test", base_url=self.url, max_retries=0) as runtime:
|
|
111
|
+
sbx = runtime.sandboxes.get(ID)
|
|
112
|
+
copy = sbx.fork(secrets=["ANTHROPIC_API_KEY"])
|
|
113
|
+
none = sbx.fork(2, secrets=[])
|
|
114
|
+
sbx.fork()
|
|
115
|
+
self.assertEqual(self.posts(":fork"), [{"secrets": ["ANTHROPIC_API_KEY"]}, {"count": 2, "secrets": []}, {}])
|
|
116
|
+
self.assertEqual(copy.info["secrets"], ["ANTHROPIC_API_KEY"])
|
|
117
|
+
self.assertEqual([c.info["secrets"] for c in none], [[], []])
|
|
118
|
+
|
|
119
|
+
def test_async_create_and_fork_send_secrets(self):
|
|
120
|
+
async def go():
|
|
121
|
+
async with AsyncRuntime(api_key="rk_test", base_url=self.url, max_retries=0) as runtime:
|
|
122
|
+
sbx = await runtime.sandboxes.create(secrets=[], wait=False)
|
|
123
|
+
await sbx.fork(secrets=["ANTHROPIC_API_KEY"])
|
|
124
|
+
|
|
125
|
+
asyncio.run(go())
|
|
126
|
+
self.assertEqual(self.posts("/v1/sandboxes"), [{"secrets": []}])
|
|
127
|
+
self.assertEqual(self.posts(":fork"), [{"secrets": ["ANTHROPIC_API_KEY"]}])
|
|
128
|
+
|
|
129
|
+
def test_a_read_sandbox_carries_its_secrets(self):
|
|
130
|
+
with Runtime(api_key="rk_test", base_url=self.url, max_retries=0) as runtime:
|
|
131
|
+
Stub.extra = {"secrets": ["ANTHROPIC_API_KEY"]}
|
|
132
|
+
self.assertEqual(runtime.sandboxes.get(ID).info["secrets"], ["ANTHROPIC_API_KEY"])
|
|
133
|
+
Stub.extra = {"secrets": None}
|
|
134
|
+
self.assertIsNone(runtime.sandboxes.get(ID).info["secrets"])
|
|
135
|
+
|
|
92
136
|
def test_update_sends_only_what_changes(self):
|
|
93
137
|
with Runtime(api_key="rk_test", base_url=self.url, max_retries=0) as runtime:
|
|
94
138
|
sbx = runtime.sandboxes.get(ID)
|
|
@@ -102,6 +102,32 @@ class SecretsTest(unittest.TestCase):
|
|
|
102
102
|
expected = {"value": "ghp_x", "hosts": ["api.github.com"], "rules": rules}
|
|
103
103
|
self.assertEqual([seen[2] for seen in Stub.seen], [expected, expected])
|
|
104
104
|
|
|
105
|
+
def test_only_and_scope_are_sent_sync_and_async(self):
|
|
106
|
+
only = {"labels": [{"role": "hub"}], "sandboxes": ["ef01c6ef-6648-450b-acd2-6fe82ac31960"]}
|
|
107
|
+
with Runtime(api_key="rk_test", base_url=self.url, max_retries=0) as runtime:
|
|
108
|
+
runtime.secrets.set("SLACK_APP_TOKEN", value="xapp_x", hosts=["slack.com"], only=only)
|
|
109
|
+
runtime.secrets.set("SLACK_APP_TOKEN", value="xapp_x", hosts=["slack.com"], only={})
|
|
110
|
+
runtime.secrets.set("SLACK_APP_TOKEN", value="xapp_x", hosts=["slack.com"])
|
|
111
|
+
scoped = runtime.secrets.scope("SLACK_APP_TOKEN", {"labels": [{"role": "hub"}]})
|
|
112
|
+
runtime.secrets.scope("SLACK_APP_TOKEN", {})
|
|
113
|
+
|
|
114
|
+
async def go():
|
|
115
|
+
async with AsyncRuntime(api_key="rk_test", base_url=self.url, max_retries=0) as runtime:
|
|
116
|
+
return await runtime.secrets.scope("A B", only)
|
|
117
|
+
|
|
118
|
+
self.assertTrue(asyncio.run(go())["enforced"])
|
|
119
|
+
self.assertTrue(scoped["enforced"])
|
|
120
|
+
base = {"value": "xapp_x", "hosts": ["slack.com"]}
|
|
121
|
+
path = "/v1/egress-secrets/SLACK_APP_TOKEN"
|
|
122
|
+
self.assertEqual(Stub.seen, [
|
|
123
|
+
("PUT", path, {**base, "only": only}),
|
|
124
|
+
("PUT", path, {**base, "only": {}}),
|
|
125
|
+
("PUT", path, base), # no `only`: the scope the secret has stays
|
|
126
|
+
("PUT", f"{path}/sandboxes", {"labels": [{"role": "hub"}]}),
|
|
127
|
+
("PUT", f"{path}/sandboxes", {}),
|
|
128
|
+
("PUT", "/v1/egress-secrets/A%20B/sandboxes", only),
|
|
129
|
+
])
|
|
130
|
+
|
|
105
131
|
|
|
106
132
|
class UpstreamProxyStub(BaseHTTPRequestHandler):
|
|
107
133
|
seen: list = []
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""Agents' templates, as data: five harnesses and the two uses each can serve.
|
|
2
|
+
The same values are in every Runtime SDK and the guide
|
|
3
|
+
(packages/cloud-guide/agent-templates.json; tests/test_agents.py holds this
|
|
4
|
+
file to it).
|
|
5
|
+
|
|
6
|
+
A template is a harness: what runs in the session's sandbox, and the
|
|
7
|
+
provider's API key it needs, stored as an egress secret (the sandbox sees a
|
|
8
|
+
placeholder; the proxy adds the key on the way to ``apiKeyHost``). A use is a
|
|
9
|
+
preset merged over a template's definition: ``support`` answers your
|
|
10
|
+
customers, one session per end customer (your own key, such as
|
|
11
|
+
``customer:42``); ``team`` works on your team's code.
|
|
12
|
+
|
|
13
|
+
A subscription is for your own team's agents. An agent that serves your
|
|
14
|
+
customers (api or webhook sessions for end users) uses an API key: those are
|
|
15
|
+
the providers' terms, and the API says ``subscription_for_customers`` in the
|
|
16
|
+
agent's ``warnings`` when one does not."""
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
from typing import Any
|
|
20
|
+
|
|
21
|
+
_START = "\"$(cat ~/.runtime-agent/start.md)\""
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _template(key: str, title: str, command: str, secret: str, host: str, subscription: Any) -> dict[str, Any]:
|
|
25
|
+
return {"key": key, "title": title, "command": command, "apiKeySecret": secret, "apiKeyHost": host,
|
|
26
|
+
"subscription": subscription, "definition": {"command": command, "secrets": [secret]}}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
TEMPLATES: dict[str, dict[str, Any]] = {t["key"]: t for t in (
|
|
30
|
+
_template("claude-code", "Claude Code",
|
|
31
|
+
"npx -y @anthropic-ai/claude-code --dangerously-skip-permissions --mcp-config "
|
|
32
|
+
f"~/.runtime-agent/mcp.json -p {_START}",
|
|
33
|
+
"ANTHROPIC_API_KEY", "api.anthropic.com",
|
|
34
|
+
"token: run `claude setup-token` on your own computer (Pro/Max), then "
|
|
35
|
+
"`runtime secrets set CLAUDE_CODE_OAUTH_TOKEN` scoped to api.anthropic.com"),
|
|
36
|
+
_template("codex", "Codex CLI",
|
|
37
|
+
f"npx -y @openai/codex exec --dangerously-bypass-approvals-and-sandbox {_START}",
|
|
38
|
+
"OPENAI_API_KEY", "api.openai.com",
|
|
39
|
+
"login once in the sandbox's terminal: `npx -y @openai/codex login --device-auth`, "
|
|
40
|
+
"kept in the snapshot or a volume at `~/.codex`"),
|
|
41
|
+
_template("gemini-cli", "Gemini CLI", f"npx -y @google/gemini-cli --yolo -p {_START}",
|
|
42
|
+
"GEMINI_API_KEY", "generativelanguage.googleapis.com",
|
|
43
|
+
"login once in the sandbox's terminal (Sign in with Google), kept at `~/.gemini`"),
|
|
44
|
+
_template("claude-agent-sdk", "Claude Agent SDK", "python3 ~/agent.py",
|
|
45
|
+
"ANTHROPIC_API_KEY", "api.anthropic.com", None),
|
|
46
|
+
_template("openai-agents-sdk", "OpenAI Agents SDK", "python3 ~/agent.py",
|
|
47
|
+
"OPENAI_API_KEY", "api.openai.com", None),
|
|
48
|
+
)}
|
|
49
|
+
|
|
50
|
+
USES: dict[str, dict[str, Any]] = {
|
|
51
|
+
"support": {"key": "support", "title": "Your customers", "sessionKey": "customer:<id>",
|
|
52
|
+
"triggers": ["api", "webhook"],
|
|
53
|
+
"definition": {"template": "support", "vcpu": 1, "memoryMiB": 1024, "idlePauseSeconds": 10,
|
|
54
|
+
"maxConcurrent": 1000}},
|
|
55
|
+
"team": {"key": "team", "title": "Your team", "sessionKey": None, "triggers": ["slack", "github"],
|
|
56
|
+
"definition": {"template": "team", "vcpu": 4, "memoryMiB": 8192}},
|
|
57
|
+
}
|