e2b 2.55.0__tar.gz → 2.56.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.
- {e2b-2.55.0 → e2b-2.56.0}/PKG-INFO +6 -6
- {e2b-2.55.0 → e2b-2.56.0}/README.md +3 -3
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/__init__.py +7 -77
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client_async/__init__.py +31 -110
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client_sync/__init__.py +31 -110
- {e2b-2.55.0 → e2b-2.56.0}/e2b/connection_config.py +14 -6
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox/mcp.py +2 -2
- {e2b-2.55.0 → e2b-2.56.0}/pyproject.toml +3 -3
- {e2b-2.55.0 → e2b-2.56.0}/e2b/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/delete_sandboxes_sandbox_id.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/get_sandboxes.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/get_sandboxes_metrics.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/get_sandboxes_sandbox_id.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/get_sandboxes_sandbox_id_logs.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/get_sandboxes_sandbox_id_metrics.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/get_v2_sandboxes.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/get_v_2_sandboxes_sandbox_id_logs.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/post_sandboxes.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_connect.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_fork.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_pause.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_refreshes.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_resume.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_snapshots.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_timeout.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/post_v2_sandboxes.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/post_v_2_sandboxes_sandbox_id_connect.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/sandboxes/put_sandboxes_sandbox_id_network.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/secrets/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/secrets/delete_secrets_secret_id.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/secrets/get_secrets.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/secrets/get_secrets_secret_id.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/secrets/post_secrets.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/secrets/post_secrets_secret_id.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/snapshots/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/snapshots/get_snapshots.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/tags/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/tags/delete_templates_tags.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/tags/get_templates_template_id_tags.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/tags/post_templates_tags.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/templates/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/templates/delete_templates_template_id.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/templates/get_templates.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/templates/get_templates_aliases_alias.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/templates/get_templates_template_id.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/templates/get_templates_template_id_builds_build_id_logs.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/templates/get_templates_template_id_builds_build_id_status.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/templates/get_templates_template_id_files_hash.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/templates/get_v2_templates.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/templates/patch_templates_template_id.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/templates/patch_v_2_templates_template_id.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/templates/post_v3_templates.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/templates/post_v_2_templates_template_id_builds_build_id.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/volumes/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/volumes/delete_volumes_volume_id.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/volumes/get_volumes.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/volumes/get_volumes_volume_id.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/api/volumes/post_volumes.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/client.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/errors.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/assign_template_tags_request.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/assigned_template_tags.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/aws_registry.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/aws_registry_type.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/build_log_entry.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/build_status_reason.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/connect_sandbox.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/connect_sandbox_v2.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/delete_template_tags_request.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/error.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/gcp_registry.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/gcp_registry_type.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/general_registry.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/general_registry_type.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/listed_sandbox.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/log_level.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/logs_direction.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/logs_source.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/mcp_type_0.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/new_sandbox.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/new_sandbox_v2.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/new_secret.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/new_volume.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/order_direction.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/resumed_sandbox.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_auto_resume_config.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_detail.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_egress_proxy_config_type_0.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_fork_request.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_fork_result.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_iam.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_iam_token.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_iam_tokens.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_lifecycle.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_log.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_log_entry.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_log_entry_fields.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_logs.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_logs_v2_response.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_metric.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_network_config.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_network_config_rules.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_network_rule.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_network_transform.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_network_transform_headers.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_network_update_config.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_network_update_config_rules.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_on_timeout.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_pause_request.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_refresh_request.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_snapshot_request.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_state.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_timeout_request.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandbox_volume_mount.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/sandboxes_with_metrics.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/secret.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/secret_metadata.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/secret_update.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/snapshot_info.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/team_user.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/template.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/template_alias_response.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/template_build.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/template_build_file_upload.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/template_build_file_upload_headers.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/template_build_info.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/template_build_logs_response.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/template_build_request_v3.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/template_build_start_v2.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/template_build_status.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/template_request_response_v3.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/template_step.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/template_tag.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/template_update_request.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/template_update_response.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/template_with_builds.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/volume.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/models/volume_and_token.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/py.typed +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/client/types.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/api/metadata.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/client.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/envd/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/envd/api.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/envd/client_async/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/envd/client_shared.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/envd/client_sync/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/envd/filesystem/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/envd/filesystem/filesystem_connect.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/envd/filesystem/filesystem_pb.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/envd/interceptors.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/envd/process/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/envd/process/process_connect.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/envd/process/process_pb.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/envd/rpc.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/envd/utils.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/envd/versions.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/exceptions.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/io_utils.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/paginator.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/py.typed +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/retry.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox/_git/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox/_git/args.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox/_git/auth.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox/_git/config.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox/_git/parse.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox/_git/types.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox/commands/command_handle.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox/commands/main.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox/filesystem/filesystem.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox/filesystem/watch_handle.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox/iam.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox/main.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox/network.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox/sandbox_api.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox/signature.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox/utils.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_async/commands/command.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_async/commands/command_handle.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_async/commands/pty.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_async/filesystem/filesystem.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_async/filesystem/watch_handle.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_async/git.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_async/main.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_async/paginator.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_async/sandbox_api.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_async/utils.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_domains.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_sync/commands/command.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_sync/commands/command_handle.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_sync/commands/pty.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_sync/filesystem/filesystem.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_sync/filesystem/watch_handle.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_sync/git.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_sync/main.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_sync/paginator.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/sandbox_sync/sandbox_api.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/secret/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/secret/base.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/secret/secret_async.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/secret/secret_sync.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/secret/types.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/template/consts.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/template/dockerfile_parser.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/template/logger.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/template/main.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/template/readycmd.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/template/types.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/template/utils.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/template_async/build_api.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/template_async/main.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/template_sync/build_api.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/template_sync/main.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/api/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/api/volumes/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/api/volumes/delete_volumecontent_volume_id_path.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/api/volumes/get_volumecontent_volume_id_dir.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/api/volumes/get_volumecontent_volume_id_file.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/api/volumes/get_volumecontent_volume_id_path.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/api/volumes/patch_volumecontent_volume_id_path.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/api/volumes/post_volumecontent_volume_id_dir.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/api/volumes/put_volumecontent_volume_id_file.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/client.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/errors.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/models/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/models/error.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/models/patch_volumecontent_volume_id_path_body.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/models/volume_entry_stat.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/models/volume_entry_stat_type.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/py.typed +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client/types.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client_async/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/client_sync/__init__.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/connection_config.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/types.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/utils.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/volume_async.py +0 -0
- {e2b-2.55.0 → e2b-2.56.0}/e2b/volume/volume_sync.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: e2b
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.56.0
|
|
4
4
|
Summary: E2B SDK that give agents cloud environments
|
|
5
5
|
Author: e2b
|
|
6
6
|
Author-email: e2b <hello@e2b.dev>
|
|
@@ -15,9 +15,9 @@ Requires-Dist: packaging>=24.1
|
|
|
15
15
|
Requires-Dist: typing-extensions>=4.10.0
|
|
16
16
|
Requires-Dist: rich>=14.0.0
|
|
17
17
|
Requires-Dist: connectrpc>=0.11.1,<0.12
|
|
18
|
-
Requires-Dist: pyqwest>=0.
|
|
18
|
+
Requires-Dist: pyqwest>=0.12.0,<0.13
|
|
19
19
|
Requires-Dist: e2b-dockerfile-utils>=0.1.0,<0.2
|
|
20
|
-
Requires-Python: >=3.
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
21
|
Project-URL: Homepage, https://e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=package_homepage&utm_content=e2b
|
|
22
22
|
Project-URL: Repository, https://github.com/e2b-dev/e2b/tree/main/packages/python-sdk
|
|
23
23
|
Project-URL: Bug Tracker, https://github.com/e2b-dev/e2b/issues
|
|
@@ -93,12 +93,12 @@ Per-call params still take precedence over the client's params, and clients are
|
|
|
93
93
|
|
|
94
94
|
### High-concurrency sandbox streams
|
|
95
95
|
|
|
96
|
-
Sandbox `commands` and `files` traffic from all sandboxes in a process shares one
|
|
96
|
+
Sandbox `commands` and `files` traffic from all sandboxes in a process shares one HTTP/2 connection pool. Requests are spread over the pooled connections by free stream capacity, and a new connection is dialed only once every existing one is at the server's concurrent-stream limit (`100` for `sandbox.e2b.app`), up to `E2B_MAX_CONNECTIONS` connections per resolved address (default `200`). Past that cap, a request waits for a stream to free up. Long-running streams therefore never queue behind one connection's concurrent-stream limit, and idle processes keep a single connection.
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
`E2B_MAX_CONNECTIONS` is read when `e2b` is imported:
|
|
99
99
|
|
|
100
100
|
```sh
|
|
101
|
-
|
|
101
|
+
E2B_MAX_CONNECTIONS=400 python eval.py
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
### 5. Code execution with Code Interpreter
|
|
@@ -68,12 +68,12 @@ Per-call params still take precedence over the client's params, and clients are
|
|
|
68
68
|
|
|
69
69
|
### High-concurrency sandbox streams
|
|
70
70
|
|
|
71
|
-
Sandbox `commands` and `files` traffic from all sandboxes in a process shares one
|
|
71
|
+
Sandbox `commands` and `files` traffic from all sandboxes in a process shares one HTTP/2 connection pool. Requests are spread over the pooled connections by free stream capacity, and a new connection is dialed only once every existing one is at the server's concurrent-stream limit (`100` for `sandbox.e2b.app`), up to `E2B_MAX_CONNECTIONS` connections per resolved address (default `200`). Past that cap, a request waits for a stream to free up. Long-running streams therefore never queue behind one connection's concurrent-stream limit, and idle processes keep a single connection.
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
`E2B_MAX_CONNECTIONS` is read when `e2b` is imported:
|
|
74
74
|
|
|
75
75
|
```sh
|
|
76
|
-
|
|
76
|
+
E2B_MAX_CONNECTIONS=400 python eval.py
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
### 5. Code execution with Code Interpreter
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import logging
|
|
3
3
|
import os
|
|
4
|
-
import threading
|
|
5
4
|
from dataclasses import dataclass
|
|
6
5
|
from types import TracebackType
|
|
7
6
|
from typing import (
|
|
8
|
-
Callable,
|
|
9
|
-
Dict,
|
|
10
|
-
Generic,
|
|
11
|
-
List,
|
|
12
7
|
NamedTuple,
|
|
13
8
|
Optional,
|
|
14
9
|
Protocol,
|
|
15
10
|
Tuple,
|
|
16
|
-
TypeVar,
|
|
17
11
|
Union,
|
|
18
12
|
)
|
|
19
|
-
from urllib.parse import quote
|
|
13
|
+
from urllib.parse import quote
|
|
20
14
|
|
|
21
15
|
import httpx
|
|
22
16
|
from httpx import AsyncBaseTransport, BaseTransport, Timeout
|
|
@@ -95,78 +89,14 @@ connection_retries = int(os.getenv("E2B_CONNECTION_RETRIES") or "3")
|
|
|
95
89
|
pool_idle_timeout = float(os.getenv("E2B_KEEPALIVE_EXPIRY") or "300")
|
|
96
90
|
pool_max_idle_per_host = int(os.getenv("E2B_MAX_KEEPALIVE_CONNECTIONS") or "20")
|
|
97
91
|
|
|
98
|
-
#
|
|
99
|
-
#
|
|
100
|
-
#
|
|
101
|
-
#
|
|
102
|
-
#
|
|
103
|
-
#
|
|
104
|
-
# fewest in flight to its origin, another pool is dialed once every one
|
|
105
|
-
# carries `streams_per_connection` to that origin, up to `max_connections`
|
|
106
|
-
# pools.
|
|
107
|
-
streams_per_connection = max(1, int(os.getenv("E2B_STREAMS_PER_CONNECTION") or "100"))
|
|
92
|
+
# pyqwest spreads an origin's HTTP/2 streams over as many connections as the
|
|
93
|
+
# server's concurrent-stream limit requires (envd's edge, which all sandboxes
|
|
94
|
+
# share, advertises 100), dialing another once every connection is full, so
|
|
95
|
+
# long-running commands never queue behind one connection. `max_connections`
|
|
96
|
+
# caps the connections to each address an origin resolves to; past it, a
|
|
97
|
+
# request waits on the least loaded connection for a stream to free up.
|
|
108
98
|
max_connections = max(1, int(os.getenv("E2B_MAX_CONNECTIONS") or "200"))
|
|
109
99
|
|
|
110
|
-
T = TypeVar("T")
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
def request_origin(url: str) -> str:
|
|
114
|
-
"""The origin a request URL is served from — what a reqwest pool keeps
|
|
115
|
-
one HTTP/2 connection, and so one concurrent-stream budget, for."""
|
|
116
|
-
parts = urlsplit(url)
|
|
117
|
-
return f"{parts.scheme}://{parts.netloc}".lower()
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
class PooledConnection(Generic[T]):
|
|
121
|
-
"""One reqwest pool in a :class:`ConnectionBalancer` and the number of
|
|
122
|
-
requests in flight on it, per origin: the pool keeps a connection per
|
|
123
|
-
origin, so the streams of one never crowd out another's."""
|
|
124
|
-
|
|
125
|
-
__slots__ = ("transport", "active")
|
|
126
|
-
|
|
127
|
-
def __init__(self, transport: T) -> None:
|
|
128
|
-
self.transport = transport
|
|
129
|
-
self.active: Dict[str, int] = {}
|
|
130
|
-
|
|
131
|
-
def in_flight(self, origin: str) -> int:
|
|
132
|
-
return self.active.get(origin, 0)
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
class ConnectionBalancer(Generic[T]):
|
|
136
|
-
"""Least-loaded selection over a growable, bounded set of reqwest pools.
|
|
137
|
-
|
|
138
|
-
The policy shared by the sync and async balancing transports, which do the
|
|
139
|
-
I/O: :meth:`acquire` picks (or dials) a pool and counts the request on it,
|
|
140
|
-
:meth:`release` uncounts it once the response is consumed or closed.
|
|
141
|
-
Per-request state is a lock away from every thread and loop that shares
|
|
142
|
-
the transport; the lock is reentrant because a release can run from a
|
|
143
|
-
``__del__`` at any point, including inside :meth:`acquire`."""
|
|
144
|
-
|
|
145
|
-
def __init__(self, build: Callable[[], T]) -> None:
|
|
146
|
-
self._build = build
|
|
147
|
-
self._lock = threading.RLock()
|
|
148
|
-
self.connections: List[PooledConnection[T]] = [PooledConnection(build())]
|
|
149
|
-
|
|
150
|
-
def acquire(self, origin: str) -> PooledConnection[T]:
|
|
151
|
-
with self._lock:
|
|
152
|
-
connection = min(self.connections, key=lambda c: c.in_flight(origin))
|
|
153
|
-
if (
|
|
154
|
-
connection.in_flight(origin) >= streams_per_connection
|
|
155
|
-
and len(self.connections) < max_connections
|
|
156
|
-
):
|
|
157
|
-
connection = PooledConnection(self._build())
|
|
158
|
-
self.connections.append(connection)
|
|
159
|
-
connection.active[origin] = connection.in_flight(origin) + 1
|
|
160
|
-
return connection
|
|
161
|
-
|
|
162
|
-
def release(self, connection: PooledConnection[T], origin: str) -> None:
|
|
163
|
-
with self._lock:
|
|
164
|
-
remaining = connection.in_flight(origin) - 1
|
|
165
|
-
if remaining:
|
|
166
|
-
connection.active[origin] = remaining
|
|
167
|
-
else:
|
|
168
|
-
del connection.active[origin]
|
|
169
|
-
|
|
170
100
|
|
|
171
101
|
class ProxyConfig(NamedTuple):
|
|
172
102
|
"""The ``proxy`` connection option in the shape pyqwest transports take.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import threading
|
|
2
|
-
from
|
|
3
|
-
from typing import AsyncIterator, Callable, Dict, Optional, Tuple, Union
|
|
2
|
+
from typing import Dict, Optional, Tuple, Union
|
|
4
3
|
|
|
5
4
|
import httpx
|
|
6
5
|
|
|
@@ -11,14 +10,13 @@ from pyqwest.middleware.retry import RetryMode, RetryTransport
|
|
|
11
10
|
from e2b.retry import AsyncRetryableTransport
|
|
12
11
|
from e2b.api import (
|
|
13
12
|
AsyncApiClient,
|
|
14
|
-
ConnectionBalancer,
|
|
15
13
|
ProxyConfig,
|
|
16
14
|
connection_retries,
|
|
15
|
+
max_connections,
|
|
17
16
|
make_async_logging_event_hooks,
|
|
18
17
|
pool_idle_timeout,
|
|
19
18
|
pool_max_idle_per_host,
|
|
20
19
|
proxy_to_config,
|
|
21
|
-
request_origin,
|
|
22
20
|
)
|
|
23
21
|
from e2b.connection_config import (
|
|
24
22
|
DEFAULT_HTTP_VERSION,
|
|
@@ -61,89 +59,13 @@ class ConnectionRetryTransport(RetryTransport):
|
|
|
61
59
|
return isinstance(response, ConnectionError)
|
|
62
60
|
|
|
63
61
|
|
|
64
|
-
_Chunk = Union[bytes, bytearray, memoryview]
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
class _TrackedContent:
|
|
68
|
-
"""The content iterator of a balanced response: hands back the original
|
|
69
|
-
response's chunks and releases its connection slot exactly once, after
|
|
70
|
-
the stream is over — when the content is exhausted, when the response is
|
|
71
|
-
closed (``Response`` forwards ``aclose`` to its content), when reading
|
|
72
|
-
fails, or, failing all of those, when it is garbage collected, which
|
|
73
|
-
drops the original response and so resets its stream."""
|
|
74
|
-
|
|
75
|
-
__slots__ = ("_response", "_content", "_release")
|
|
76
|
-
|
|
77
|
-
def __init__(self, response: Response, release: Callable[[], None]) -> None:
|
|
78
|
-
self._response = response
|
|
79
|
-
self._content = response.content.__aiter__()
|
|
80
|
-
self._release: Optional[Callable[[], None]] = release
|
|
81
|
-
|
|
82
|
-
def __aiter__(self) -> AsyncIterator[_Chunk]:
|
|
83
|
-
return self
|
|
84
|
-
|
|
85
|
-
async def __anext__(self) -> _Chunk:
|
|
86
|
-
try:
|
|
87
|
-
return await self._content.__anext__()
|
|
88
|
-
except BaseException:
|
|
89
|
-
await self.aclose()
|
|
90
|
-
raise
|
|
91
|
-
|
|
92
|
-
async def aclose(self) -> None:
|
|
93
|
-
release, self._release = self._release, None
|
|
94
|
-
if release is None:
|
|
95
|
-
return
|
|
96
|
-
try:
|
|
97
|
-
await self._response.aclose()
|
|
98
|
-
finally:
|
|
99
|
-
release()
|
|
100
|
-
|
|
101
|
-
def __del__(self) -> None:
|
|
102
|
-
release, self._release = self._release, None
|
|
103
|
-
if release is None:
|
|
104
|
-
return
|
|
105
|
-
del self._content, self._response
|
|
106
|
-
release()
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
class BalancingTransport(Transport):
|
|
110
|
-
"""A pyqwest transport over a growable, bounded set of reqwest pools
|
|
111
|
-
(see :class:`e2b.api.ConnectionBalancer`): each request runs on the pool
|
|
112
|
-
with the fewest in flight to its origin and counts against it until its
|
|
113
|
-
response is consumed or closed. Pools are built with ``build`` — the first
|
|
114
|
-
eagerly, the rest as load requires — so they share every construction
|
|
115
|
-
knob."""
|
|
116
|
-
|
|
117
|
-
def __init__(self, build: Callable[[], HTTPTransport]) -> None:
|
|
118
|
-
self.balancer: ConnectionBalancer[HTTPTransport] = ConnectionBalancer(build)
|
|
119
|
-
|
|
120
|
-
async def execute(self, request: Request) -> Response:
|
|
121
|
-
origin = request_origin(request.url)
|
|
122
|
-
connection = self.balancer.acquire(origin)
|
|
123
|
-
try:
|
|
124
|
-
response = await connection.transport.execute(request)
|
|
125
|
-
except BaseException:
|
|
126
|
-
self.balancer.release(connection, origin)
|
|
127
|
-
raise
|
|
128
|
-
return Response(
|
|
129
|
-
status=response.status,
|
|
130
|
-
http_version=response.http_version,
|
|
131
|
-
headers=response.headers,
|
|
132
|
-
content=_TrackedContent(
|
|
133
|
-
response, partial(self.balancer.release, connection, origin)
|
|
134
|
-
),
|
|
135
|
-
# Populated in place once the original content is consumed.
|
|
136
|
-
trailers=response.trailers,
|
|
137
|
-
)
|
|
138
|
-
|
|
139
|
-
|
|
140
62
|
_TransportKey = Tuple[Optional[ProxyConfig], Optional[float], HttpVersion]
|
|
141
63
|
"""Cache key: proxy, idle read bound, HTTP version — fixed when a pyqwest
|
|
142
64
|
transport is constructed, so each distinct combination is necessarily its own
|
|
143
65
|
transport."""
|
|
144
66
|
|
|
145
67
|
_transport_lock = threading.Lock()
|
|
146
|
-
# One
|
|
68
|
+
# One transport — a reqwest connection pool — per key; a
|
|
147
69
|
# `None` proxy is the direct transport. The REST API, envd RPC, envd HTTP API
|
|
148
70
|
# and volume stacks all draw from the same one for their proxy, so a sandbox's
|
|
149
71
|
# RPC and HTTP traffic multiplex over the same connections instead of opening
|
|
@@ -153,9 +75,9 @@ _transport_lock = threading.Lock()
|
|
|
153
75
|
# they replaced, the transports are not bound to an event loop and the caches
|
|
154
76
|
# are process-global rather than per-loop.
|
|
155
77
|
_transports: Dict[_TransportKey, ConnectionRetryTransport] = {}
|
|
156
|
-
# The
|
|
78
|
+
# The pyqwest transport under each retrying one, for callers that must not
|
|
157
79
|
# retry connecting (the health probe run after a request failed).
|
|
158
|
-
_pools: Dict[_TransportKey,
|
|
80
|
+
_pools: Dict[_TransportKey, HTTPTransport] = {}
|
|
159
81
|
# The httpx adapter over each transport, shared by every httpx client on it.
|
|
160
82
|
_httpx_transports: Dict[Tuple[_TransportKey, bool], AsyncPyqwestTransport] = {}
|
|
161
83
|
|
|
@@ -169,18 +91,19 @@ def get_pyqwest_transport(
|
|
|
169
91
|
) -> Transport:
|
|
170
92
|
"""The shared pyqwest transport with the SDK's tuning — system CA certs
|
|
171
93
|
(without which TLS through an intercepting proxy fails) and the
|
|
172
|
-
httpx-equivalent pool limits — behind connect-only retries.
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
94
|
+
httpx-equivalent pool limits — behind connect-only retries. pyqwest
|
|
95
|
+
spreads each origin's HTTP/2 streams over as many connections as the
|
|
96
|
+
server's concurrent-stream limit requires, up to ``max_connections`` per
|
|
97
|
+
address, so long-running streams do not all queue behind one
|
|
98
|
+
connection.
|
|
176
99
|
|
|
177
100
|
Consumers speaking pyqwest natively (the envd RPC clients) take this;
|
|
178
101
|
consumers speaking httpx take :func:`get_httpx_transport`, the adapter over
|
|
179
102
|
the very same transport. Layer concerns above it rather than into it — the
|
|
180
103
|
RPC stack's plain-HTTP-error normalization wraps it, headers and codecs are
|
|
181
|
-
per-request — so that the
|
|
104
|
+
per-request — so that the pool stays shareable.
|
|
182
105
|
|
|
183
|
-
``read_timeout`` bounds every read on the
|
|
106
|
+
``read_timeout`` bounds every read on the pool's connections and
|
|
184
107
|
``http_version`` fixes the HTTP version; both are part of the cache key
|
|
185
108
|
because they are transport-construction knobs, so one pool cannot serve two
|
|
186
109
|
values of either. reqwest's read timer keeps running while a request body is sent and
|
|
@@ -193,30 +116,28 @@ def get_pyqwest_transport(
|
|
|
193
116
|
diagnostics httpcore used to provide. The SDK's own ``logger`` option is
|
|
194
117
|
separate and sits above this, on the httpx client.
|
|
195
118
|
|
|
196
|
-
``retry_connect=False`` returns the
|
|
197
|
-
one — the same
|
|
119
|
+
``retry_connect=False`` returns the pyqwest transport under the retrying
|
|
120
|
+
one — the same pool, without the connection retries."""
|
|
198
121
|
key = (proxy, read_timeout, http_version)
|
|
199
122
|
|
|
200
|
-
def build() -> HTTPTransport:
|
|
201
|
-
return HTTPTransport(
|
|
202
|
-
tls_include_system_certs=True,
|
|
203
|
-
proxy=proxy.to_pyqwest() if proxy is not None else None,
|
|
204
|
-
pool_idle_timeout=pool_idle_timeout,
|
|
205
|
-
pool_max_idle_per_host=pool_max_idle_per_host,
|
|
206
|
-
read_timeout=read_timeout,
|
|
207
|
-
# `None` leaves the version to ALPN on TLS connections (HTTP/2
|
|
208
|
-
# against the E2B API and envd) and uses HTTP/1 for plaintext,
|
|
209
|
-
# like the http2-enabled httpx transport this replaced.
|
|
210
|
-
http_version=HTTPVersion.HTTP1 if http_version == "1.1" else None,
|
|
211
|
-
# Redirects belong to the httpx client above (which the generated
|
|
212
|
-
# clients leave off), not to reqwest.
|
|
213
|
-
follow_redirects=False,
|
|
214
|
-
)
|
|
215
|
-
|
|
216
123
|
with _transport_lock:
|
|
217
124
|
transport = _transports.get(key)
|
|
218
125
|
if transport is None:
|
|
219
|
-
pool =
|
|
126
|
+
pool = HTTPTransport(
|
|
127
|
+
tls_include_system_certs=True,
|
|
128
|
+
proxy=proxy.to_pyqwest() if proxy is not None else None,
|
|
129
|
+
pool_idle_timeout=pool_idle_timeout,
|
|
130
|
+
pool_max_idle_per_host=pool_max_idle_per_host,
|
|
131
|
+
max_connections_per_address=max_connections,
|
|
132
|
+
read_timeout=read_timeout,
|
|
133
|
+
# `None` leaves the version to ALPN on TLS connections (HTTP/2
|
|
134
|
+
# against the E2B API and envd) and uses HTTP/1 for plaintext,
|
|
135
|
+
# like the http2-enabled httpx transport this replaced.
|
|
136
|
+
http_version=HTTPVersion.HTTP1 if http_version == "1.1" else None,
|
|
137
|
+
# Redirects belong to the httpx client above (which the generated
|
|
138
|
+
# clients leave off), not to reqwest.
|
|
139
|
+
follow_redirects=False,
|
|
140
|
+
)
|
|
220
141
|
transport = ConnectionRetryTransport(pool, max_retries=connection_retries)
|
|
221
142
|
_pools[key] = pool
|
|
222
143
|
_transports[key] = transport
|
|
@@ -233,9 +154,9 @@ def get_httpx_transport(
|
|
|
233
154
|
"""The httpx adapter over the shared transport of
|
|
234
155
|
:func:`get_pyqwest_transport`, for the generated httpx clients (control
|
|
235
156
|
plane, envd HTTP API, volume content). The adapter holds no state of its
|
|
236
|
-
own and does not close the
|
|
157
|
+
own and does not close the pool, so closing an httpx client leaves it
|
|
237
158
|
intact for the other clients on it. ``retry_connect=False`` adapts the
|
|
238
|
-
same
|
|
159
|
+
same pool without the connection retries."""
|
|
239
160
|
key = ((proxy, read_timeout, http_version), retry_connect)
|
|
240
161
|
# Resolve the pool before taking the lock: it takes the same one.
|
|
241
162
|
pool = get_pyqwest_transport(
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
from
|
|
2
|
-
from typing import Callable, Dict, Iterator, Optional, Tuple, Union
|
|
1
|
+
from typing import Dict, Optional, Tuple, Union
|
|
3
2
|
|
|
4
3
|
import httpx
|
|
5
4
|
import threading
|
|
@@ -17,14 +16,13 @@ from pyqwest.middleware.retry import RetryMode, SyncRetryTransport
|
|
|
17
16
|
from e2b.retry import RetryableTransport
|
|
18
17
|
from e2b.api import (
|
|
19
18
|
ApiClient,
|
|
20
|
-
ConnectionBalancer,
|
|
21
19
|
ProxyConfig,
|
|
22
20
|
connection_retries,
|
|
21
|
+
max_connections,
|
|
23
22
|
make_logging_event_hooks,
|
|
24
23
|
pool_idle_timeout,
|
|
25
24
|
pool_max_idle_per_host,
|
|
26
25
|
proxy_to_config,
|
|
27
|
-
request_origin,
|
|
28
26
|
)
|
|
29
27
|
from e2b.connection_config import (
|
|
30
28
|
DEFAULT_HTTP_VERSION,
|
|
@@ -67,89 +65,13 @@ class ConnectionRetryTransport(SyncRetryTransport):
|
|
|
67
65
|
return isinstance(response, ConnectionError)
|
|
68
66
|
|
|
69
67
|
|
|
70
|
-
_Chunk = Union[bytes, bytearray, memoryview]
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
class _TrackedContent:
|
|
74
|
-
"""The content iterator of a balanced response: hands back the original
|
|
75
|
-
response's chunks and releases its connection slot exactly once, after
|
|
76
|
-
the stream is over — when the content is exhausted, when the response is
|
|
77
|
-
closed (``SyncResponse`` forwards ``close`` to its content), when reading
|
|
78
|
-
fails, or, failing all of those, when it is garbage collected, which
|
|
79
|
-
drops the original response and so resets its stream."""
|
|
80
|
-
|
|
81
|
-
__slots__ = ("_response", "_content", "_release")
|
|
82
|
-
|
|
83
|
-
def __init__(self, response: SyncResponse, release: Callable[[], None]) -> None:
|
|
84
|
-
self._response = response
|
|
85
|
-
self._content = iter(response.content)
|
|
86
|
-
self._release: Optional[Callable[[], None]] = release
|
|
87
|
-
|
|
88
|
-
def __iter__(self) -> Iterator[_Chunk]:
|
|
89
|
-
return self
|
|
90
|
-
|
|
91
|
-
def __next__(self) -> _Chunk:
|
|
92
|
-
try:
|
|
93
|
-
return next(self._content)
|
|
94
|
-
except BaseException:
|
|
95
|
-
self.close()
|
|
96
|
-
raise
|
|
97
|
-
|
|
98
|
-
def close(self) -> None:
|
|
99
|
-
release, self._release = self._release, None
|
|
100
|
-
if release is None:
|
|
101
|
-
return
|
|
102
|
-
try:
|
|
103
|
-
self._response.close()
|
|
104
|
-
finally:
|
|
105
|
-
release()
|
|
106
|
-
|
|
107
|
-
def __del__(self) -> None:
|
|
108
|
-
release, self._release = self._release, None
|
|
109
|
-
if release is None:
|
|
110
|
-
return
|
|
111
|
-
del self._content, self._response
|
|
112
|
-
release()
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
class BalancingTransport(SyncTransport):
|
|
116
|
-
"""A pyqwest transport over a growable, bounded set of reqwest pools
|
|
117
|
-
(see :class:`e2b.api.ConnectionBalancer`): each request runs on the pool
|
|
118
|
-
with the fewest in flight to its origin and counts against it until its
|
|
119
|
-
response is consumed or closed. Pools are built with ``build`` — the first
|
|
120
|
-
eagerly, the rest as load requires — so they share every construction
|
|
121
|
-
knob."""
|
|
122
|
-
|
|
123
|
-
def __init__(self, build: Callable[[], SyncHTTPTransport]) -> None:
|
|
124
|
-
self.balancer: ConnectionBalancer[SyncHTTPTransport] = ConnectionBalancer(build)
|
|
125
|
-
|
|
126
|
-
def execute_sync(self, request: SyncRequest) -> SyncResponse:
|
|
127
|
-
origin = request_origin(request.url)
|
|
128
|
-
connection = self.balancer.acquire(origin)
|
|
129
|
-
try:
|
|
130
|
-
response = connection.transport.execute_sync(request)
|
|
131
|
-
except BaseException:
|
|
132
|
-
self.balancer.release(connection, origin)
|
|
133
|
-
raise
|
|
134
|
-
return SyncResponse(
|
|
135
|
-
status=response.status,
|
|
136
|
-
http_version=response.http_version,
|
|
137
|
-
headers=response.headers,
|
|
138
|
-
content=_TrackedContent(
|
|
139
|
-
response, partial(self.balancer.release, connection, origin)
|
|
140
|
-
),
|
|
141
|
-
# Populated in place once the original content is consumed.
|
|
142
|
-
trailers=response.trailers,
|
|
143
|
-
)
|
|
144
|
-
|
|
145
|
-
|
|
146
68
|
_TransportKey = Tuple[Optional[ProxyConfig], Optional[float], HttpVersion]
|
|
147
69
|
"""Cache key: proxy, idle read bound, HTTP version — fixed when a pyqwest
|
|
148
70
|
transport is constructed, so each distinct combination is necessarily its own
|
|
149
71
|
transport."""
|
|
150
72
|
|
|
151
73
|
_transport_lock = threading.Lock()
|
|
152
|
-
# One
|
|
74
|
+
# One transport — a reqwest connection pool — per key; a
|
|
153
75
|
# `None` proxy is the direct transport. The REST API, envd RPC, envd HTTP API
|
|
154
76
|
# and volume stacks all draw from the same one for their proxy, so a sandbox's
|
|
155
77
|
# RPC and HTTP traffic multiplex over the same connections instead of opening
|
|
@@ -158,9 +80,9 @@ _transport_lock = threading.Lock()
|
|
|
158
80
|
# pyqwest transports are thread-safe, so unlike the httpx transports they
|
|
159
81
|
# replaced, the caches are process-global rather than per-thread.
|
|
160
82
|
_transports: Dict[_TransportKey, ConnectionRetryTransport] = {}
|
|
161
|
-
# The
|
|
83
|
+
# The pyqwest transport under each retrying one, for callers that must not
|
|
162
84
|
# retry connecting (the health probe run after a request failed).
|
|
163
|
-
_pools: Dict[_TransportKey,
|
|
85
|
+
_pools: Dict[_TransportKey, SyncHTTPTransport] = {}
|
|
164
86
|
# The httpx adapter over each transport, shared by every httpx client on it.
|
|
165
87
|
_httpx_transports: Dict[Tuple[_TransportKey, bool], PyqwestTransport] = {}
|
|
166
88
|
|
|
@@ -174,18 +96,19 @@ def get_pyqwest_transport(
|
|
|
174
96
|
) -> SyncTransport:
|
|
175
97
|
"""The shared pyqwest transport with the SDK's tuning — system CA certs
|
|
176
98
|
(without which TLS through an intercepting proxy fails) and the
|
|
177
|
-
httpx-equivalent pool limits — behind connect-only retries.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
99
|
+
httpx-equivalent pool limits — behind connect-only retries. pyqwest
|
|
100
|
+
spreads each origin's HTTP/2 streams over as many connections as the
|
|
101
|
+
server's concurrent-stream limit requires, up to ``max_connections`` per
|
|
102
|
+
address, so long-running streams do not all queue behind one
|
|
103
|
+
connection.
|
|
181
104
|
|
|
182
105
|
Consumers speaking pyqwest natively (the envd RPC clients) take this;
|
|
183
106
|
consumers speaking httpx take :func:`get_httpx_transport`, the adapter over
|
|
184
107
|
the very same transport. Layer concerns above it rather than into it — the
|
|
185
108
|
RPC stack's plain-HTTP-error normalization wraps it, headers and codecs are
|
|
186
|
-
per-request — so that the
|
|
109
|
+
per-request — so that the pool stays shareable.
|
|
187
110
|
|
|
188
|
-
``read_timeout`` bounds every read on the
|
|
111
|
+
``read_timeout`` bounds every read on the pool's connections and
|
|
189
112
|
``http_version`` fixes the HTTP version; both are part of the cache key
|
|
190
113
|
because they are transport-construction knobs, so one pool cannot serve two
|
|
191
114
|
values of either. reqwest's read timer keeps running while a request body is sent and
|
|
@@ -198,30 +121,28 @@ def get_pyqwest_transport(
|
|
|
198
121
|
diagnostics httpcore used to provide. The SDK's own ``logger`` option is
|
|
199
122
|
separate and sits above this, on the httpx client.
|
|
200
123
|
|
|
201
|
-
``retry_connect=False`` returns the
|
|
202
|
-
one — the same
|
|
124
|
+
``retry_connect=False`` returns the pyqwest transport under the retrying
|
|
125
|
+
one — the same pool, without the connection retries."""
|
|
203
126
|
key = (proxy, read_timeout, http_version)
|
|
204
127
|
|
|
205
|
-
def build() -> SyncHTTPTransport:
|
|
206
|
-
return SyncHTTPTransport(
|
|
207
|
-
tls_include_system_certs=True,
|
|
208
|
-
proxy=proxy.to_pyqwest() if proxy is not None else None,
|
|
209
|
-
pool_idle_timeout=pool_idle_timeout,
|
|
210
|
-
pool_max_idle_per_host=pool_max_idle_per_host,
|
|
211
|
-
read_timeout=read_timeout,
|
|
212
|
-
# `None` leaves the version to ALPN on TLS connections (HTTP/2
|
|
213
|
-
# against the E2B API and envd) and uses HTTP/1 for plaintext,
|
|
214
|
-
# like the http2-enabled httpx transport this replaced.
|
|
215
|
-
http_version=HTTPVersion.HTTP1 if http_version == "1.1" else None,
|
|
216
|
-
# Redirects belong to the httpx client above (which the generated
|
|
217
|
-
# clients leave off), not to reqwest.
|
|
218
|
-
follow_redirects=False,
|
|
219
|
-
)
|
|
220
|
-
|
|
221
128
|
with _transport_lock:
|
|
222
129
|
transport = _transports.get(key)
|
|
223
130
|
if transport is None:
|
|
224
|
-
pool =
|
|
131
|
+
pool = SyncHTTPTransport(
|
|
132
|
+
tls_include_system_certs=True,
|
|
133
|
+
proxy=proxy.to_pyqwest() if proxy is not None else None,
|
|
134
|
+
pool_idle_timeout=pool_idle_timeout,
|
|
135
|
+
pool_max_idle_per_host=pool_max_idle_per_host,
|
|
136
|
+
max_connections_per_address=max_connections,
|
|
137
|
+
read_timeout=read_timeout,
|
|
138
|
+
# `None` leaves the version to ALPN on TLS connections (HTTP/2
|
|
139
|
+
# against the E2B API and envd) and uses HTTP/1 for plaintext,
|
|
140
|
+
# like the http2-enabled httpx transport this replaced.
|
|
141
|
+
http_version=HTTPVersion.HTTP1 if http_version == "1.1" else None,
|
|
142
|
+
# Redirects belong to the httpx client above (which the generated
|
|
143
|
+
# clients leave off), not to reqwest.
|
|
144
|
+
follow_redirects=False,
|
|
145
|
+
)
|
|
225
146
|
transport = ConnectionRetryTransport(pool, max_retries=connection_retries)
|
|
226
147
|
_pools[key] = pool
|
|
227
148
|
_transports[key] = transport
|
|
@@ -238,9 +159,9 @@ def get_httpx_transport(
|
|
|
238
159
|
"""The httpx adapter over the shared transport of
|
|
239
160
|
:func:`get_pyqwest_transport`, for the generated httpx clients (control
|
|
240
161
|
plane, envd HTTP API, volume content). The adapter holds no state of its
|
|
241
|
-
own and does not close the
|
|
162
|
+
own and does not close the pool, so closing an httpx client leaves it
|
|
242
163
|
intact for the other clients on it. ``retry_connect=False`` adapts the
|
|
243
|
-
same
|
|
164
|
+
same pool without the connection retries."""
|
|
244
165
|
key = ((proxy, read_timeout, http_version), retry_connect)
|
|
245
166
|
# Resolve the pool before taking the lock: it takes the same one.
|
|
246
167
|
pool = get_pyqwest_transport(
|
|
@@ -326,27 +326,35 @@ class ConnectionConfig:
|
|
|
326
326
|
def get_request_timeout(self, request_timeout: Optional[float] = None):
|
|
327
327
|
return self._get_request_timeout(self.request_timeout, request_timeout)
|
|
328
328
|
|
|
329
|
-
def get_sandbox_url(
|
|
329
|
+
def get_sandbox_url(
|
|
330
|
+
self, sandbox_id: str, sandbox_domain: str, port: Optional[int] = None
|
|
331
|
+
) -> str:
|
|
332
|
+
port = self.envd_port if port is None else port
|
|
333
|
+
|
|
330
334
|
if self._sandbox_url:
|
|
331
335
|
return self._sandbox_url # type: ignore[return-value]
|
|
332
336
|
|
|
333
337
|
if self.debug:
|
|
334
|
-
return f"http://{self.get_host(sandbox_id, sandbox_domain,
|
|
338
|
+
return f"http://{self.get_host(sandbox_id, sandbox_domain, port)}"
|
|
335
339
|
|
|
336
340
|
sandbox_domain = sandbox_domain or self.domain
|
|
337
341
|
if is_supported_sandbox_domain(sandbox_domain):
|
|
338
342
|
return f"https://sandbox.{sandbox_domain}"
|
|
339
343
|
|
|
340
|
-
return f"https://{self.get_host(sandbox_id, sandbox_domain,
|
|
344
|
+
return f"https://{self.get_host(sandbox_id, sandbox_domain, port)}"
|
|
345
|
+
|
|
346
|
+
def get_sandbox_direct_url(
|
|
347
|
+
self, sandbox_id: str, sandbox_domain: str, port: Optional[int] = None
|
|
348
|
+
) -> str:
|
|
349
|
+
port = self.envd_port if port is None else port
|
|
341
350
|
|
|
342
|
-
def get_sandbox_direct_url(self, sandbox_id: str, sandbox_domain: str) -> str:
|
|
343
351
|
if self._sandbox_url:
|
|
344
352
|
return self._sandbox_url # type: ignore[return-value]
|
|
345
353
|
|
|
346
354
|
if self.debug:
|
|
347
|
-
return f"http://{self.get_host(sandbox_id, sandbox_domain,
|
|
355
|
+
return f"http://{self.get_host(sandbox_id, sandbox_domain, port)}"
|
|
348
356
|
|
|
349
|
-
return f"https://{self.get_host(sandbox_id, sandbox_domain,
|
|
357
|
+
return f"https://{self.get_host(sandbox_id, sandbox_domain, port)}"
|
|
350
358
|
|
|
351
359
|
def get_host(self, sandbox_id: str, sandbox_domain: str, port: int) -> str:
|
|
352
360
|
"""
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "e2b"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.56.0"
|
|
4
4
|
description = "E2B SDK that give agents cloud environments"
|
|
5
5
|
authors = [{ name = "e2b", email = "hello@e2b.dev" }]
|
|
6
6
|
license = "MIT"
|
|
7
7
|
readme = "README.md"
|
|
8
|
-
requires-python = ">=3.
|
|
8
|
+
requires-python = ">=3.11"
|
|
9
9
|
dependencies = [
|
|
10
10
|
"python-dateutil>=2.8.2",
|
|
11
11
|
"wcmatch>=10.1,<12",
|
|
@@ -19,7 +19,7 @@ dependencies = [
|
|
|
19
19
|
"typing-extensions>=4.10.0",
|
|
20
20
|
"rich>=14.0.0",
|
|
21
21
|
"connectrpc>=0.11.1,<0.12",
|
|
22
|
-
"pyqwest>=0.
|
|
22
|
+
"pyqwest>=0.12.0,<0.13",
|
|
23
23
|
"e2b-dockerfile-utils>=0.1.0,<0.2",
|
|
24
24
|
]
|
|
25
25
|
|